Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

Timer Class Reference

List of all members.

Detailed Description

An object that may be attached to an event loop to cause its fire() method to be called at a particular time.


Public Methods

 Timer (IOEventLoop &loop, Time when=Time::none())
 Constructor.

virtual ~Timer ()
 Destructor.

void arm (Time when)
 Arms the Timer for a particular point in time.

void disarm ()
 Disarms the Timer.

bool is_armed ()
 Returns true if the Timer is armed.

Time get_when ()
 Returns the time that the Timer will fire (or Time::none()) if unarmed.


Protected Methods

virtual void fire ()=0
 Invoked by the event loop when the Timer fires.


Friends

class IOEventLoop


Constructor & Destructor Documentation

Timer::Timer IOEventLoop   loop,
Time    when = Time::none()
 

Constructor.

virtual Timer::~Timer   [virtual]
 

Destructor.


Member Function Documentation

void Timer::arm Time    when
 

Arms the Timer for a particular point in time.

To disarm the Timer, use arm(Time::none()). To arm the Timer for 1 millisecond in the future, use arm(Time::now() + Time::msec(1)).

void Timer::disarm  
 

Disarms the Timer.

virtual void Timer::fire   [protected, pure virtual]
 

Invoked by the event loop when the Timer fires.

Time Timer::get_when  
 

Returns the time that the Timer will fire (or Time::none()) if unarmed.

bool Timer::is_armed  
 

Returns true if the Timer is armed.


Friends And Related Function Documentation

friend class IOEventLoop [friend]
 


The documentation for this class was generated from the following file:
Generated on Fri Dec 20 13:35:11 2002 for NMSTL