Pixel Dust Game Engine  v0.9.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups
Public Member Functions | Friends | List of all members
EventManager Class Reference
Inheritance diagram for EventManager:
Inheritance graph
[legend]
Collaboration diagram for EventManager:
Collaboration graph
[legend]

Public Member Functions

virtual void clear (bool doRelease=true)
 remove all handlers and also removes unprocessed enqueued events
 
virtual void blockEvent (long inEventType)
 temporarily ignore all events of a particular type, just drop them on the floor
 
virtual void unblockEvent (long inEventType)
 stop ignoring events of a particular type, no recovery of previously ignored events
 
virtual bool postEvent (long inEventType, void *inEventData, EventEmitter *fromEmitter=0)
 post an event for handling, you probably don't need to do this directly
 
virtual bool postEventToEmitter (long inEventType, void *inEventData, EventEmitter *toEmitter)
 post an event for handling but give another emitter first chance at handing it
 
void enqueueEvent (long inEventType, UserData *inEventData, EventEmitter *inEmitter)
 mutexed for posting events between threads, makes copy of the data
 
bool getQueuedEvent (long &outEventType, UserData *&outEventData, EventEmitter *&outEmitter)
 returns false when there are no more events in the queue
 
- Public Member Functions inherited from EventEmitter
virtual void addHandler (IEventHandler *inHandler, long inType=all_events)
 add a new handler for some event type, or for all events if no type specified
 
virtual void removeHandler (IEventHandler *inHandler, long inType=all_events)
 Remove a handler for some event type, or for all events if no type specified.
 
 EventEmitter ()
 constructor for new event emitter
 
- Public Member Functions inherited from Singleton< EventManager >
 Singleton ()
 
virtual ~Singleton ()
 

Friends

class Singleton< EventManager >
 

Additional Inherited Members

- Static Public Member Functions inherited from Singleton< EventManager >
static EventManagergetSingletonInstance ()
 
static bool hasInstance ()
 
static EventManagerinstance ()
 
static void setInstance (EventManager *i)
 
static EventManagercreateSingletonInstance ()
 

Detailed Description

Distributes events to event handlers. The EventManager is the core of the Pixel Dust Games Framework. All inputs to your game arrive as events via the Event Manager. This includes network messages and system level notifications in addition to user inputs such as keystrokes and mouse movements.
The EventManager expects the game developer to implement IEventHandler subclasses and register them to handle various events they are interested in.

See Also
IEventHandler

Member Function Documentation

virtual void blockEvent ( long  inEventType)
virtual

temporarily ignore all events of a particular type, just drop them on the floor

Reimplemented from EventEmitter.

virtual void clear ( bool  doRelease = true)
virtual

remove all handlers and also removes unprocessed enqueued events

Reimplemented from EventEmitter.

void enqueueEvent ( long  inEventType,
UserData inEventData,
EventEmitter inEmitter 
)

mutexed for posting events between threads, makes copy of the data

bool getQueuedEvent ( long &  outEventType,
UserData *&  outEventData,
EventEmitter *&  outEmitter 
)

returns false when there are no more events in the queue

mutexed for posting events between threads, must call std::free() on the data

virtual bool postEvent ( long  inEventType,
void *  inEventData,
EventEmitter fromEmitter = 0 
)
virtual

post an event for handling, you probably don't need to do this directly

Reimplemented from EventEmitter.

virtual bool postEventToEmitter ( long  inEventType,
void *  inEventData,
EventEmitter toEmitter 
)
virtual

post an event for handling but give another emitter first chance at handing it

virtual void unblockEvent ( long  inEventType)
virtual

stop ignoring events of a particular type, no recovery of previously ignored events

Reimplemented from EventEmitter.

Friends And Related Function Documentation

friend class Singleton< EventManager >
friend