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 78 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 88 of file timepointbase.inl.
|
protected |
The internal time value.
Definition at line 96 of file timepointbase.inl.
|
inlineconstexpr |
Creates a zero-length time span.
Definition at line 105 of file timepointbase.inl.
|
inline |
Constructs an instance from C++ library values.
| stdLibValue | The value to copy into this. |
Definition at line 111 of file timepointbase.inl.
|
inline |
Returns the internal time span value using the C++ standard library format.
Definition at line 126 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 429 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 443 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 499 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 485 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 457 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 471 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 422 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 436 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 492 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 478 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 450 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 506 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 464 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 132 of file timepointbase.inl.
|
inline |
Converts the internal value to absolute days.
Definition at line 324 of file timepointbase.inl.
|
inline |
Converts the internal value to absolute hours.
Definition at line 338 of file timepointbase.inl.
|
inline |
Converts the internal value to absolute microseconds.
Definition at line 386 of file timepointbase.inl.
|
inline |
Converts the internal value to absolute milliseconds.
Definition at line 374 of file timepointbase.inl.
|
inline |
Converts the internal value to absolute minutes.
Definition at line 350 of file timepointbase.inl.
|
inline |
Converts the internal value to absolute seconds.
Definition at line 362 of file timepointbase.inl.
|
inline |
Converts the internal value to days.
Definition at line 317 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 400 of file timepointbase.inl.
|
inline |
Converts the internal value to hours.
Definition at line 331 of file timepointbase.inl.
|
inline |
Converts the internal value to microseconds.
Definition at line 379 of file timepointbase.inl.
|
inline |
Converts the internal value to milliseconds.
Definition at line 367 of file timepointbase.inl.
|
inline |
Converts the internal value to minutes.
Definition at line 343 of file timepointbase.inl.
|
inline |
Converts the internal value to nanoseconds.
Definition at line 391 of file timepointbase.inl.
|
inline |
Converts the internal value to seconds.
Definition at line 355 of file timepointbase.inl.
|
inline |
true if this is a positive duration, false otherwise. Definition at line 154 of file timepointbase.inl.
|
inline |
true if this is a zero-length time-span, false otherwise. Definition at line 157 of file timepointbase.inl.
|
inline |
Not equal to operator.
| other | The duration to compare. |
Definition at line 173 of file timepointbase.inl.
|
inline |
Not equal to operator.
| other | The duration to compare. |
Definition at line 178 of file timepointbase.inl.
|
inline |
Multiply operator.
| multiplier | The multiplier. |
Definition at line 263 of file timepointbase.inl.
|
inline |
Multiply operator.
| multiplier | The multiplier. |
Definition at line 269 of file timepointbase.inl.
|
inline |
Assignment by product operator.
| multiplier | The multiplier. |
Definition at line 275 of file timepointbase.inl.
|
inline |
Assignment by product operator.
| multiplier | The multiplier. |
Definition at line 281 of file timepointbase.inl.
|
inline |
Addition operator.
| rhs | The right-hand side time span to add. |
Definition at line 223 of file timepointbase.inl.
|
inline |
Addition operator.
| rhs | The right-hand side time span to add. |
Definition at line 228 of file timepointbase.inl.
|
inline |
Assignment by sum operator.
| other | The time span to subtract. |
Definition at line 233 of file timepointbase.inl.
|
inline |
Assignment by sum operator.
| other | The time span to subtract. |
Definition at line 238 of file timepointbase.inl.
|
inline |
Subtraction operator.
| rhs | The right-hand side time span to subtract. |
Definition at line 243 of file timepointbase.inl.
|
inline |
Subtraction operator.
| rhs | The right-hand side time span to subtract. |
Definition at line 248 of file timepointbase.inl.
|
inline |
Assignment by difference operator.
| other | The time span subtract. |
Definition at line 253 of file timepointbase.inl.
|
inline |
Assignment by difference operator.
| other | The time span subtract. |
Definition at line 258 of file timepointbase.inl.
|
inline |
Divide operator.
| divisor | The divisor. |
Definition at line 287 of file timepointbase.inl.
|
inline |
Divide operator.
| divisor | The divisor. |
Definition at line 293 of file timepointbase.inl.
|
inline |
Assignment by quotient operator.
| divisor | The divisor. |
Definition at line 299 of file timepointbase.inl.
|
inline |
Assignment by quotient operator.
| divisor | The divisor. |
Definition at line 306 of file timepointbase.inl.
|
inline |
Less than operator.
| other | The duration to compare. |
Definition at line 183 of file timepointbase.inl.
|
inline |
Less than operator.
| other | The duration to compare. |
Definition at line 188 of file timepointbase.inl.
|
inline |
Less than or equal to operator.
| other | The duration to compare. |
Definition at line 193 of file timepointbase.inl.
|
inline |
Less than or equal to operator.
| other | The duration to compare. |
Definition at line 198 of file timepointbase.inl.
|
inline |
Constructs an instance from C++ library values.
| stdLibValue | The value to copy into this. |
Definition at line 118 of file timepointbase.inl.
|
inline |
Equal to operator.
| other | The duration to compare. |
Definition at line 162 of file timepointbase.inl.
|
inline |
Equal to operator.
| other | The duration to compare. |
Definition at line 168 of file timepointbase.inl.
|
inline |
Greater than operator.
| other | The duration to compare. |
Definition at line 203 of file timepointbase.inl.
|
inline |
Greater than operator.
| other | The duration to compare. |
Definition at line 208 of file timepointbase.inl.
|
inline |
Greater than or equal to operator.
| other | The duration to compare. |
Definition at line 213 of file timepointbase.inl.
|
inline |
Greater than or equal to operator.
| other | The duration to compare. |
Definition at line 218 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 147 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 138 of file timepointbase.inl.