IntervalTimer Class Reference

A high-precision interval timer that does not require blocking or polling from a dedicated thread. More...

#include <IntervalTimer.h++>

List of all members.

Public Member Functions

virtual ~IntervalTimer () throw ()
 Destructor.
void start () throw (SystemException)
 Start the timer.
void stop () throw ()
 Stop the timer.
uint_t getInitialDelay () const throw ()
 Get the initial delay, in milliseconds.
void setInitialDelay (uint_t initialDelay) throw ()
 Set the initial delay, in milliseconds.
uint_t getInterval () const throw ()
 Get the interval, in milliseconds.
void setInterval (uint_t interval) throw ()
 Set the interval, in milliseconds.
bool isRunning () const throw ()
 Determine if the timer is currently running.

Protected Member Functions

 IntervalTimer (uint_t initialDelay, uint_t interval=0)
 Construct a new IntervalTimer with the given initial delay and interval.
virtual void fired ()=0
 Callback.


Detailed Description

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.

Author:
Mark Lindner

Constructor & Destructor Documentation

~IntervalTimer (  )  throw () [virtual]

Destructor.

IntervalTimer ( uint_t  initialDelay,
uint_t  interval = 0 
) [protected]

Construct a new IntervalTimer with the given initial delay and interval.

Parameters:
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.


Member Function Documentation

virtual void fired (  )  [protected, pure virtual]

Callback.

This method is invoked each time the timer fires.

uint_t getInitialDelay (  )  const throw () [inline]

Get the initial delay, in milliseconds.

uint_t getInterval (  )  const throw () [inline]

Get the interval, in milliseconds.

bool isRunning (  )  const throw () [inline]

Determine if the timer is currently running.

void setInitialDelay ( uint_t  initialDelay  )  throw () [inline]

Set the initial delay, in milliseconds.

The new value will take effect the next time the timer is started.

void setInterval ( uint_t  interval  )  throw () [inline]

Set the interval, in milliseconds.

The new value will take effect the next time the timer is started.

void start (  )  throw (SystemException)

Start the timer.

Exceptions:
SystemException If an error occurs while creating the timer.

void stop (  )  throw ()

Stop the timer.


The documentation for this class was generated from the following files:

Generated on Sat Apr 17 23:03:08 2010 for libcommonc++ by  doxygen 1.5.9