|
luna-sysmgr-common
|
#include <Timer.h>
Public Types | |
| typedef bool(Target::* | TimeoutFunction )() |
Public Member Functions | |
| Timer (SingletonTimer *masterTimer, Target *target, TimeoutFunction function) | |
Public Member Functions inherited from TimerBase | |
| TimerBase (SingletonTimer *masterTimer) | |
| virtual | ~TimerBase () |
| void | start (guint intervalInMs, bool singleShot=false) |
| void | stop () |
| bool | running () const |
Templated timer class
Timer class which can be set up to run a method within another class. Allows timers to be set up in two steps:
| typedef bool(Target::* Timer< Target >::TimeoutFunction)() |
Define the type of method that can be used as a timer callback
|
inline |
Construct a timer and set up the callback
Sets up a timer and ties it to a master SingletonTimer to use as a clock source, a target object, and the method within that object to use as a callback when the time specified in Timer::start() has elapsed.
| masterTimer | SingletonTimer to use as a clock source. |
| target | Object containing the method to call when time elapses. |
| function | The method within the given class to call when time elapses. |