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

MCEventListener Class Reference

Base class for event listeners. More...

#include <mcllib/MCEventListener.h>

Inheritance diagram for MCEventListener:

MCRefCount MCThreadListener List of all members.

Public Member Functions

virtual void handleEvent (const MCEvent &event)=0
 Interface to EventListeners.
virtual ~MCEventListener ()
 Allow virtual delete.

Detailed Description

Base class for event listeners.

The event listeners handleEvent() method is called when an event is notified via the MCEvent::notify() method. The handleEvent method is guaranteed to be called once per call to the notify() method. It is safe to call the static MCEvent methods dealing with event and listener registration while in the handleEvent method.

Member Function Documentation

virtual void handleEvent const MCEvent event  )  [pure virtual]

Interface to EventListeners.

The implementation must override the handleEvent function. The framework calls handleEvent with the event that occured. The event may contain additional data other than the event id. Because a single listener may be registered for different events, it is recommended that the handleEvent() method obtains the eventId from the event before deciding what action to take.

The static MCEvent methods dealing with event registration and listener add/remove can be safely called from the handleEvent() method.

event the event which occured

Generated on Wed Jan 12 19:05:49 2005 for MCLLIB by  doxygen