Go to the documentation of this file.
37 #ifndef ASYNC_TIMER_INCLUDED
38 #define ASYNC_TIMER_INCLUDED
47 #include <sigc++/sigc++.h>
116 class Timer :
public sigc::trackable
153 Type type(
void)
const {
return m_type; }
173 int timeout(
void)
const {
return m_timeout_ms; }
190 bool isEnabled(
void)
const {
return m_is_enabled; }
210 sigc::signal<void, Timer *>
expired;
bool isEnabled(void) const
Check if the timer is enabled.
Timer(int timeout_ms=0, Type type=TYPE_ONESHOT, bool enabled=true)
Constructor.
@ TYPE_PERIODIC
A timer that restarts itself every time it expires.
sigc::signal< void, Timer * > expired
A signal that is emitted when the timer expires.
Type
The type of the timer.
void reset(void)
Reset (restart) the timer.
void setEnable(bool do_enable)
Enable or disable the timer.
@ TYPE_ONESHOT
A timer that expires once.
void setTimeout(int timeout_ms)
Set (change) the timeout value.
Namespace for the asynchronous programming classes.
int timeout(void) const
Return the setting of the timeout value.
Type type(void) const
Return the type of this timer.