Manages a thread which calls a specified function at a specified interval.
More...
|
| std::atomic< bool > | _execute |
| | Flag whether the timer should execute.
|
| std::atomic< int > | _interval |
| | Interval in which the timer is triggered.
|
| std::thread | _thd |
| | Thread object which triggers the timer.
|
Manages a thread which calls a specified function at a specified interval.
Definition at line 21 of file CallbackTimer.hpp.
◆ CallbackTimer() [1/3]
| CallbackTimer::CallbackTimer |
( |
| ) |
|
|
default |
◆ CallbackTimer() [2/3]
◆ CallbackTimer() [3/3]
◆ ~CallbackTimer()
| CallbackTimer::~CallbackTimer |
( |
| ) |
|
◆ is_running()
| bool CallbackTimer::is_running |
( |
| ) |
const |
|
nodiscardnoexcept |
Checks if the timer is currently running.
- Returns
- True if the timer is running
Definition at line 56 of file CallbackTimer.cpp.
◆ operator=() [1/2]
Move assignment operator.
◆ operator=() [2/2]
Copy assignment operator.
◆ setInterval()
| void CallbackTimer::setInterval |
( |
int | interval | ) |
|
Set the Interval of the timer.
- Parameters
-
| [in] | interval | Interval in [ms] when to trigger the callback |
Definition at line 51 of file CallbackTimer.cpp.
◆ start()
| void CallbackTimer::start |
( |
int | interval, |
|
|
const std::function< void(void *)> & | func, |
|
|
void * | userData ) |
Starts the timer.
- Parameters
-
| [in] | interval | Interval in [ms] when to trigger the callback |
| [in] | func | Function to call |
| [in,out] | userData | User Data which will be passed to the callback function |
Definition at line 30 of file CallbackTimer.cpp.
◆ stop()
| void CallbackTimer::stop |
( |
| ) |
|
◆ _execute
| std::atomic<bool> CallbackTimer::_execute |
|
private |
◆ _interval
| std::atomic<int> CallbackTimer::_interval |
|
private |
◆ _thd
| std::thread CallbackTimer::_thd |
|
private |
The documentation for this class was generated from the following files: