The MonitorTimer keeps track of the time when to emit monitor data.
More...
#include <monitor.hh>
|
using | Clock = std::chrono::high_resolution_clock |
| Data type for the clock.
|
|
using | Time = std::chrono::high_resolution_clock::time_point |
| Data type for a time point.
|
|
using | DurationType = std::chrono::duration< double > |
| Data type for the time unit.
|
|
The MonitorTimer keeps track of the time when to emit monitor data.
◆ Clock
◆ DurationType
Data type for the time unit.
◆ Time
Data type for a time point.
◆ MonitorTimer()
Utopia::DataIO::MonitorTimer::MonitorTimer |
( |
const double |
emit_interval | ) |
|
|
inline |
Constructor.
Construct a new Monitor Timer object. The _last_emit time is set to the time of construction.
- Parameters
-
emit_interval | The time interval that defines whether the time has come to emit data. If more time than the _emit_interval has passed the time_has_come function returns true. |
97 :
98
100
102
103
const DurationType _emit_interval
The emit interval.
Definition monitor.hh:79
Time _last_emit
The time of the last emit.
Definition monitor.hh:85
const Time _start_time
The starting time of the timer.
Definition monitor.hh:82
Container select_entities(const Manager &mngr, const DataIO::Config &sel_cfg)
Select entities according to parameters specified in a configuration.
Definition select.hh:213
◆ get_emit_interval()
Return the emit interval.
◆ get_time_elapsed()
const DurationT Utopia::DataIO::MonitorTimer::get_time_elapsed |
( |
| ) |
const |
|
inline |
Get the time elapsed since the start of this timer.
◆ get_time_elapsed_seconds()
double Utopia::DataIO::MonitorTimer::get_time_elapsed_seconds |
( |
| ) |
const |
|
inline |
Get the time elapsed since start of this timer, converted to seconds.
◆ reset()
void Utopia::DataIO::MonitorTimer::reset |
( |
| ) |
|
|
inline |
Reset the timer to the current time.
◆ time_has_come()
bool Utopia::DataIO::MonitorTimer::time_has_come |
( |
| ) |
const |
|
inline |
Check for whether the time to emit has come or not.
- Parameters
-
reset | Reset the internal timer to the current time if the _emit_interval has been exceeded. |
- Returns
- true if the internal timer has exceeded the _last_emit time.
114 {
115
117
118
120 }
std::chrono::duration< double > DurationType
Data type for the time unit.
Definition monitor.hh:74
◆ _emit_interval
◆ _last_emit
Time Utopia::DataIO::MonitorTimer::_last_emit |
|
private |
The time of the last emit.
◆ _start_time
const Time Utopia::DataIO::MonitorTimer::_start_time |
|
private |
The starting time of the timer.
The documentation for this class was generated from the following file: