0.2.0
Loading...
Searching...
No Matches
CallbackTimer Class Reference

Manages a thread which calls a specified function at a specified interval. More...

Public Member Functions

 CallbackTimer ()=default
 Default constructor.
 
 CallbackTimer (CallbackTimer &&)=delete
 Move constructor.
 
 CallbackTimer (const CallbackTimer &)=delete
 Copy constructor.
 
bool is_running () const noexcept
 Checks if the timer is currently running.
 
CallbackTimeroperator= (CallbackTimer &&)=delete
 Move assignment operator.
 
CallbackTimeroperator= (const CallbackTimer &)=delete
 Copy assignment operator.
 
void setInterval (int interval)
 Set the Interval of the timer.
 
void start (int interval, const std::function< void(void *)> &func, void *userData)
 Starts the timer.
 
void stop ()
 Stops the Timer.
 
 ~CallbackTimer ()
 Destructor.
 

Detailed Description

Manages a thread which calls a specified function at a specified interval.

Member Function Documentation

◆ is_running()

bool CallbackTimer::is_running ( ) const
noexcept

Checks if the timer is currently running.

Returns
True if the timer is running

◆ setInterval()

void CallbackTimer::setInterval ( int interval)

Set the Interval of the timer.

Parameters
[in]intervalInterval in [ms] when to trigger the callback

◆ start()

void CallbackTimer::start ( int interval,
const std::function< void(void *)> & func,
void * userData )

Starts the timer.

Parameters
[in]intervalInterval in [ms] when to trigger the callback
[in]funcFunction to call
[in,out]userDataUser Data which will be passed to the callback function

The documentation for this class was generated from the following file: