tetl 0.1.0
Embedded Template Library
|
Class template time_point represents a point in time. It is implemented as if it stores a value of type Duration indicating the time interval from the start of the Clock's epoch. More...
#include <time_point.hpp>
Public Types | |
using | clock = Clock |
Clock, the clock on which this time point is measured. | |
using | duration = Duration |
Duration, a duration type used to measure the time since epoch. | |
using | period = typename duration::period |
Period, a ratio type representing the tick period of the duration. | |
using | rep = typename duration::rep |
Rep, an arithmetic type representing the number of ticks of the duration. | |
Public Member Functions | |
constexpr | time_point () noexcept=default |
Constructs a new time_point from one of several optional data sources. Default constructor, creates a time_point representing the Clock's epoch (i.e., time_since_epoch() is zero). | |
constexpr | time_point (duration const &d) noexcept |
Constructs a new time_point from one of several optional data sources. Constructs a time_point at Clock's epoch plus d. | |
template<typename Dur2 > requires (is_convertible_v<Dur2, duration>) | |
constexpr | time_point (time_point< clock, Dur2 > const &t) |
Constructs a new time_point from one of several optional data sources. Constructs a time_point by converting t to duration. This constructor only participates in overload resolution if Duration2 is implicitly convertible to duration. | |
constexpr auto | operator++ () noexcept -> time_point & |
Modifies the point in time *this represents by one tick of the duration. | |
constexpr auto | operator++ (int) noexcept -> time_point |
Modifies the point in time *this represents by one tick of the duration. | |
constexpr auto | operator+= (duration const &d) noexcept -> time_point & |
Modifies the time point by the given duration. Applies the offset d to pt. Effectively, d is added to the internally stored duration d_ as d_ += d. | |
constexpr auto | operator-- () noexcept -> time_point & |
Modifies the point in time *this represents by one tick of the duration. | |
constexpr auto | operator-- (int) noexcept -> time_point |
Modifies the point in time *this represents by one tick of the duration. | |
constexpr auto | operator-= (duration const &d) noexcept -> time_point & |
Modifies the time point by the given duration. Applies the offset d to pt in negative direction. Effectively, d is subtracted from internally stored duration d_ as d_ -= d. | |
constexpr auto | time_since_epoch () const noexcept -> duration |
Returns a duration representing the amount of time between *this and the clock's epoch. | |
Static Public Member Functions | |
static constexpr auto | max () noexcept -> time_point |
Returns a time_point with the largest possible duration,. | |
static constexpr auto | min () noexcept -> time_point |
Returns a time_point with the smallest possible duration,. | |
Class template time_point represents a point in time. It is implemented as if it stores a value of type Duration indicating the time interval from the start of the Clock's epoch.
Clock | Must meet the requirements for Clock |
Clock, the clock on which this time point is measured.
Duration, a duration type used to measure the time since epoch.
Period, a ratio type representing the tick period of the duration.
Rep, an arithmetic type representing the number of ticks of the duration.
|
constexprdefaultnoexcept |
Constructs a new time_point from one of several optional data sources. Default constructor, creates a time_point representing the Clock's epoch (i.e., time_since_epoch() is zero).
|
inlineexplicitconstexprnoexcept |
Constructs a new time_point from one of several optional data sources. Constructs a time_point at Clock's epoch plus d.
|
inlineconstexpr |
Constructs a new time_point from one of several optional data sources. Constructs a time_point by converting t to duration. This constructor only participates in overload resolution if Duration2 is implicitly convertible to duration.
|
inlinestaticconstexprnoexcept |
Returns a time_point with the largest possible duration,.
|
inlinestaticconstexprnoexcept |
Returns a time_point with the smallest possible duration,.
|
inlineconstexprnoexcept |
Modifies the point in time *this represents by one tick of the duration.
|
inlineconstexprnoexcept |
Modifies the point in time *this represents by one tick of the duration.
Modifies the time point by the given duration. Applies the offset d to pt. Effectively, d is added to the internally stored duration d_ as d_ += d.
|
inlineconstexprnoexcept |
Modifies the point in time *this represents by one tick of the duration.
|
inlineconstexprnoexcept |
Modifies the point in time *this represents by one tick of the duration.
Modifies the time point by the given duration. Applies the offset d to pt in negative direction. Effectively, d is subtracted from internally stored duration d_ as d_ -= d.
Returns a duration representing the amount of time between *this and the clock's epoch.