Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
MockClock Class Reference

Fake implementation of Clock that returns an injected time. More...

#include <Clock.hxx>

Inheritance diagram for MockClock:
Clock

Public Member Functions

 MockClock (long long time)
 Consturctor.
 
long long get_time_nsec ()
 
void set_time (long long time)
 

Private Attributes

long long time_
 Current mock time.
 

Detailed Description

Fake implementation of Clock that returns an injected time.

Todo:
(balazs.racz) this should be called FakeClock instead.

Definition at line 66 of file Clock.hxx.

Constructor & Destructor Documentation

◆ MockClock()

MockClock::MockClock ( long long  time)
inline

Consturctor.

Parameters
timethe clock vale to set.

Definition at line 70 of file Clock.hxx.

Member Function Documentation

◆ get_time_nsec()

long long MockClock::get_time_nsec ( )
inlinevirtual
Returns
the mock time.

Implements Clock.

Definition at line 74 of file Clock.hxx.

◆ set_time()

void MockClock::set_time ( long long  time)
inline
Parameters
timeis the mock time to set.

Definition at line 79 of file Clock.hxx.

Member Data Documentation

◆ time_

long long MockClock::time_
private

Current mock time.

Definition at line 85 of file Clock.hxx.


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