|
libcommonc++
0.7
|
A high-precision interval timer that does not require blocking or polling from a dedicated thread. More...
#include <IntervalTimer.h++>
Public Member Functions | |
| virtual | ~IntervalTimer () |
| Destructor. More... | |
| void | start () |
| Start the timer. More... | |
| void | stop () |
| Stop the timer. More... | |
| uint_t | getInitialDelay () const |
| Get the initial delay, in milliseconds. More... | |
| void | setInitialDelay (uint_t initialDelay) |
| Set the initial delay, in milliseconds. More... | |
| uint_t | getInterval () const |
| Get the interval, in milliseconds. More... | |
| void | setInterval (uint_t interval) |
| Set the interval, in milliseconds. More... | |
| bool | isRunning () const |
| Determine if the timer is currently running. More... | |
Protected Member Functions | |
| IntervalTimer (uint_t initialDelay, uint_t interval=0) | |
| Construct a new IntervalTimer with the given initial delay and interval. More... | |
| virtual void | fired ()=0 |
| Callback. More... | |
A high-precision interval timer that does not require blocking or polling from a dedicated thread.
This is an abstract class which should be subclassed to provide an implementation of the fired() method, which is invoked each time the timer fires.
NOTE: This class is currently not implemented on Mac OS X.
|
virtual |
Destructor.
|
protected |
Construct a new IntervalTimer with the given initial delay and interval.
| initialDelay | The delay, in milliseconds, between the time that the timer is started and the first time it fires. |
| interval | The interval, in milliseconds, between subsequent firings. If 0, the timer is a "one-shot" timer. |
|
protectedpure virtual |
Callback.
This method is invoked each time the timer fires.
|
inline |
Get the initial delay, in milliseconds.
|
inline |
Get the interval, in milliseconds.
|
inline |
Determine if the timer is currently running.
|
inline |
Set the initial delay, in milliseconds.
The new value will take effect the next time the timer is started.
|
inline |
Set the interval, in milliseconds.
The new value will take effect the next time the timer is started.
| void start | ( | ) |
Start the timer.
| SystemException | If an error occurs while creating the timer. |
| void stop | ( | ) |
Stop the timer.