E-MailRelay
Public Member Functions | Static Public Member Functions | Friends | List of all members
G::TimerTime Class Reference

A monotonically increasing subsecond-resolution timestamp, notionally unrelated to time_t. More...

#include <gdatetime.h>

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...
 
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. More...
 

Friends

class G::DateTimeTest
 

Detailed Description

A monotonically increasing subsecond-resolution timestamp, notionally unrelated to time_t.

Definition at line 212 of file gdatetime.h.

Member Function Documentation

◆ interval()

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 440 of file gdatetime.cpp.

◆ isZero()

bool G::TimerTime::isZero ( ) const
inlinenoexcept

Returns true if zero().

Definition at line 279 of file gdatetime.h.

◆ now()

G::TimerTime G::TimerTime::now ( )
static

Factory function for the current steady-clock time.

Definition at line 385 of file gdatetime.cpp.

◆ operator!=()

bool G::TimerTime::operator!= ( const TimerTime other) const

Comparison operator.

Definition at line 468 of file gdatetime.cpp.

◆ operator+()

G::TimerTime G::TimerTime::operator+ ( const TimeInterval interval) const

Returns this time with given interval added.

Definition at line 419 of file gdatetime.cpp.

◆ operator+=()

void G::TimerTime::operator+= ( TimeInterval  i)

Adds an interval.

Definition at line 427 of file gdatetime.cpp.

◆ operator-()

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 435 of file gdatetime.cpp.

◆ operator<()

bool G::TimerTime::operator< ( const TimerTime other) const

Comparison operator.

Definition at line 453 of file gdatetime.cpp.

◆ operator<=()

bool G::TimerTime::operator<= ( const TimerTime other) const

Comparison operator.

Definition at line 458 of file gdatetime.cpp.

◆ operator==()

bool G::TimerTime::operator== ( const TimerTime other) const

Comparison operator.

Definition at line 463 of file gdatetime.cpp.

◆ operator>()

bool G::TimerTime::operator> ( const TimerTime other) const

Comparison operator.

Definition at line 473 of file gdatetime.cpp.

◆ operator>=()

bool G::TimerTime::operator>= ( const TimerTime other) const

Comparison operator.

Definition at line 478 of file gdatetime.cpp.

◆ sameSecond()

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 445 of file gdatetime.cpp.

◆ zero()

G::TimerTime G::TimerTime::zero ( )
static

Factory function for the start of the epoch.

Definition at line 390 of file gdatetime.cpp.

Friends And Related Function Documentation

◆ G::DateTimeTest

friend class G::DateTimeTest
friend

Definition at line 265 of file gdatetime.h.


The documentation for this class was generated from the following files: