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.).
An specialization of struct T_Append for this type exists with the inclusion of camp ALib BaseCamp in the ALib Distribution and the inclusion of alib/lang/system/calendar.hpp.
class TimePointBase
Definition at line 102 of file timepointbase.hpp.
#include <timepointbase.hpp>
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 TDuration = sc steady_clock::duration |
The value type for time spans.
Definition at line 112 of file timepointbase.hpp.
|
protected |
The internal time value.
Definition at line 120 of file timepointbase.hpp.
|
inlineconstexpr |
Creates a zero-length time span.
Definition at line 131 of file timepointbase.hpp.
Constructs an instance from C++ library values.
stdLibValue | The value to copy into this. |
Definition at line 138 of file timepointbase.hpp.
|
inline |
Returns the internal time span value using the C++ standard library format.
Definition at line 156 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 574 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 592 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 664 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 646 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 610 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 628 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 565 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 583 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 655 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 637 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 601 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 673 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 619 of file timepointbase.hpp.
|
inlinestatic |
Creates an instance representing the time span given in C++ standard library format.
timeSpan | The C++ time point value. |
Definition at line 164 of file timepointbase.hpp.
|
inline |
Converts the internal value to absolute days.
Definition at line 421 of file timepointbase.hpp.
|
inline |
Converts the internal value to absolute hours.
Definition at line 441 of file timepointbase.hpp.
|
inline |
Converts the internal value to absolute microseconds.
Definition at line 517 of file timepointbase.hpp.
|
inline |
Converts the internal value to absolute milliseconds.
Definition at line 498 of file timepointbase.hpp.
|
inline |
Converts the internal value to absolute minutes.
Definition at line 460 of file timepointbase.hpp.
|
inline |
Converts the internal value to absolute seconds.
Definition at line 479 of file timepointbase.hpp.
|
inline |
Converts the internal value to days.
Definition at line 411 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 539 of file timepointbase.hpp.
|
inline |
Converts the internal value to hours.
Definition at line 431 of file timepointbase.hpp.
|
inline |
Converts the internal value to microseconds.
Definition at line 507 of file timepointbase.hpp.
|
inline |
Converts the internal value to milliseconds.
Definition at line 488 of file timepointbase.hpp.
|
inline |
Converts the internal value to minutes.
Definition at line 450 of file timepointbase.hpp.
|
inline |
Converts the internal value to nanoseconds.
Definition at line 526 of file timepointbase.hpp.
|
inline |
Converts the internal value to seconds.
Definition at line 469 of file timepointbase.hpp.
|
inline |
true
if this is a positive duration, false
otherwise. Definition at line 190 of file timepointbase.hpp.
|
inline |
true
if this is is a zero-length time-span, false
otherwise. Definition at line 193 of file timepointbase.hpp.
|
inline |
Not equal to operator.
other | The duration to compare. |
Definition at line 215 of file timepointbase.hpp.
|
inline |
Not equal to operator.
other | The duration to compare. |
Definition at line 222 of file timepointbase.hpp.
|
inline |
Multiply operator.
multiplier | The multiplier. |
Definition at line 341 of file timepointbase.hpp.
|
inline |
Multiply operator.
multiplier | The multiplier. |
Definition at line 349 of file timepointbase.hpp.
|
inline |
Assignment by product operator.
multiplier | The multiplier. |
Definition at line 357 of file timepointbase.hpp.
|
inline |
Assignment by product operator.
multiplier | The multiplier. |
Definition at line 365 of file timepointbase.hpp.
|
inline |
Addition operator.
rhs | The right-hand side time span to add. |
Definition at line 285 of file timepointbase.hpp.
|
inline |
Addition operator.
rhs | The right-hand side time span to add. |
Definition at line 292 of file timepointbase.hpp.
|
inline |
Assignment by sum operator.
other | The time span to subtract. |
Definition at line 299 of file timepointbase.hpp.
|
inline |
Assignment by sum operator.
other | The time span to subtract. |
Definition at line 306 of file timepointbase.hpp.
|
inline |
Subtraction operator.
rhs | The right-hand side time span to subtract. |
Definition at line 313 of file timepointbase.hpp.
|
inline |
Subtraction operator.
rhs | The right-hand side time span to subtract. |
Definition at line 320 of file timepointbase.hpp.
|
inline |
Assignment by difference operator.
other | The time span subtract. |
Definition at line 327 of file timepointbase.hpp.
|
inline |
Assignment by difference operator.
other | The time span subtract. |
Definition at line 334 of file timepointbase.hpp.
|
inline |
Divide operator.
divisor | The divisor. |
Definition at line 373 of file timepointbase.hpp.
|
inline |
Divide operator.
divisor | The divisor. |
Definition at line 381 of file timepointbase.hpp.
|
inline |
Assignment by quotient operator.
divisor | The divisor. |
Definition at line 389 of file timepointbase.hpp.
|
inline |
Assignment by quotient operator.
divisor | The divisor. |
Definition at line 398 of file timepointbase.hpp.
|
inline |
Less than operator.
other | The duration to compare. |
Definition at line 229 of file timepointbase.hpp.
|
inline |
Less than operator.
other | The duration to compare. |
Definition at line 236 of file timepointbase.hpp.
|
inline |
Less than or equal to operator.
other | The duration to compare. |
Definition at line 243 of file timepointbase.hpp.
|
inline |
Less than or equal to operator.
other | The duration to compare. |
Definition at line 250 of file timepointbase.hpp.
|
inline |
Constructs an instance from C++ library values.
stdLibValue | The value to copy into this. |
Definition at line 146 of file timepointbase.hpp.
|
inline |
Equal to operator.
other | The duration to compare. |
Definition at line 200 of file timepointbase.hpp.
|
inline |
Equal to operator.
other | The duration to compare. |
Definition at line 208 of file timepointbase.hpp.
|
inline |
Greater than operator.
other | The duration to compare. |
Definition at line 257 of file timepointbase.hpp.
|
inline |
Greater than operator.
other | The duration to compare. |
Definition at line 264 of file timepointbase.hpp.
|
inline |
Greater than or equal to operator.
other | The duration to compare. |
Definition at line 271 of file timepointbase.hpp.
|
inline |
Greater than or equal to operator.
other | The duration to compare. |
Definition at line 278 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 183 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 172 of file timepointbase.hpp.