Return to Index

Timer

A timer class that provides evenly spaced timeout events to an application. The timeout period is specified in seconds using a floating point value for fractional parts of seconds. A timer can be a one-time timeout or can timeout repeatedly.


Object Events:
TimeoutAn event generated when the timeout happens.

Method Summary:
Timer::Timer();
void Timer::setOnlyOnce(bool once);
void Timer::setTimeout(double pSecs);
bool Timer::getOnlyOnce();
double Timer::getTimeout();
void Timer::start(double secs, bool once);
void Timer::stop();
bool Timer::isRunning();



Timer::Timer
Timer::Timer();

Constructs a new timer.

void Timer::setOnlyOnce
void Timer::setOnlyOnce(bool once);

Sets whether the timeout happens once or repeatedly, and starts the timer.
Parameters:
bool onceTrue for single timeout, false for repeated ones.

void Timer::setTimeout
void Timer::setTimeout(double pSecs);

Sets the timeout period and starts the timer.
Parameters:
double pSecsThe timeout in seconds.

bool Timer::getOnlyOnce
bool Timer::getOnlyOnce();

Returns whether the timer is a single-shot type or not.

double Timer::getTimeout
double Timer::getTimeout();

Returns whether the timeout value in seconds

void Timer::start
void Timer::start(double secs, bool once);

Starts the timer with the specified values.
Parameters:
double secsThe timeout in seconds.
bool onceWhether to cause a single timeout or repeated ones.

void Timer::stop
void Timer::stop();

Stops the timer.

bool Timer::isRunning
bool Timer::isRunning();

Returns whether the timer is currently running.


Generated automatically by docgen 0.0.1
© 2003 Aron Dobos