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>
|
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.
|
|
|
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.
|
|
template<typename Clock, typename Duration = typename Clock::duration>
struct etl::chrono::time_point< Clock, 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.
- Template Parameters
-
Clock | Must meet the requirements for Clock |
https://en.cppreference.com/w/cpp/named_req/Clock
◆ clock
template<typename Clock, typename Duration = typename Clock::duration>
Clock, the clock on which this time point is measured.
◆ duration
template<typename Clock, typename Duration = typename Clock::duration>
Duration, a duration type used to measure the time since epoch.
◆ period
template<typename Clock, typename Duration = typename Clock::duration>
Period, a ratio type representing the tick period of the duration.
◆ rep
template<typename Clock, typename Duration = typename Clock::duration>
Rep, an arithmetic type representing the number of ticks of the duration.
◆ time_point() [1/3]
template<typename Clock, typename Duration = typename Clock::duration>
◆ time_point() [2/3]
template<typename Clock, typename Duration = typename Clock::duration>
|
inlineexplicitconstexprnoexcept |
Constructs a new time_point from one of several optional data sources. Constructs a time_point at Clock's epoch plus d.
◆ time_point() [3/3]
template<typename Clock, typename Duration = typename Clock::duration>
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.
◆ max()
template<typename Clock, typename Duration = typename Clock::duration>
|
inlinestaticnodiscardconstexprnoexcept |
Returns a time_point with the largest possible duration,.
◆ min()
template<typename Clock, typename Duration = typename Clock::duration>
|
inlinestaticnodiscardconstexprnoexcept |
Returns a time_point with the smallest possible duration,.
◆ operator++() [1/2]
template<typename Clock, typename Duration = typename Clock::duration>
Modifies the point in time *this represents by one tick of the duration.
◆ operator++() [2/2]
template<typename Clock, typename Duration = typename Clock::duration>
Modifies the point in time *this represents by one tick of the duration.
◆ operator+=()
template<typename Clock, typename Duration = typename Clock::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.
◆ operator--() [1/2]
template<typename Clock, typename Duration = typename Clock::duration>
Modifies the point in time *this represents by one tick of the duration.
◆ operator--() [2/2]
template<typename Clock, typename Duration = typename Clock::duration>
Modifies the point in time *this represents by one tick of the duration.
◆ operator-=()
template<typename Clock, typename Duration = typename Clock::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.
◆ time_since_epoch()
template<typename Clock, typename Duration = typename Clock::duration>
auto time_since_epoch |
( |
| ) |
const -> duration |
|
inlinenodiscardconstexprnoexcept |
Returns a duration representing the amount of time between *this and the clock's epoch.
The documentation for this struct was generated from the following file: