![]() |
Arene Base
Fundamental Utilities For Safety Critical C++
|
A class representing a single point in time for the given clock. More...
Public Types | |
| using | clock = Clock |
| The clock on which this is a time point. | |
| using | duration = Duration |
A std::chrono::duration specialization to be used to represent the time since the clock's epoch. | |
| using | period = typename duration::period |
The period (length of one tick) used by duration, relative to 1 second. | |
| using | rep = typename duration::rep |
| The underlying arithmetic type used to represent the time since the clock's epoch. | |
Public Member Functions | |
| constexpr | time_point () noexcept(noexcept(duration(duration::zero()))) |
Default-construct a time_point referring to clock's epoch. | |
| constexpr | time_point (duration const &epoch_time) noexcept(is_nothrow_copy_constructible_v< duration >) |
Construct a time_point referring to the point a certain length of time after clock's epoch. | |
| template<class Duration2, arene::base::constraints< enable_if_t< is_convertible_v< Duration2, duration > > > = nullptr> | |
| constexpr | time_point (time_point< clock, Duration2 > const &other) noexcept(is_nothrow_constructible_v< duration, Duration2 >) |
Implicitly convert a time_point for the same clock, potentially even if it has a different duration. | |
| auto | operator+= (duration const &dur) noexcept(noexcept(time_since_epoch_+=dur)) -> time_point & |
Move this time_point forward by a certain duration. | |
| auto | operator-= (duration const &dur) noexcept(noexcept(time_since_epoch_ -=dur)) -> time_point & |
Move this time_point backward by a certain duration. | |
| constexpr auto | time_since_epoch () const noexcept(is_nothrow_copy_constructible_v< duration >) -> duration |
Return the time of a particular time_point as the duration since its clock's epoch. | |
Static Public Member Functions | |
| static constexpr auto | max () noexcept(noexcept(time_point{duration::max()})) -> time_point |
Get the maximum time_point representable by this class. | |
| static constexpr auto | min () noexcept(noexcept(time_point{duration::min()})) -> time_point |
Get the minimum time_point representable by this class. | |
A class representing a single point in time for the given clock.
| Clock | The clock on which this is a time point |
| Duration | The type representing time since the clock's epoch; must be an instance of std::chrono::duration |
| using std::chrono::time_point< Clock, Duration >::clock = Clock |
The clock on which this is a time point.
| using std::chrono::time_point< Clock, Duration >::duration = Duration |
A std::chrono::duration specialization to be used to represent the time since the clock's epoch.
| using std::chrono::time_point< Clock, Duration >::period = typename duration::period |
The period (length of one tick) used by duration, relative to 1 second.
| using std::chrono::time_point< Clock, Duration >::rep = typename duration::rep |
The underlying arithmetic type used to represent the time since the clock's epoch.
|
inlineconstexprnoexcept |
Default-construct a time_point referring to clock's epoch.
|
inlineexplicitconstexprnoexcept |
Construct a time_point referring to the point a certain length of time after clock's epoch.
| epoch_time | The amount of time after clock's epoch which the new time_point will represent |
|
inlineconstexprnoexcept |
Implicitly convert a time_point for the same clock, potentially even if it has a different duration.
| Duration2 | The duration representation for the other time point; must be convertible to duration |
| other | The time point to convert |
|
inlinestaticconstexprnoexcept |
Get the maximum time_point representable by this class.
time_point corresponding to the latest representable time
|
inlinestaticconstexprnoexcept |
Get the minimum time_point representable by this class.
time_point corresponding to the earliest representable time
|
inlinenoexcept |
Move this time_point forward by a certain duration.
| dur | The duration to move forward by |
duration::operator+= can overflow
|
inlinenoexcept |
Move this time_point backward by a certain duration.
| dur | The duration to move backward by |
duration::operator-= can underflow
|
inlineconstexprnoexcept |
Return the time of a particular time_point as the duration since its clock's epoch.
time_point and clock's epoch