Open Lighting Architecture  Latest Git
Public Member Functions | List of all members
ola::MockClock Class Reference

Detailed Description

A Mock Clock used for testing.

Inheritance diagram for ola::MockClock:
Inheritance graph
[legend]
Collaboration diagram for ola::MockClock:
Collaboration graph
[legend]

Public Member Functions

void AdvanceTime (const TimeInterval &interval)
 
void AdvanceTime (int32_t sec, int32_t usec)
 
void CurrentMonotonicTime (TimeStamp *timestamp) const
 Sets timestamp to the current monotonic time. More...
 
void CurrentRealTime (TimeStamp *timestamp) const
 Sets timestamp to the current real time. More...
 
void CurrentTime (TimeStamp *timestamp) const
 Wrapper around CurrentRealime. More...
 

Member Function Documentation

◆ CurrentMonotonicTime()

void ola::MockClock::CurrentMonotonicTime ( TimeStamp timestamp) const
virtual

Sets timestamp to the current monotonic time.

The timestamp parameter will be set to the current monotonic time only if the system has a monotonic clock available. If a monotonic clock is unavailable, this method will fallback to CurrentRealTime.

The system's monotonic clock is not subject to discontinuous jumps due to administrative action, but may be affected by incremental adjustment due to time synchronization protocol e.g. NTP. The monotonic clock does not advance while the system is suspended. An appropriate use of this method is to measure elapsed time.

See also
Clock::CurrentRealTime
Parameters
[out]timestampA TimeStamp pointer

Reimplemented from ola::Clock.

◆ CurrentRealTime()

void ola::MockClock::CurrentRealTime ( TimeStamp timestamp) const
virtual

Sets timestamp to the current real time.

The timestamp parameter will be set to the current real i.e. wall-clock time.

The system's realtime clock is subject to discontinuous and incremental adjustment due to administrative action or time synchronization protocol e.g. NTP. An appropriate use of this method is to display a user-facing timestamp.

See also
Clock::CurrentMonotonicTime
Parameters
[out]timestampA TimeStamp pointer

Reimplemented from ola::Clock.

◆ CurrentTime()

void ola::MockClock::CurrentTime ( TimeStamp timestamp) const
virtual

Wrapper around CurrentRealime.

Parameters
[out]timestampA TimeStamp pointer
Deprecated:
Please use either Clock::CurrentMonotonicTime or Clock::CurrentRealTime as appropriate (25 Oct 2020).

Reimplemented from ola::Clock.


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