CompTimer Class Reference

A simple timer for use with invoking a CallBack during a timed duration. More...

#include <timer.h>

List of all members.

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


Detailed Description

A simple timer for use with invoking a CallBack during a timed duration.

Constructor & Destructor Documentation

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.


Member Function Documentation

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.


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

Generated on Wed Feb 2 22:44:14 2011 for Compiz by  doxygen 1.5.6