#include <timer.h>
Public Types | |
typedef boost::function< bool()> | CallBack |
Public Member Functions | |
CompTimer () | |
Empty constructor setting everything to zero and NULL. | |
~CompTimer () | |
Frees the private data for this timer and any information about it's context. | |
bool | active () |
Checks if this timer is active and will have it's CallBack invoked. | |
unsigned int | minTime () |
unsigned int | maxTime () |
unsigned int | minLeft () |
unsigned int | maxLeft () |
void | setTimes (unsigned int min, unsigned int max=0) |
Sets the timing durations of this timer. | |
void | setCallback (CallBack callback) |
Sets the callback function to invoke for this timer. | |
void | start () |
Starts this timer without modifying any of it's parameters. | |
void | start (unsigned int min, unsigned int max=0) |
Starts this timer setting the paramters with setTimes(). | |
void | start (CallBack callback, unsigned int min, unsigned int max=0) |
Starts this timer setting the parameters with setTimes() and setCallback(). | |
void | stop () |
Stops this timer. | |
Friends | |
class | CompScreen |
CompTimer::CompTimer | ( | ) |
Empty constructor setting everything to zero and NULL.
CompTimer::~CompTimer | ( | ) |
Frees the private data for this timer and any information about it's context.
bool CompTimer::active | ( | ) |
Checks if this timer is active and will have it's CallBack invoked.
void CompTimer::setTimes | ( | unsigned int | min, | |
unsigned int | max = 0 | |||
) |
Sets the timing durations of this timer.
void CompTimer::setCallback | ( | CallBack | callback | ) |
Sets the callback function to invoke for this timer.
This defaults to NULL.
void CompTimer::start | ( | ) |
Starts this timer without modifying any of it's parameters.
The timer is stop()'d before this occurs.
void CompTimer::start | ( | unsigned int | min, | |
unsigned int | max = 0 | |||
) |
Starts this timer setting the paramters with setTimes().
The timer is stop()'d before this occurs.
void CompTimer::start | ( | CallBack | callback, | |
unsigned int | min, | |||
unsigned int | max = 0 | |||
) |
Starts this timer setting the parameters with setTimes() and setCallback().
The timer is stop()'d before this occurs.
void CompTimer::stop | ( | ) |
Stops this timer.
After this the timer should not be active() and it's CallBack shouldn't be invoked.