This inner class of TimePointBase represents durations, hence difference values of two values of the parent class.
Often, objects of this class are generated by the subtraction of TimePointBase values or by using methods TimePointBase::Age and TimePointBase::Since. Furthermore, class CalendarDuration (found in the module ALib Strings) can be used to convert durations to and from human-readable units (days, hours, minutes, etc.).
class TimePointBase
Definition at line 80 of file timepointbase.inl.
Public Type Index: | |
using | TDuration = sc steady_clock::duration |
The value type for time spans. | |
Public Static Method Index: | |
static Duration | FromAbsoluteDays (int64_t days) |
static Duration | FromAbsoluteHours (int64_t hours) |
static Duration | FromAbsoluteMicroseconds (int64_t microseconds) |
static Duration | FromAbsoluteMilliseconds (int64_t milliseconds) |
static Duration | FromAbsoluteMinutes (int64_t minutes) |
static Duration | FromAbsoluteSeconds (int64_t seconds) |
static Duration | FromDays (double days) |
static Duration | FromHours (double hours) |
static Duration | FromMicroseconds (double microseconds) |
static Duration | FromMilliseconds (double milliseconds) |
static Duration | FromMinutes (double minutes) |
static Duration | FromNanoseconds (int64_t nanoseconds) |
static Duration | FromSeconds (double seconds) |
static Duration | Import (const TDuration &timeSpan) |
Public Method Index: | |
constexpr | Duration () |
Creates a zero-length time span. | |
Duration (const TDuration &stdLibValue) | |
TDuration | Export () const |
integer | InAbsoluteDays () const |
integer | InAbsoluteHours () const |
int64_t | InAbsoluteMicroseconds () const |
int64_t | InAbsoluteMilliseconds () const |
int64_t | InAbsoluteMinutes () const |
int64_t | InAbsoluteSeconds () const |
double | InDays () const |
double | InHertz (int qtyFractionalDigits=-1) const |
double | InHours () const |
double | InMicroseconds () const |
double | InMilliseconds () const |
double | InMinutes () const |
int64_t | InNanoseconds () const |
double | InSeconds () const |
bool | IsPositive () const |
bool | IsZero () const |
bool | operator!= (const Duration &other) const |
bool | operator!= (const TDuration &other) const |
Duration | operator* (double multiplier) const |
Duration | operator* (int64_t multiplier) const |
Duration & | operator*= (double multiplier) |
Duration & | operator*= (int64_t multiplier) |
Duration | operator+ (const Duration &rhs) const |
Duration | operator+ (const TDuration &rhs) const |
Duration & | operator+= (const Duration &other) |
Duration & | operator+= (const TDuration &other) |
Duration | operator- (const Duration &rhs) const |
Duration | operator- (const TDuration &rhs) const |
Duration & | operator-= (const Duration &other) |
Duration & | operator-= (const TDuration &other) |
Duration | operator/ (double divisor) const |
Duration | operator/ (int64_t divisor) const |
Duration & | operator/= (double divisor) |
Duration & | operator/= (int64_t divisor) |
bool | operator< (const Duration &other) const |
bool | operator< (const TDuration &other) const |
bool | operator<= (const Duration &other) const |
bool | operator<= (const TDuration &other) const |
Duration & | operator= (const TDuration &stdLibValue) |
bool | operator== (const Duration &other) const |
bool | operator== (const TDuration &other) const |
bool | operator> (const Duration &other) const |
bool | operator> (const TDuration &other) const |
bool | operator>= (const Duration &other) const |
bool | operator>= (const TDuration &other) const |
Duration & | SetMaximum (const Duration &other) |
Duration & | SetMinimum (const Duration &other) |
Protected Field Index: | |
TDuration | span |
The internal time value. | |
using alib::time::TimePointBase< TClock, TDerived >::Duration::TDuration = sc steady_clock::duration |
The value type for time spans.
Definition at line 90 of file timepointbase.inl.
|
protected |
The internal time value.
Definition at line 98 of file timepointbase.inl.
|
inlineconstexpr |
Creates a zero-length time span.
Definition at line 109 of file timepointbase.inl.
|
inline |
Constructs an instance from C++ library values.
stdLibValue | The value to copy into this. |
Definition at line 116 of file timepointbase.inl.
|
inline |
Returns the internal time span value using the C++ standard library format.
Definition at line 134 of file timepointbase.inl.
|
inlinestatic |
Sets the internal value to a time span provided in days.
days | The time span to set in days. |
*this
to allow concatenated calls. Definition at line 551 of file timepointbase.inl.
|
inlinestatic |
Sets the internal value to a time span provided in hours.
hours | The time span to set in hours. |
*this
to allow concatenated calls. Definition at line 569 of file timepointbase.inl.
|
inlinestatic |
Sets the internal value to a time span provided in microseconds.
microseconds | The time span to set in microseconds. |
*this
to allow concatenated calls. Definition at line 641 of file timepointbase.inl.
|
inlinestatic |
Sets the internal value to a time span provided in milliseconds.
milliseconds | The time span to set in milliseconds. |
*this
to allow concatenated calls. Definition at line 623 of file timepointbase.inl.
|
inlinestatic |
Sets the internal value to a time span provided in hours.
minutes | The time span to set in minutes. |
*this
to allow concatenated calls. Definition at line 587 of file timepointbase.inl.
|
inlinestatic |
Sets the internal value to a time span provided in seconds.
seconds | The time span to set in seconds. |
*this
to allow concatenated calls. Definition at line 605 of file timepointbase.inl.
|
inlinestatic |
Sets the internal value to a time span provided in days.
days | The time span to set in days. |
*this
to allow concatenated calls. Definition at line 542 of file timepointbase.inl.
|
inlinestatic |
Sets the internal value to a time span provided in hours.
hours | The time span to set in hours. |
*this
to allow concatenated calls. Definition at line 560 of file timepointbase.inl.
|
inlinestatic |
Sets the internal value to a time span provided in microseconds.
microseconds | The time span to set in microseconds. |
*this
to allow concatenated calls. Definition at line 632 of file timepointbase.inl.
|
inlinestatic |
Sets the internal value to a time span provided in milliseconds.
milliseconds | The time span to set in milliseconds. |
*this
to allow concatenated calls. Definition at line 614 of file timepointbase.inl.
|
inlinestatic |
Sets the internal value to a time span provided in hours.
minutes | The time span to set in minutes. |
*this
to allow concatenated calls. Definition at line 578 of file timepointbase.inl.
|
inlinestatic |
Sets the internal value to a time span provided in nanoseconds.
nanoseconds | The time span to set in nanoseconds. |
*this
to allow concatenated calls. Definition at line 650 of file timepointbase.inl.
|
inlinestatic |
Sets the internal value to a time span provided in seconds.
seconds | The time span to set in seconds. |
*this
to allow concatenated calls. Definition at line 596 of file timepointbase.inl.
|
inlinestatic |
Creates an instance representing the time span given in C++ standard library format.
timeSpan | The C++ time point value. |
Definition at line 142 of file timepointbase.inl.
|
inline |
Converts the internal value to absolute days.
Definition at line 399 of file timepointbase.inl.
|
inline |
Converts the internal value to absolute hours.
Definition at line 419 of file timepointbase.inl.
|
inline |
Converts the internal value to absolute microseconds.
Definition at line 495 of file timepointbase.inl.
|
inline |
Converts the internal value to absolute milliseconds.
Definition at line 476 of file timepointbase.inl.
|
inline |
Converts the internal value to absolute minutes.
Definition at line 438 of file timepointbase.inl.
|
inline |
Converts the internal value to absolute seconds.
Definition at line 457 of file timepointbase.inl.
|
inline |
Converts the internal value to days.
Definition at line 389 of file timepointbase.inl.
|
inline |
Returns 1 divided by internal value in seconds, hence the number of Hertz that this object represents when interpreted as a time span.
qtyFractionalDigits | Number of digits that the return value will be rounded to. Defaults to -1 which means no rounding. |
Definition at line 517 of file timepointbase.inl.
|
inline |
Converts the internal value to hours.
Definition at line 409 of file timepointbase.inl.
|
inline |
Converts the internal value to microseconds.
Definition at line 485 of file timepointbase.inl.
|
inline |
Converts the internal value to milliseconds.
Definition at line 466 of file timepointbase.inl.
|
inline |
Converts the internal value to minutes.
Definition at line 428 of file timepointbase.inl.
|
inline |
Converts the internal value to nanoseconds.
Definition at line 504 of file timepointbase.inl.
|
inline |
Converts the internal value to seconds.
Definition at line 447 of file timepointbase.inl.
|
inline |
true
if this is a positive duration, false
otherwise. Definition at line 168 of file timepointbase.inl.
|
inline |
true
if this is is a zero-length time-span, false
otherwise. Definition at line 171 of file timepointbase.inl.
|
inline |
Not equal to operator.
other | The duration to compare. |
Definition at line 193 of file timepointbase.inl.
|
inline |
Not equal to operator.
other | The duration to compare. |
Definition at line 200 of file timepointbase.inl.
|
inline |
Multiply operator.
multiplier | The multiplier. |
Definition at line 319 of file timepointbase.inl.
|
inline |
Multiply operator.
multiplier | The multiplier. |
Definition at line 327 of file timepointbase.inl.
|
inline |
Assignment by product operator.
multiplier | The multiplier. |
Definition at line 335 of file timepointbase.inl.
|
inline |
Assignment by product operator.
multiplier | The multiplier. |
Definition at line 343 of file timepointbase.inl.
|
inline |
Addition operator.
rhs | The right-hand side time span to add. |
Definition at line 263 of file timepointbase.inl.
|
inline |
Addition operator.
rhs | The right-hand side time span to add. |
Definition at line 270 of file timepointbase.inl.
|
inline |
Assignment by sum operator.
other | The time span to subtract. |
Definition at line 277 of file timepointbase.inl.
|
inline |
Assignment by sum operator.
other | The time span to subtract. |
Definition at line 284 of file timepointbase.inl.
|
inline |
Subtraction operator.
rhs | The right-hand side time span to subtract. |
Definition at line 291 of file timepointbase.inl.
|
inline |
Subtraction operator.
rhs | The right-hand side time span to subtract. |
Definition at line 298 of file timepointbase.inl.
|
inline |
Assignment by difference operator.
other | The time span subtract. |
Definition at line 305 of file timepointbase.inl.
|
inline |
Assignment by difference operator.
other | The time span subtract. |
Definition at line 312 of file timepointbase.inl.
|
inline |
Divide operator.
divisor | The divisor. |
Definition at line 351 of file timepointbase.inl.
|
inline |
Divide operator.
divisor | The divisor. |
Definition at line 359 of file timepointbase.inl.
|
inline |
Assignment by quotient operator.
divisor | The divisor. |
Definition at line 367 of file timepointbase.inl.
|
inline |
Assignment by quotient operator.
divisor | The divisor. |
Definition at line 376 of file timepointbase.inl.
|
inline |
Less than operator.
other | The duration to compare. |
Definition at line 207 of file timepointbase.inl.
|
inline |
Less than operator.
other | The duration to compare. |
Definition at line 214 of file timepointbase.inl.
|
inline |
Less than or equal to operator.
other | The duration to compare. |
Definition at line 221 of file timepointbase.inl.
|
inline |
Less than or equal to operator.
other | The duration to compare. |
Definition at line 228 of file timepointbase.inl.
|
inline |
Constructs an instance from C++ library values.
stdLibValue | The value to copy into this. |
Definition at line 124 of file timepointbase.inl.
|
inline |
Equal to operator.
other | The duration to compare. |
Definition at line 178 of file timepointbase.inl.
|
inline |
Equal to operator.
other | The duration to compare. |
Definition at line 186 of file timepointbase.inl.
|
inline |
Greater than operator.
other | The duration to compare. |
Definition at line 235 of file timepointbase.inl.
|
inline |
Greater than operator.
other | The duration to compare. |
Definition at line 242 of file timepointbase.inl.
|
inline |
Greater than or equal to operator.
other | The duration to compare. |
Definition at line 249 of file timepointbase.inl.
|
inline |
Greater than or equal to operator.
other | The duration to compare. |
Definition at line 256 of file timepointbase.inl.
|
inline |
Sets this object's value to the given duration, in the case the given is longer.
other | The time stamp to compare. |
Definition at line 161 of file timepointbase.inl.
|
inline |
Sets this object's value to the given duration, in the case the given is shorter.
other | The time stamp to compare. |
Definition at line 150 of file timepointbase.inl.