ALib C++ Library
Library Version: 2412 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
Ticks Class Reference

Description:

This class provides an interface into system dependent steady, monotonic timer values, which are independent of the system's clock settings, hence independent of changes of the clock by the user, by external clock synchronization using the internet, GPS, mobile network, etc.

Usually, this class is used to measure and store durations (e.g., with inherited method Age). As tick values are not just system dependent, but even usually change with a reboot of a system, they should not be stored and loaded in data files or otherwise shared between systems.

In contrast to sibling type DateTime, this class is also missing conversion methods with types that represent "human" calendar dates and a clock times. However, in some situations it still may be needed to convert the points in time measured with this class to human-readable date and time representations. For this purpose, class TickConverter allows converting objects of this type to objects of sibling type DateTime, which then can be further converted to system-dependent calendar dates and clock times.

The class has no specific interface, but the methods and operators inherited from base TimePointBase.

See also
For this class, a pretty printer for the GNU debugger is provided.

Definition at line 40 of file ticks.hpp.

#include <ticks.hpp>

Inheritance diagram for Ticks:
[legend]
Collaboration diagram for Ticks:
[legend]

Public Method Index:

bool operator!= (const Ticks &other) const
 
bool operator< (const Ticks &other) const
 
bool operator<= (const Ticks &other) const
 
bool operator== (const Ticks &other) const
 
bool operator> (const Ticks &other) const
 
bool operator>= (const Ticks &other) const
 
- Public Method Index: inherited from TimePointBase< std::chrono::steady_clock, Ticks >
constexpr TimePointBase (const lang::Initialization init=lang::Initialization::Default)
 
constexpr TimePointBase (TTimePoint internalValue)
 
Duration Age () const
 
TTimePoint Export () const
 
void Import (TTimePoint timePoint)
 
bool IsOlderThan (const Duration &timeSpan) const
 
bool IsSet ()
 
Ticks operator+ (const Duration &timeSpan) const
 
Ticks operator+ (const typename Duration::TDuration &timeSpan) const
 
Ticks operator+= (const Duration &timeSpan)
 
Ticks operator+= (const typename Duration::TDuration &timeSpan)
 
Ticks operator- (const Duration &timeSpan) const
 
Duration operator- (const Ticks &other) const
 
Ticks operator- (const typename Duration::TDuration &timeSpan) const
 
Ticks operator-= (const Duration &timeSpan)
 
Ticks operator-= (const typename Duration::TDuration &timeSpan)
 
TicksReset ()
 
void SetAs (const Ticks &other)
 
void SetFromRaw (TRaw raw)
 
Duration Since (const Ticks &other) const
 
TRaw ToRaw () const
 
void Unset ()
 

Additional Inherited Members

- Public Type Index: inherited from TimePointBase< std::chrono::steady_clock, Ticks >
using TRaw
 Integral type used for exporting and importing values in raw units.
 
using TTimePoint
 The internal c++ type for time points.
 
- Public Static Method Index: inherited from TimePointBase< std::chrono::steady_clock, Ticks >
static Ticks BeginningOfEpoch ()
 
static Ticks EndOfEpoch ()
 
static Ticks FromRaw (TRaw raw)
 
static Ticks Now ()
 
- Protected Field Index: inherited from TimePointBase< std::chrono::steady_clock, Ticks >
TTimePoint stamp
 

Method Details:

◆ operator!=()

bool operator!= ( const Ticks & other) const
inline

Not equal to operator.

Parameters
otherThe time stamp to compare.
Returns
The result of the comparison.

Definition at line 66 of file ticks.hpp.

◆ operator<()

bool operator< ( const Ticks & other) const
inline

Less than operator.

Parameters
otherThe time stamp to compare.
Returns
A reference to this object.

Definition at line 76 of file ticks.hpp.

◆ operator<=()

bool operator<= ( const Ticks & other) const
inline

Less than or equal to operator.

Parameters
otherThe time stamp to compare.
Returns
The result of the comparison.

Definition at line 86 of file ticks.hpp.

◆ operator==()

bool operator== ( const Ticks & other) const
inline

Equal to operator.

Parameters
otherThe time stamp to compare.
Returns
The result of the comparison.

Definition at line 55 of file ticks.hpp.

◆ operator>()

bool operator> ( const Ticks & other) const
inline

Greater than operator.

Parameters
otherThe time stamp to compare.
Returns
The result of the comparison.

Definition at line 96 of file ticks.hpp.

◆ operator>=()

bool operator>= ( const Ticks & other) const
inline

Greater than or equal to operator.

Parameters
otherThe time stamp to compare.
Returns
The result of the comparison.

Definition at line 106 of file ticks.hpp.


The documentation for this class was generated from the following file: