lecui 1.0.0-alpha.20
lecui C++ user interface library
|
Timer manager class. More...
#include <timer.h>
Public Member Functions | |
timer_manager (form &fm) | |
Timer manager constructor. More... | |
~timer_manager () | |
Destructor. | |
void | add (const std::string &alias, const unsigned long &milliseconds, std::function< void()> on_timer) |
Add a timer. More... | |
bool | running (const std::string &alias) |
Check if a specific timer is running. More... | |
void | stop (const std::string &alias) |
Stop a specific timer. More... | |
Timer manager class.
liblec::lecui::timer_manager::timer_manager | ( | form & | fm | ) |
Timer manager constructor.
fm | A reference to the form. |
void liblec::lecui::timer_manager::add | ( | const std::string & | alias, |
const unsigned long & | milliseconds, | ||
std::function< void()> | on_timer | ||
) |
Add a timer.
alias | The in-form unique alias, e.g. "activation_timer". |
milliseconds | The cycle duration. |
on_timer | The handler that's called after the duration. |
The timer will keep running until stopped manually, with the handler getting called repeatedly in a cycle.
bool liblec::lecui::timer_manager::running | ( | const std::string & | alias | ) |
Check if a specific timer is running.
alias | The timer's unique alias. |
void liblec::lecui::timer_manager::stop | ( | const std::string & | alias | ) |
Stop a specific timer.
alias | The timer's unique alias. |