Public Types |
Public Member Functions |
Static Public Member Functions |
Private Attributes |
List of all members
mn::basic_timestamp Class Reference
A Timestamp stores a monotonic* time value with microseconds resolution. More...
#include <mn_timestamp.hpp>
Public Types | |
using | time_type = MINILIB_TIMESTAMP_TIME_TYPE |
using | self_type = basic_timestamp |
Public Member Functions | |
basic_timestamp () | |
Consruct a basic_timestamp with the current time. More... | |
basic_timestamp (time_type tv) | |
Creates a timestamp from the given time value. More... | |
basic_timestamp (const self_type &other) | |
Copy constructor. More... | |
void | update () |
void | swap (self_type &time) |
mn::time_t | get_epoch () const |
time_type | get_utc () const |
Get the timestamp expressed in UTC-based time. More... | |
time_type | get_microseconds () const |
Get the timestamp expressed in microseconds. More... | |
time_type | get_elapsed () const |
Get the time elapsed since the time denoted by the timestamp. More... | |
bool | is_elapsed (time_type interval) const |
if the given interval has passed since the time denoted by the timestamp. More... | |
bool | operator== (const self_type &ts) const |
bool | operator!= (const self_type &ts) const |
bool | operator>= (const self_type &ts) const |
bool | operator<= (const self_type &ts) const |
bool | operator< (const self_type &ts) const |
bool | operator> (const self_type &ts) const |
time_type | operator- (const self_type &ts) const |
time_type | operator+ (const self_type &ts) const |
self_type | operator+ (time_type d) const |
self_type | operator- (time_type d) const |
self_type & | operator+= (time_type d) |
self_type & | operator-= (time_type d) |
self_type | operator+ (const basic_timespan &span) const |
self_type | operator- (const basic_timespan &span) const |
self_type & | operator+= (const basic_timespan &span) |
self_type & | operator-= (const basic_timespan &span) |
self_type & | operator= (const self_type &other) |
self_type & | operator= (time_type tv) |
Static Public Member Functions | |
static self_type | from_epoch (const mn::time_t t) |
Creates a timestamp from a mn::time_t. More... | |
static self_type | from_utc (const time_type val) |
Creates a timestamp from a UTC time value. More... | |
Private Attributes | |
time_type | m_time |
Detailed Description
A Timestamp stores a monotonic* time value with microseconds resolution.
- Note
- The internal reference time is the Unix epoch, midnight, January 1, 1970.
Member Typedef Documentation
◆ self_type
◆ time_type
Constructor & Destructor Documentation
◆ basic_timestamp() [1/3]
mn::basic_timestamp::basic_timestamp | ( | ) |
Consruct a basic_timestamp with the current time.
◆ basic_timestamp() [2/3]
mn::basic_timestamp::basic_timestamp | ( | time_type | tv | ) |
Creates a timestamp from the given time value.
◆ basic_timestamp() [3/3]
mn::basic_timestamp::basic_timestamp | ( | const self_type & | other | ) |
Copy constructor.
Member Function Documentation
◆ from_epoch()
|
static |
Creates a timestamp from a mn::time_t.
◆ from_utc()
|
static |
Creates a timestamp from a UTC time value.
- Note
- since midnight 15 October 1582.
◆ get_elapsed()
|
inline |
Get the time elapsed since the time denoted by the timestamp.
- Note
- Equivalent to Timestamp() - *this.
◆ get_epoch()
|
inline |
◆ get_microseconds()
|
inline |
Get the timestamp expressed in microseconds.
- Note
- Unix epoch, midnight, January 1, 1970.
◆ get_utc()
|
inline |
Get the timestamp expressed in UTC-based time.
◆ is_elapsed()
|
inline |
if the given interval has passed since the time denoted by the timestamp.
◆ operator!=()
|
inline |
◆ operator+() [1/3]
|
inline |
◆ operator+() [2/3]
◆ operator+() [3/3]
◆ operator+=() [1/2]
|
inline |
◆ operator+=() [2/2]
◆ operator-() [1/3]
|
inline |
◆ operator-() [2/3]
◆ operator-() [3/3]
◆ operator-=() [1/2]
|
inline |
◆ operator-=() [2/2]
◆ operator<()
|
inline |
◆ operator<=()
|
inline |
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ operator==()
|
inline |
◆ operator>()
|
inline |
◆ operator>=()
|
inline |
◆ swap()
void mn::basic_timestamp::swap | ( | self_type & | time | ) |
◆ update()
void mn::basic_timestamp::update | ( | ) |
Member Data Documentation
◆ m_time
|
private |
The documentation for this class was generated from the following files: