#include <TimerManager.hpp>
◆ TimerManager()
zct::TimerManager::TimerManager |
( |
uint32_t |
maxNumTimers | ) |
|
|
inline |
Create a new timer manager.
Dynamically allocates memory for maxNumTimers pointers to timers.
- Parameters
-
maxNumTimers | The maximum number of timers that can be registered with the timer manager. Space for this many pointers to timers will be allocated on the heap. |
◆ ~TimerManager()
zct::TimerManager::~TimerManager |
( |
| ) |
|
|
inline |
◆ getNextExpiringTimer()
Iterates over all registered timers and returns the expiry time of the timer that expires next. If no timer is found, the 'timer' member of the returned struct will be nullptr. timer is guaranteed to not be nullptr if durationToWaitUs is not UINT64_MAX.
This function does not update the timer's next expiry time if it finds an expired timer. It is up to the caller to do this when it decides that the timer expiry has been "handled".
- Returns
- A struct containing the timer that expires next and the duration to wait until that timer expires.
◆ registerTimer()
void zct::TimerManager::registerTimer |
( |
Timer & |
timer | ) |
|
|
inline |
Registers a timer with the timer manager. The provided timer needs to exist for the duration of the registration.
- Parameters
-
timer | The timer to register. |
◆ m_maxNumTimers
uint32_t zct::TimerManager::m_maxNumTimers |
|
protected |
◆ m_numTimers
uint32_t zct::TimerManager::m_numTimers = 0 |
|
protected |
◆ m_timers
Timer** zct::TimerManager::m_timers |
|
protected |
The documentation for this class was generated from the following file:
- /home/runner/work/ZephyrCppToolkit/ZephyrCppToolkit/include/ZephyrCppToolkit/Events/TimerManager.hpp