Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

CODEX_Events::DelayedEvent Class Reference

Special type of event used to delay another event. More...

#include <DelayedEvent.h>

Inheritance diagram for CODEX_Events::DelayedEvent:

Inheritance graph
[legend]
Collaboration diagram for CODEX_Events::DelayedEvent:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 DelayedEvent (EventBase *evt)
 Object constructor.
virtual ~DelayedEvent ()
 Virtual destructor.
bool handle ()
 Handle the event.
Activitysource ()
 The Activity that created this event.

Static Public Attributes

static long int sDelay
 Number of seconds to delay.
static long int usDelay
 Number of milliseconds to delay.

Protected Attributes

Activitym_source
 Source of this event.

Detailed Description

Special type of event used to delay another event.

This class enables event delays based on the wall clock. Given another EventBase object, a DelayedEvent will wait until a specified amount of time has elapsed before handling the internal event. The delay is the same for all DelayEvent%s, and is configured through static members sDelay and usDelay.

Definition at line 38 of file DelayedEvent.h.


Constructor & Destructor Documentation

CODEX_Events::DelayedEvent::DelayedEvent EventBase evt  )  [inline]
 

Object constructor.

Parameters:
evt Another event, which will be dispatched when the specified duration has elapsed.

Definition at line 46 of file DelayedEvent.h.


Member Function Documentation

bool CODEX_Events::DelayedEvent::handle  )  [inline, virtual]
 

Handle the event.

This behaves differently than most of the implementations of EventBase::handle(). Rather than calling an appropriate Activity%'s handler, this method checks the age of the event. If the age is greater than or equal to the specified delay, the internally-held event is dispatched through its EventBase::handle() method. If not, the event is returned to the queue.

Returns:
Whether the event has been successfully handled. This is dependent both on the aging and the handling of the internal event.

Implements CODEX_Events::EventBase.

Definition at line 74 of file DelayedEvent.h.

References CODEX_Events::EventBase::handle(), sDelay, and usDelay.


The documentation for this class was generated from the following files:
Generated on Fri May 6 17:42:02 2005 for COrnell Data EXchange (CODEX) by  doxygen 1.4.1