# Home    # nevrax.com   
Nevrax
Nevrax.org
#News
#Mailing-list
#Documentation
#CVS
#Bugs
#License
Docs
 
Documentation  
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Search  

NLMISC::CEventServer Class Reference

CEventServer. More...

#include <event_server.h>

List of all members.

Public Methods

virtual ~CEventServer ()
void postEvent (CEvent *event)
 add event to the list. More...

void pump ()
 get call every callbacks associated with event id. More...

void addListener (CClassId id, IEventListener *listener)
 Add a callback (associated with an id). More...

void removeListener (CClassId id, IEventListener *listener)
 Remove a callback. More...

void addEmitter (IEventEmitter *emitter)
 Add an Emitter to the server. More...

void removeEmitter (IEventEmitter *emitter)
 Remove an Emitter from the server. More...


Protected Methods

virtual bool pumpEvent (CEvent *event)
 call every callbacks associated with event id. More...


Private Attributes

mapListener _Listeners
std::list< IEventEmitter * > _Emitters
std::list< CEvent * > _Events


Detailed Description

CEventServer.

Author:
Stephane Coutelas , Nevrax France
Date:
2000

Definition at line 52 of file event_server.h.


Constructor & Destructor Documentation

virtual NLMISC::CEventServer::~CEventServer   [inline, virtual]
 

Definition at line 59 of file event_server.h.


Member Function Documentation

void NLMISC::CEventServer::addEmitter IEventEmitter   emitter
 

Add an Emitter to the server.

Parameters:
emitter 

Definition at line 135 of file event_server.cpp.

References _Emitters.

Referenced by NL3D::CDriverUser::setDisplay.

void NLMISC::CEventServer::addListener CClassId    id,
IEventListener   listener
 

Add a callback (associated with an id).

Parameters:
id  of the CEvent class to hook
listener  to use with this event

Definition at line 104 of file event_server.cpp.

References _Listeners, and id.

void NLMISC::CEventServer::postEvent CEvent   event
 

add event to the list.

Parameters:
event 

Definition at line 41 of file event_server.cpp.

References _Events.

void NLMISC::CEventServer::pump  
 

get call every callbacks associated with event id.

Parameters:
event 

Definition at line 51 of file event_server.cpp.

References _Emitters, _Events, and pumpEvent.

bool NLMISC::CEventServer::pumpEvent CEvent   event [protected, virtual]
 

call every callbacks associated with event id.

Parameters:
event 
Returns:
true if the pointer must be delete, false if it not. (post to another message queue...)

Definition at line 80 of file event_server.cpp.

References _Listeners, and id.

Referenced by pump.

void NLMISC::CEventServer::removeEmitter IEventEmitter   emitter
 

Remove an Emitter from the server.

Parameters:
emitter 

Definition at line 144 of file event_server.cpp.

References _Emitters.

Referenced by NL3D::CDriverUser::release.

void NLMISC::CEventServer::removeListener CClassId    id,
IEventListener   listener
 

Remove a callback.

Parameters:
id  of event's callback
listener  to be removed

Definition at line 113 of file event_server.cpp.

References _Listeners, and id.


Member Data Documentation

std::list<IEventEmitter*> NLMISC::CEventServer::_Emitters [private]
 

Definition at line 55 of file event_server.h.

Referenced by addEmitter, pump, and removeEmitter.

std::list<CEvent*> NLMISC::CEventServer::_Events [private]
 

Definition at line 56 of file event_server.h.

Referenced by postEvent, and pump.

mapListener NLMISC::CEventServer::_Listeners [private]
 

Definition at line 54 of file event_server.h.

Referenced by addListener, pumpEvent, and removeListener.


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