E-MailRelay
|
A monotonically increasing subsecond-resolution timestamp, notionally unrelated to time_t. More...
#include <gdatetime.h>
Public Types | |
using | time_point_type = std::chrono::time_point< std::chrono::steady_clock > |
Public Member Functions | |
bool | isZero () const noexcept |
Returns true if zero(). More... | |
bool | sameSecond (const TimerTime &other) const |
Returns true if this time and the other time are the same, at second resolution. More... | |
bool | operator<= (const TimerTime &) const |
Comparison operator. More... | |
bool | operator== (const TimerTime &) const |
Comparison operator. More... | |
bool | operator!= (const TimerTime &) const |
Comparison operator. More... | |
bool | operator> (const TimerTime &) const |
Comparison operator. More... | |
bool | operator>= (const TimerTime &) const |
Comparison operator. More... | |
TimerTime | operator+ (const TimeInterval &) const |
Returns this time with given interval added. More... | |
void | operator+= (TimeInterval) |
Adds an interval. More... | |
TimeInterval | operator- (const TimerTime &start) const |
Returns the given start time's interval() compared to this end time. More... | |
TimeInterval | interval (const TimerTime &end) const |
Returns the interval between this time and the given end time. More... | |
Static Public Member Functions | |
static TimerTime | now () |
Factory function for the current steady-clock time. More... | |
static TimerTime | zero () |
Factory function for the start of the epoch, guaranteed to be less than any now(). More... | |
static bool | less (const TimerTime &, const TimerTime &) noexcept(less_noexcept) |
Comparison operator. More... | |
Static Public Attributes | |
static constexpr bool | less_noexcept = noexcept(time_point_type() < time_point_type()) |
Friends | |
class | G::DateTimeTest |
A monotonically increasing subsecond-resolution timestamp, notionally unrelated to time_t.
Definition at line 230 of file gdatetime.h.
using G::TimerTime::time_point_type = std::chrono::time_point<std::chrono::steady_clock> |
Definition at line 233 of file gdatetime.h.
G::TimeInterval G::TimerTime::interval | ( | const TimerTime & | end | ) | const |
Returns the interval between this time and the given end time.
Returns TimeInterval::zero() on underflow or TimeInterval::limit() if the TimeInterval::s_type value overflows.
Definition at line 546 of file gdatetime.cpp.
|
noexcept |
Returns true if zero().
Definition at line 491 of file gdatetime.cpp.
Comparison operator.
Definition at line 412 of file gdatetime.h.
|
static |
Factory function for the current steady-clock time.
Definition at line 479 of file gdatetime.cpp.
bool G::TimerTime::operator!= | ( | const TimerTime & | other | ) | const |
Comparison operator.
Definition at line 572 of file gdatetime.cpp.
G::TimerTime G::TimerTime::operator+ | ( | const TimeInterval & | interval | ) | const |
Returns this time with given interval added.
Definition at line 525 of file gdatetime.cpp.
void G::TimerTime::operator+= | ( | TimeInterval | i | ) |
Adds an interval.
Definition at line 532 of file gdatetime.cpp.
G::TimeInterval G::TimerTime::operator- | ( | const TimerTime & | start | ) | const |
Returns the given start time's interval() compared to this end time.
Returns TimeInterval::zero() on underflow or TimeInterval::limit() if the TimeInterval::s_type value overflows.
Definition at line 540 of file gdatetime.cpp.
bool G::TimerTime::operator<= | ( | const TimerTime & | other | ) | const |
Comparison operator.
Definition at line 561 of file gdatetime.cpp.
bool G::TimerTime::operator== | ( | const TimerTime & | other | ) | const |
Comparison operator.
Definition at line 566 of file gdatetime.cpp.
bool G::TimerTime::operator> | ( | const TimerTime & | other | ) | const |
Comparison operator.
Definition at line 579 of file gdatetime.cpp.
bool G::TimerTime::operator>= | ( | const TimerTime & | other | ) | const |
Comparison operator.
Definition at line 586 of file gdatetime.cpp.
bool G::TimerTime::sameSecond | ( | const TimerTime & | other | ) | const |
Returns true if this time and the other time are the same, at second resolution.
Definition at line 552 of file gdatetime.cpp.
|
static |
Factory function for the start of the epoch, guaranteed to be less than any now().
Definition at line 486 of file gdatetime.cpp.
|
friend |
Definition at line 288 of file gdatetime.h.
|
staticconstexpr |
Definition at line 249 of file gdatetime.h.