Simple RAII wrapper around OS timers.
More...
#include <PeriodicTimer.h>
|
| | PeriodicTimer () noexcept |
| |
| | ~PeriodicTimer () |
| |
| bool | Create (const char *name, void(*callback)(uint32_t), uint32_t arg, uint32_t periodMs, bool autoStart=false) noexcept |
| | Create a periodic timer.
|
| |
| bool | Start () noexcept |
| |
| bool | Stop () noexcept |
| |
| bool | Destroy () noexcept |
| |
| bool | IsValid () const noexcept |
| |
Simple RAII wrapper around OS timers.
◆ PeriodicTimer()
| PeriodicTimer::PeriodicTimer |
( |
| ) |
|
|
inlinenoexcept |
Construct an empty timer.
◆ ~PeriodicTimer()
| PeriodicTimer::~PeriodicTimer |
( |
| ) |
|
|
inline |
Delete timer on destruction.
◆ Create()
| bool PeriodicTimer::Create |
( |
const char * |
name, |
|
|
void(*)(uint32_t) |
callback, |
|
|
uint32_t |
arg, |
|
|
uint32_t |
periodMs, |
|
|
bool |
autoStart = false |
|
) |
| |
|
inlinenoexcept |
Create a periodic timer.
- Parameters
-
| name | Timer name used for debugging. |
| callback | Function called on each expiration. |
| arg | Value passed to the callback. |
| periodMs | Period in milliseconds. |
| autoStart | Whether to start immediately after creation. |
- Returns
- true on success.
◆ Destroy()
| bool PeriodicTimer::Destroy |
( |
| ) |
|
|
inlinenoexcept |
◆ IsValid()
| bool PeriodicTimer::IsValid |
( |
| ) |
const |
|
inlinenoexcept |
Check if the timer was successfully created.
◆ Start()
| bool PeriodicTimer::Start |
( |
| ) |
|
|
inlinenoexcept |
◆ Stop()
| bool PeriodicTimer::Stop |
( |
| ) |
|
|
inlinenoexcept |
◆ created
| bool PeriodicTimer::created |
|
private |
◆ timer
The documentation for this class was generated from the following file: