Open Lighting Architecture: ola::MockClock Class Reference

| Open Lighting Architecture 0.10.9

Loading...
Searching...
No Matches
Public Member Functions | List of all members
ola::MockClock Class Reference

## Detailed Description

A Mock Clock used for testing.

Inheritance diagram for ola::MockClock:

## 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.
void | CurrentRealTime (TimeStamp *timestamp) const
| Sets timestamp to the current real time.
void | CurrentTime (TimeStamp *timestamp) const
| Wrapper around CurrentRealime.

## 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] | timestamp | A 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] | timestamp | A TimeStamp pointer

Reimplemented from ola::Clock.

## ◆ CurrentTime()

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

Wrapper around CurrentRealime.

Parameters

  [out] | timestamp | A 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:

- include/ola/Clock.h
- common/utils/Clock.cpp