A class that manages Timers and schedules TimerEvents for delivery when Timers fire.
More...
#include <TimerManager.hpp>
|
static const int | MAX_TIMERS = 32 |
| The maximum number of timers that can be allocated by an application. More...
|
|
A class that manages Timers and schedules TimerEvents for delivery when Timers fire.
At most TimerManager::MAX_TIMERS timers can be active per application. The TimerManager runs in its own dedicated thread; it is is threadsafe and can be safely used by multiple concurrent threads.
- Author
- Mark Lindner
◆ ~TimerManager()
◆ addTimer()
TimerID addTimer |
( |
timespan_s_t |
interval, |
|
|
bool |
repeating = true |
|
) |
| |
Add a new timer.
- Parameters
-
interval | The time interval at which this timer will fire, in seconds. If interval is 0, it is defaulted to 1. |
repeating | A flag indicating whether this is a repeating or one-shot timer. A one-shot timer will be automatically cancelled after the first time it fires. |
- Returns
- The ID of the new timer.
- Exceptions
-
◆ cancelAllTimers()
Cancel all active timers.
◆ cancelTimer()
Cancel the timer with the given ID.
- Parameters
-
◆ getFreeTimerCount()
uint_t getFreeTimerCount |
( |
| ) |
const |
Get the number of available (inactive) timers.
◆ MAX_TIMERS
const int MAX_TIMERS = 32 |
|
static |
The maximum number of timers that can be allocated by an application.
The documentation for this class was generated from the following files: