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 module ALib BaseCamp ) can be used to convert durations to and from human readable units (days, hours, minutes, etc.).
class TimePointBase
Definition at line 111 of file timepointbase.hpp.
#include <timepointbase.hpp>
Public Type Index: | |
using | TDuration = typename std::chrono::steady_clock::duration |
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 (TDuration timeSpan) |
Public Method Index: | |
constexpr | Duration () |
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 | operator!= (const Duration &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 Duration &other) |
Duration | operator- (const Duration &rhs) const |
Duration & | operator-= (const Duration &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 Duration &other) const |
bool | operator== (const Duration &other) const |
bool | operator> (const Duration &other) const |
bool | operator>= (const Duration &other) const |
Duration & | SetMaximum (const Duration &other) |
Duration & | SetMinimum (const Duration &other) |
using TDuration = typename std::chrono::steady_clock::duration |
The value type for time spans.
Definition at line 121 of file timepointbase.hpp.
|
protected |
The internal time value.
Definition at line 129 of file timepointbase.hpp.
Protected constructor.
For construction with C++ library values, see method Import.
internalValue | The value to copy into this. |
Definition at line 137 of file timepointbase.hpp.
|
inlineconstexpr |
|
inline |
Returns the internal time span value using the C++ standard library format.
Definition at line 162 of file timepointbase.hpp.
|
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 527 of file timepointbase.hpp.
|
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 551 of file timepointbase.hpp.
|
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 647 of file timepointbase.hpp.
|
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.hpp.
|
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 575 of file timepointbase.hpp.
|
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 599 of file timepointbase.hpp.
|
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 515 of file timepointbase.hpp.
|
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 539 of file timepointbase.hpp.
|
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 635 of file timepointbase.hpp.
|
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 611 of file timepointbase.hpp.
|
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 563 of file timepointbase.hpp.
|
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 659 of file timepointbase.hpp.
|
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 587 of file timepointbase.hpp.
|
inlinestatic |
Creates an instance representing the time span given in C++ standard library format.
timeSpan | The C++ stead clock time point value. |
Definition at line 170 of file timepointbase.hpp.
|
inline |
Converts the internal value to absolute days.
Definition at line 371 of file timepointbase.hpp.
|
inline |
Converts the internal value to absolute hours.
Definition at line 391 of file timepointbase.hpp.
|
inline |
Converts the internal value to absolute microseconds.
Definition at line 467 of file timepointbase.hpp.
|
inline |
Converts the internal value to absolute milliseconds.
Definition at line 448 of file timepointbase.hpp.
|
inline |
Converts the internal value to absolute minutes.
Definition at line 410 of file timepointbase.hpp.
|
inline |
Converts the internal value to absolute seconds.
Definition at line 429 of file timepointbase.hpp.
|
inline |
Converts the internal value to days.
Definition at line 361 of file timepointbase.hpp.
|
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 489 of file timepointbase.hpp.
|
inline |
Converts the internal value to hours.
Definition at line 381 of file timepointbase.hpp.
|
inline |
Converts the internal value to microseconds.
Definition at line 457 of file timepointbase.hpp.
|
inline |
Converts the internal value to milliseconds.
Definition at line 438 of file timepointbase.hpp.
|
inline |
Converts the internal value to minutes.
Definition at line 400 of file timepointbase.hpp.
|
inline |
Converts the internal value to nanoseconds.
Definition at line 476 of file timepointbase.hpp.
|
inline |
Converts the internal value to seconds.
Definition at line 419 of file timepointbase.hpp.
|
inline |
Not equal to operator.
other | The time stamp to compare. |
Definition at line 208 of file timepointbase.hpp.
|
inline |
Multiply operator.
multiplier | The multiplier. |
Definition at line 271 of file timepointbase.hpp.
|
inline |
Multiply operator.
multiplier | The multiplier. |
Definition at line 281 of file timepointbase.hpp.
|
inline |
Assignment by product operator.
multiplier | The multiplier. |
Definition at line 291 of file timepointbase.hpp.
|
inline |
Assignment by product operator.
multiplier | The multiplier. |
Definition at line 302 of file timepointbase.hpp.
|
inline |
Addition operator.
rhs | The right-hand side time span to add. |
Definition at line 243 of file timepointbase.hpp.
|
inline |
Assignment by sum operator.
other | The time span object subtract. |
Definition at line 250 of file timepointbase.hpp.
|
inline |
Subtraction operator.
rhs | The right-hand side time span object to subtract. |
Definition at line 257 of file timepointbase.hpp.
|
inline |
Assignment by difference operator.
other | The time span object subtract. |
Definition at line 264 of file timepointbase.hpp.
|
inline |
Divide operator.
divisor | The divisor. |
Definition at line 313 of file timepointbase.hpp.
|
inline |
Divide operator.
divisor | The divisor. |
Definition at line 323 of file timepointbase.hpp.
|
inline |
Assignment by quotient operator.
divisor | The divisor. |
Definition at line 333 of file timepointbase.hpp.
|
inline |
Assignment by quotient operator.
divisor | The divisor. |
Definition at line 345 of file timepointbase.hpp.
|
inline |
Less than operator.
other | The time stamp to compare. |
Definition at line 215 of file timepointbase.hpp.
|
inline |
Less than or equal to operator.
other | The time stamp to compare. |
Definition at line 222 of file timepointbase.hpp.
|
inline |
Equal to operator.
other | The time stamp to compare. |
Definition at line 200 of file timepointbase.hpp.
|
inline |
Greater than operator.
other | The time stamp to compare. |
Definition at line 229 of file timepointbase.hpp.
|
inline |
Greater than or equal to operator.
other | The time stamp to compare. |
Definition at line 236 of file timepointbase.hpp.
|
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 189 of file timepointbase.hpp.
|
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 178 of file timepointbase.hpp.