Ark Server API (ASE) - Wiki
|
#include <Timestamp.h>
Public Types | |
using | TimeVal = Int64 |
using | UtcTimeVal = Int64 |
using | TimeDiff = Int64 |
Public Member Functions | |
Timestamp () | |
Maximum timestamp value. | |
Timestamp (TimeVal tv) | |
Creates a timestamp with the current time. | |
Timestamp (const Timestamp &other) | |
~Timestamp () | |
Copy constructor. | |
Timestamp & | operator= (const Timestamp &other) |
Destroys the timestamp. | |
Timestamp & | operator= (TimeVal tv) |
void | swap (Timestamp ×tamp) |
void | update () |
Swaps the Timestamp with another one. | |
bool | operator== (const Timestamp &ts) const |
Updates the Timestamp with the current time. | |
bool | operator!= (const Timestamp &ts) const |
bool | operator> (const Timestamp &ts) const |
bool | operator>= (const Timestamp &ts) const |
bool | operator< (const Timestamp &ts) const |
bool | operator<= (const Timestamp &ts) const |
Timestamp | operator+ (TimeDiff d) const |
Timestamp | operator+ (const Timespan &span) const |
Timestamp | operator- (TimeDiff d) const |
Timestamp | operator- (const Timespan &span) const |
TimeDiff | operator- (const Timestamp &ts) const |
Timestamp & | operator+= (TimeDiff d) |
Timestamp & | operator+= (const Timespan &span) |
Timestamp & | operator-= (TimeDiff d) |
Timestamp & | operator-= (const Timespan &span) |
std::time_t | epochTime () const |
UtcTimeVal | utcTime () const |
TimeVal | epochMicroseconds () const |
TimeDiff | elapsed () const |
bool | isElapsed (TimeDiff interval) const |
TimeVal | raw () const |
Static Public Member Functions | |
static Timestamp | fromEpochTime (std::time_t t) |
static Timestamp | fromUtcTime (UtcTimeVal val) |
Creates a timestamp from a std::time_t. | |
static TimeDiff | resolution () |
Static Public Attributes | |
static const TimeVal | TIMEVAL_MIN |
Difference between two TimeVal values in microseconds. | |
static const TimeVal | TIMEVAL_MAX |
Minimum timestamp value. | |
Private Attributes | |
TimeVal | _ts |
A Timestamp stores a monotonic* time value with (theoretical) microseconds resolution. Timestamps can be compared with each other and simple arithmetic is supported.
[*] Note that Timestamp values are only monotonic as long as the systems's clock is monotonic as well (and not, e.g. set back due to time synchronization or other reasons).
Timestamps are UTC (Coordinated Universal Time) based and thus independent of the timezone in effect on the system.
The internal reference time is the Unix epoch, midnight, January 1, 1970.
Definition at line 31 of file Timestamp.h.
using Poco::Timestamp::TimeDiff = Int64 |
Monotonic UTC time value in 100 nanosecond resolution, with base time midnight, October 15, 1582.
Definition at line 58 of file Timestamp.h.
using Poco::Timestamp::TimeVal = Int64 |
Definition at line 50 of file Timestamp.h.
using Poco::Timestamp::UtcTimeVal = Int64 |
Monotonic UTC time value in microsecond resolution, with base time midnight, January 1, 1970.
Definition at line 54 of file Timestamp.h.
Poco::Timestamp::Timestamp | ( | ) |
Maximum timestamp value.
Poco::Timestamp::Timestamp | ( | TimeVal | tv | ) |
Creates a timestamp with the current time.
Poco::Timestamp::Timestamp | ( | const Timestamp & | other | ) |
Creates a timestamp from the given time value (microseconds since midnight, January 1, 1970).
Poco::Timestamp::~Timestamp | ( | ) |
Copy constructor.
|
inline |
Returns the timestamp expressed in microseconds since the Unix epoch, midnight, January 1, 1970.
Definition at line 242 of file Timestamp.h.
|
inline |
Returns the timestamp expressed in UTC-based time. UTC base time is midnight, October 15, 1582. Resolution is 100 nanoseconds.
Definition at line 236 of file Timestamp.h.
|
inline |
|
static |
Returns the raw time value.
Same as epochMicroseconds().
|
static |
Creates a timestamp from a std::time_t.
|
inline |
Returns the time elapsed since the time denoted by the timestamp. Equivalent to Timestamp() - *this.
Definition at line 249 of file Timestamp.h.
|
inline |
Definition at line 162 of file Timestamp.h.
|
inline |
|
inline |
Definition at line 210 of file Timestamp.h.
|
inline |
|
inline |
|
inline |
Definition at line 217 of file Timestamp.h.
|
inline |
Definition at line 180 of file Timestamp.h.
|
inline |
Definition at line 186 of file Timestamp.h.
|
inline |
Updates the Timestamp with the current time.
Definition at line 156 of file Timestamp.h.
|
inline |
Definition at line 168 of file Timestamp.h.
|
inline |
Definition at line 174 of file Timestamp.h.
|
inline |
Returns true iff the given interval has passed since the time denoted by the timestamp.
Definition at line 269 of file Timestamp.h.
|
inlinestatic |
Creates a timestamp from a UTC time value (100 nanosecond intervals since midnight, October 15, 1582).
Definition at line 257 of file Timestamp.h.
void Poco::Timestamp::swap | ( | Timestamp & | timestamp | ) |
void Poco::Timestamp::update | ( | ) |
Swaps the Timestamp with another one.
|
inline |
Returns the timestamp expressed in time_t. time_t base time is midnight, January 1, 1970. Resolution is one second.
Definition at line 230 of file Timestamp.h.
|
private |
Returns the resolution in units per second. Since the timestamp has microsecond resolution, the returned value is always 1000000.
Definition at line 149 of file Timestamp.h.
|
static |
Minimum timestamp value.
Definition at line 62 of file Timestamp.h.
|
static |
Difference between two TimeVal values in microseconds.
Definition at line 61 of file Timestamp.h.