Ark Server API (ASE) - Wiki
|
A class that represents time spans up to microsecond resolution. More...
#include <Timespan.h>
Public Types | |
using | TimeDiff = Timestamp::TimeDiff |
Public Member Functions | |
Timespan () | |
Timespan (TimeDiff microseconds) | |
Creates a zero Timespan. | |
Timespan (long seconds, long microseconds) | |
Creates a Timespan. | |
Timespan (int days, int hours, int minutes, int seconds, int microSeconds) | |
Timespan (const Timespan ×pan) | |
Creates a Timespan. | |
~Timespan () | |
Creates a Timespan from another one. | |
Timespan & | operator= (const Timespan ×pan) |
Destroys the Timespan. | |
Timespan & | operator= (TimeDiff microseconds) |
Assignment operator. | |
Timespan & | assign (int days, int hours, int minutes, int seconds, int microSeconds) |
Assignment operator. | |
Timespan & | assign (long seconds, long microseconds) |
Assigns a new span. | |
void | swap (Timespan ×pan) |
bool | operator== (const Timespan &ts) const |
Swaps the Timespan with another one. | |
bool | operator!= (const Timespan &ts) const |
bool | operator> (const Timespan &ts) const |
bool | operator>= (const Timespan &ts) const |
bool | operator< (const Timespan &ts) const |
bool | operator<= (const Timespan &ts) const |
bool | operator== (TimeDiff microSeconds) const |
bool | operator!= (TimeDiff microSeconds) const |
bool | operator> (TimeDiff microSeconds) const |
bool | operator>= (TimeDiff microSeconds) const |
bool | operator< (TimeDiff microSeconds) const |
bool | operator<= (TimeDiff microSeconds) const |
Timespan | operator+ (const Timespan &d) const |
Timespan | operator- (const Timespan &d) const |
Timespan & | operator+= (const Timespan &d) |
Timespan & | operator-= (const Timespan &d) |
Timespan | operator+ (TimeDiff microSeconds) const |
Timespan | operator- (TimeDiff microSeconds) const |
Timespan & | operator+= (TimeDiff microSeconds) |
Timespan & | operator-= (TimeDiff microSeconds) |
int | days () const |
int | hours () const |
Returns the number of days. | |
int | totalHours () const |
Returns the number of hours (0 to 23). | |
int | minutes () const |
Returns the total number of hours. | |
int | totalMinutes () const |
Returns the number of minutes (0 to 59). | |
int | seconds () const |
Returns the total number of minutes. | |
int | totalSeconds () const |
Returns the number of seconds (0 to 59). | |
int | milliseconds () const |
Returns the total number of seconds. | |
TimeDiff | totalMilliseconds () const |
Returns the number of milliseconds (0 to 999). | |
int | microseconds () const |
Returns the total number of milliseconds. | |
int | useconds () const |
TimeDiff | totalMicroseconds () const |
Static Public Attributes | |
static const TimeDiff | MILLISECONDS |
Returns the total number of microseconds. | |
static const TimeDiff | SECONDS |
The number of microseconds in a millisecond. | |
static const TimeDiff | MINUTES |
The number of microseconds in a second. | |
static const TimeDiff | HOURS |
The number of microseconds in a minute. | |
static const TimeDiff | DAYS |
The number of microseconds in a hour. | |
Private Attributes | |
TimeDiff | _span |
The number of microseconds in a day. | |
A class that represents time spans up to microsecond resolution.
Definition at line 28 of file Timespan.h.
Definition at line 32 of file Timespan.h.
Poco::Timespan::Timespan | ( | ) |
Poco::Timespan::Timespan | ( | long | seconds, |
long | microseconds ) |
Creates a Timespan.
Poco::Timespan::Timespan | ( | int | days, |
int | hours, | ||
int | minutes, | ||
int | seconds, | ||
int | microSeconds ) |
|
inline |
Creates a Timespan from another one.
Definition at line 295 of file Timespan.h.
Timespan & Poco::Timespan::assign | ( | int | days, |
int | hours, | ||
int | minutes, | ||
int | seconds, | ||
int | microSeconds ) |
Assignment operator.
Timespan & Poco::Timespan::assign | ( | long | seconds, |
long | microseconds ) |
Assigns a new span.
|
inline |
Definition at line 145 of file Timespan.h.
|
inline |
Returns the number of days.
Definition at line 151 of file Timespan.h.
|
inline |
Returns the total number of milliseconds.
Definition at line 199 of file Timespan.h.
|
inline |
Returns the total number of seconds.
Definition at line 187 of file Timespan.h.
|
inline |
Returns the total number of hours.
Definition at line 163 of file Timespan.h.
|
inline |
Definition at line 223 of file Timespan.h.
|
inline |
Definition at line 259 of file Timespan.h.
|
inline |
Definition at line 241 of file Timespan.h.
|
inline |
Definition at line 277 of file Timespan.h.
|
inline |
Definition at line 247 of file Timespan.h.
|
inline |
Definition at line 283 of file Timespan.h.
|
inline |
Swaps the Timespan with another one.
Definition at line 217 of file Timespan.h.
|
inline |
Definition at line 253 of file Timespan.h.
|
inline |
Definition at line 229 of file Timespan.h.
|
inline |
Definition at line 265 of file Timespan.h.
|
inline |
Definition at line 235 of file Timespan.h.
|
inline |
Definition at line 271 of file Timespan.h.
|
inline |
Returns the total number of minutes.
Definition at line 175 of file Timespan.h.
void Poco::Timespan::swap | ( | Timespan & | timespan | ) |
Assigns a new span. Useful for assigning from a struct timeval.
|
inline |
Returns the number of hours (0 to 23).
Definition at line 157 of file Timespan.h.
|
inline |
Returns the fractions of a second in microseconds (0 to 999999).
Definition at line 211 of file Timespan.h.
|
inline |
Returns the number of milliseconds (0 to 999).
Definition at line 193 of file Timespan.h.
|
inline |
Returns the number of minutes (0 to 59).
Definition at line 169 of file Timespan.h.
|
inline |
Returns the number of seconds (0 to 59).
Definition at line 181 of file Timespan.h.
|
inline |
Returns the fractions of a millisecond in microseconds (0 to 999).
Definition at line 205 of file Timespan.h.
|
private |
The number of microseconds in a day.
Definition at line 138 of file Timespan.h.
|
static |
The number of microseconds in a hour.
Definition at line 135 of file Timespan.h.
|
static |
The number of microseconds in a minute.
Definition at line 134 of file Timespan.h.
|
static |
Returns the total number of microseconds.
Definition at line 131 of file Timespan.h.
|
static |
The number of microseconds in a second.
Definition at line 133 of file Timespan.h.
|
static |
The number of microseconds in a millisecond.
Definition at line 132 of file Timespan.h.