|
libdoip
0.1.0
DoIP (Diagnostics over Internet Protocol) ISO 13400 C++17 Library
|
#include <TimerManager.h>

Classes | |
| struct | TimerEntry |
Public Types | |
| using | TimerId = TimerIdType |
Public Member Functions | |
| TimerManager () | |
| ~TimerManager () | |
| std::optional< TimerId > | addTimer (TimerId id, std::chrono::milliseconds duration, std::function< void(TimerIdType)> callback, bool periodic=false) |
| Add a timer. More... | |
| bool | removeTimer (TimerId id) |
| Removes the timer. More... | |
| bool | restartTimer (TimerId id) |
| bool | updateTimer (TimerId id, std::chrono::milliseconds newDuration) |
| Updates a timer duration. More... | |
| bool | disableTimer (TimerId id) |
| Disables a timer. More... | |
| bool | enableTimer (TimerId id) |
| Enables a disabled timer. More... | |
| bool | resetTimer (TimerId id) |
| Restarts a timer (disables and enables it). More... | |
| void | stopAll () |
| Stops all timers and clears the timer list. More... | |
| bool | hasTimer (TimerId id) const |
| Check if specified timer exists. More... | |
| size_t | timerCount () const |
| The number of timers. More... | |
| void | stop () |
| Stops all timers and the timer manager. More... | |
Definition at line 17 of file TimerManager.h.
| using doip::TimerManager< TimerIdType >::TimerId = TimerIdType |
Definition at line 19 of file TimerManager.h.
|
inline |
Definition at line 30 of file TimerManager.h.
|
inline |
Definition at line 34 of file TimerManager.h.
References doip::TimerManager< TimerIdType >::stop().
|
inline |
Add a timer.
| duration | the timer duration in ms |
| callback | the callback function to invoke when timer expired. Must not be null. |
| periodic | true, if timer should start again when expired |
Definition at line 47 of file TimerManager.h.
References doip::TimerManager< TimerIdType >::TimerEntry::callback, doip::TimerManager< TimerIdType >::TimerEntry::enabled, doip::TimerManager< TimerIdType >::TimerEntry::expiry, doip::TimerManager< TimerIdType >::TimerEntry::id, doip::TimerManager< TimerIdType >::TimerEntry::interval, and doip::TimerManager< TimerIdType >::TimerEntry::periodic.
|
inline |
Disables a timer.
| id | the id of the timer |
Definition at line 126 of file TimerManager.h.
Referenced by doip::TimerManager< TimerIdType >::resetTimer().
|
inline |
Enables a disabled timer.
If the specified timer is not disabled, the function has no effect.
| id | the id of the timer |
Definition at line 145 of file TimerManager.h.
Referenced by doip::TimerManager< TimerIdType >::resetTimer().
|
inline |
Check if specified timer exists.
| id | the id of the timer |
Definition at line 187 of file TimerManager.h.
|
inline |
Removes the timer.
| id | the id of the timer |
Definition at line 78 of file TimerManager.h.
|
inline |
Restarts a timer (disables and enables it).
| id | the id of the timer |
Definition at line 167 of file TimerManager.h.
References doip::TimerManager< TimerIdType >::disableTimer(), and doip::TimerManager< TimerIdType >::enableTimer().
|
inline |
Definition at line 84 of file TimerManager.h.
|
inline |
Stops all timers and the timer manager.
Definition at line 206 of file TimerManager.h.
Referenced by doip::TimerManager< TimerIdType >::~TimerManager().
|
inline |
Stops all timers and clears the timer list.
Definition at line 174 of file TimerManager.h.
|
inline |
The number of timers.
Definition at line 198 of file TimerManager.h.
|
inline |
Updates a timer duration.
The current timer is stopped and then started with the new duration.
| id | the id of the timer |
| newDuration | the new duration in ms |
Definition at line 106 of file TimerManager.h.