TSDuck Version 3.16-1064 (TSDuck - The MPEG Transport Stream Toolkit)
ts::Monotonic Class Reference

Basic monotonic clock & timer. More...

Classes

class  MonotonicError
 Low-level monotonic clock error. More...
 

Public Member Functions

 Monotonic (bool systemTime=false)
 Default constructor. More...
 
 Monotonic (const Monotonic &t)
 Copy constructor. More...
 
 ~Monotonic ()
 Destructor.
 
void getSystemTime ()
 Load this object with the current system time.
 
bool operator!= (const Monotonic &t) const
 Comparison operator. More...
 
Monotonicoperator+= (const NanoSecond &ns)
 Increment operator. More...
 
NanoSecond operator- (const Monotonic &t) const
 Difference operator. More...
 
Monotonicoperator-= (const NanoSecond &ns)
 Decrement operator. More...
 
bool operator< (const Monotonic &t) const
 Comparison operator. More...
 
bool operator<= (const Monotonic &t) const
 Comparison operator. More...
 
Monotonicoperator= (const Monotonic &t)
 Assigment operator. More...
 
bool operator== (const Monotonic &t) const
 Comparison operator. More...
 
bool operator> (const Monotonic &t) const
 Comparison operator. More...
 
bool operator>= (const Monotonic &t) const
 Comparison operator. More...
 
void wait ()
 Wait until the time of the monotonic clock.
 

Static Public Member Functions

static NanoSecond SetPrecision (const NanoSecond &precision)
 This static method requests a minimum resolution, in nano-seconds, for the timers. More...
 

Detailed Description

Basic monotonic clock & timer.

Constructor & Destructor Documentation

◆ Monotonic() [1/2]

ts::Monotonic::Monotonic ( bool  systemTime = false)

Default constructor.

Parameters
[in]systemTimeIf true, initialize with current system time.
See also
getSystemTime()

◆ Monotonic() [2/2]

ts::Monotonic::Monotonic ( const Monotonic t)

Copy constructor.

Parameters
[in]tAnother instance to copy.

Member Function Documentation

◆ operator=()

Monotonic& ts::Monotonic::operator= ( const Monotonic t)
inline

Assigment operator.

Parameters
[in]tAnother instance to copy.
Returns
A reference to this object.

◆ operator==()

bool ts::Monotonic::operator== ( const Monotonic t) const
inline

Comparison operator.

Parameters
[in]tAnother instance to compare.
Returns
True if this object == t.

◆ operator!=()

bool ts::Monotonic::operator!= ( const Monotonic t) const
inline

Comparison operator.

Parameters
[in]tAnother instance to compare.
Returns
True if this object != t.

◆ operator<()

bool ts::Monotonic::operator< ( const Monotonic t) const
inline

Comparison operator.

Parameters
[in]tAnother instance to compare.
Returns
True if this object < t.

◆ operator<=()

bool ts::Monotonic::operator<= ( const Monotonic t) const
inline

Comparison operator.

Parameters
[in]tAnother instance to compare.
Returns
True if this object <= t.

◆ operator>()

bool ts::Monotonic::operator> ( const Monotonic t) const
inline

Comparison operator.

Parameters
[in]tAnother instance to compare.
Returns
True if this object > t.

◆ operator>=()

bool ts::Monotonic::operator>= ( const Monotonic t) const
inline

Comparison operator.

Parameters
[in]tAnother instance to compare.
Returns
True if this object >= t.

◆ operator+=()

Monotonic& ts::Monotonic::operator+= ( const NanoSecond ns)
inline

Increment operator.

Parameters
[in]nsA number of nanoseconds to add.
Returns
A reference to this object.

◆ operator-=()

Monotonic& ts::Monotonic::operator-= ( const NanoSecond ns)
inline

Decrement operator.

Parameters
[in]nsA number of nanoseconds to substract.
Returns
A reference to this object.

◆ operator-()

NanoSecond ts::Monotonic::operator- ( const Monotonic t) const
inline

Difference operator.

Parameters
[in]tAnother instance.
Returns
The number of nanoseconds between this object and t. Can be negative.

◆ SetPrecision()

static NanoSecond ts::Monotonic::SetPrecision ( const NanoSecond precision)
static

This static method requests a minimum resolution, in nano-seconds, for the timers.

Parameters
[in]precisionRequested minimum resolution in nano-seconds.
Returns
The guaranteed precision value (can be equal to or greater than the requested value). The default system resolution is 20 ms on Win32, which can be too long for applications.

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