|
|
Represents a point in time. More...
#include <ArmarXCore/core/time/DateTime.h>
Public Member Functions | |
| ClockType | clockType () const |
| DateTime () | |
| DateTime (const IceUtil::Time &ice) | |
| DateTime (Duration timeSinceEpoch, ClockType clock=ClockType::Virtual, const std::string &hostname="unknown") | |
| DateTime (std::int64_t microSecondsSinceEpoch, ClockType clock=ClockType::Virtual, const std::string &hostname="unknown") | |
| std::string | hostname () const |
| bool | isInvalid () const |
| bool | isValid () const |
| operator IceUtil::Time () const | |
| bool | operator!= (const DateTime &rhs) const |
| DateTime | operator+ (const Duration &rhs) const |
| DateTime & | operator+= (const Duration &rhs) |
| Duration | operator- (const DateTime &rhs) const |
| DateTime | operator- (const Duration &rhs) const |
| DateTime & | operator-= (const Duration &rhs) |
| bool | operator< (const DateTime &rhs) const |
| bool | operator<= (const DateTime &rhs) const |
| bool | operator== (const DateTime &rhs) const |
| bool | operator> (const DateTime &rhs) const |
| bool | operator>= (const DateTime &rhs) const |
| std::string | toDateString () const |
| std::string | toDateTimeString () const |
| Duration | toDurationSinceEpoch () const |
| std::int64_t | toMicroSeconds () const |
| std::int64_t | toMicroSecondsSinceEpoch () const |
| std::int64_t | toMilliSecondsSinceEpoch () const |
| std::int64_t | toSecondsSinceEpoch () const |
| std::string | toString (const std::string &format) const |
| String representation of current date time according to given format string. | |
| std::string | toTimeString () const |
Static Public Member Functions | |
| static DateTime | Invalid () |
| static DateTime | microSeconds (long microSeconds) |
| static DateTime | Now () |
| static DateTime | now () |
Protected Attributes | |
| ClockType | _clockType |
| std::string | _hostname |
| Duration | _timeSinceEpoch |
Static Protected Attributes | |
| static const Duration | _invalidTimeSinceEpoch |
Represents a point in time.
API and implementation to match IceUtil::Time (where applicable).
Definition at line 24 of file DateTime.h.
| DateTime | ( | ) |
Definition at line 17 of file DateTime.cpp.
| DateTime | ( | Duration | timeSinceEpoch, |
| ClockType | clock = ClockType::Virtual, | ||
| const std::string & | hostname = "unknown" ) |
Definition at line 22 of file DateTime.cpp.
| DateTime | ( | std::int64_t | microSecondsSinceEpoch, |
| ClockType | clock = ClockType::Virtual, | ||
| const std::string & | hostname = "unknown" ) |
Definition at line 28 of file DateTime.cpp.
| DateTime | ( | const IceUtil::Time & | ice | ) |
Definition at line 38 of file DateTime.cpp.
| ClockType clockType | ( | ) | const |
Definition at line 111 of file DateTime.cpp.
| std::string hostname | ( | ) | const |
Definition at line 117 of file DateTime.cpp.
|
static |
| bool isInvalid | ( | ) | const |
Definition at line 129 of file DateTime.cpp.
| bool isValid | ( | ) | const |
Definition at line 123 of file DateTime.cpp.
|
inlinestatic |
Definition at line 94 of file DateTime.h.
|
static |
|
inlinestatic |
| operator IceUtil::Time | ( | ) | const |
Definition at line 43 of file DateTime.cpp.
| bool operator!= | ( | const DateTime & | rhs | ) | const |
Definition at line 197 of file DateTime.cpp.
Definition at line 135 of file DateTime.cpp.
Definition at line 141 of file DateTime.cpp.
Definition at line 161 of file DateTime.cpp.
Definition at line 148 of file DateTime.cpp.
Definition at line 154 of file DateTime.cpp.
| bool operator< | ( | const DateTime & | rhs | ) | const |
Definition at line 166 of file DateTime.cpp.
| bool operator<= | ( | const DateTime & | rhs | ) | const |
Definition at line 172 of file DateTime.cpp.
| bool operator== | ( | const DateTime & | rhs | ) | const |
Definition at line 179 of file DateTime.cpp.
| bool operator> | ( | const DateTime & | rhs | ) | const |
Definition at line 185 of file DateTime.cpp.
| bool operator>= | ( | const DateTime & | rhs | ) | const |
Definition at line 191 of file DateTime.cpp.
| std::string toDateString | ( | ) | const |
Definition at line 63 of file DateTime.cpp.
| std::string toDateTimeString | ( | ) | const |
Definition at line 75 of file DateTime.cpp.
| Duration toDurationSinceEpoch | ( | ) | const |
Definition at line 105 of file DateTime.cpp.
|
inline |
Definition at line 101 of file DateTime.h.
| std::int64_t toMicroSecondsSinceEpoch | ( | ) | const |
Definition at line 87 of file DateTime.cpp.
| std::int64_t toMilliSecondsSinceEpoch | ( | ) | const |
Definition at line 93 of file DateTime.cpp.
| std::int64_t toSecondsSinceEpoch | ( | ) | const |
Definition at line 99 of file DateTime.cpp.
| std::string toString | ( | const std::string & | format | ) | const |
String representation of current date time according to given format string.
The format is according to https://en.cppreference.com/w/cpp/chrono/c/strftime. For milli seconds and micro seconds, special specifiers "%%msec" and "%%usec" were added respectively.
Example format string for "2022-03-04_16-59-10.981789": "%Y-%m-%d_%H-%M-%S.%%usec".
| format | Format string. |
Definition at line 81 of file DateTime.cpp.
| std::string toTimeString | ( | ) | const |
Definition at line 69 of file DateTime.cpp.
|
protected |
Definition at line 135 of file DateTime.h.
|
protected |
Definition at line 137 of file DateTime.h.
|
staticprotected |
Definition at line 131 of file DateTime.h.
|
protected |
Definition at line 133 of file DateTime.h.