#include <SENSSimClock.h>
SENSSimClock Clock used for sensor simulation in SENSSimulator and SENSSimulated
Definition at line 11 of file SENSSimClock.h.
◆ SENSSimClock()
Definition at line 14 of file SENSSimClock.h.
std::chrono::high_resolution_clock::time_point SENSTimePt
SENSTimePt _simStartTimePt
start time point of simulation in the past
SENSTimePt _startTimePt
real start time point in the present (when SENSSimulation::start was called)
std::atomic_bool _pause
atomic, because we use it in now without mutex
◆ isPaused()
| bool SENSSimClock::isPaused |
( |
| ) |
const |
|
inline |
◆ now()
get current simulation time (const function which should be thread save)
Definition at line 71 of file SENSSimClock.h.
76 const std::lock_guard<std::mutex> lock(
_pauseMutex);
std::chrono::microseconds SENSMicroseconds
SENSMicroseconds _pauseTime
Offset from pause state: we have to accumulate pause times and subtract it from sim time.
◆ passedTime()
◆ pause()
| void SENSSimClock::pause |
( |
| ) |
|
|
inline |
◆ reset()
| void SENSSimClock::reset |
( |
| ) |
|
|
inline |
reset simulation (we switch to pause when setting new start, in this way now becomes thread save and we increase performance of now() (no mutex in nomal use))
Definition at line 45 of file SENSSimClock.h.
void pause()
pause simulation
void resume()
resume simulation
◆ resume()
| void SENSSimClock::resume |
( |
| ) |
|
|
inline |
◆ _pause
| std::atomic_bool SENSSimClock::_pause {true} |
|
private |
atomic, because we use it in now without mutex
Definition at line 89 of file SENSSimClock.h.
◆ _pauseMutex
| std::mutex SENSSimClock::_pauseMutex |
|
mutableprivate |
◆ _pauseTime
Offset from pause state: we have to accumulate pause times and subtract it from sim time.
Definition at line 95 of file SENSSimClock.h.
◆ _pauseTimePt
◆ _simStartTimePt
start time point of simulation in the past
Definition at line 99 of file SENSSimClock.h.
◆ _startTimePt
real start time point in the present (when SENSSimulation::start was called)
Definition at line 97 of file SENSSimClock.h.
The documentation for this class was generated from the following file: