EventManager Class Reference

The Event Manager is the central interface point to all event related functions of this program. More...

Inheritance diagram for EventManager:

Inheritance graph
[legend]
Collaboration diagram for EventManager:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 EventManager ()
 Constructor.
 ~EventManager ()
 Deconstructor.
void init ()
 Initialises the EventManager.
void clear ()
 Clears the EventManager.
void grab ()
 Increases the reference counter.
void drop ()
 Decreases the reference counter.
bool createEventGroup (const std::string &groupName)
 Creates a new event group, a collection of events.
bool createEventSlot (const std::string &groupName, const std::string &slotName)
 Creates a new event slot in the given event group.
template<typename T >
bool connectEventSignal (const std::string &groupName, const std::string &slotName, T *t, void(T::*m)(void *))
 Connects a function to the given event slot.
template<typename T >
bool disconnectEventSignal (const std::string &groupName, const std::string &slotName, T *t)
 Disconnects a function from the given event slot.
bool emitEvent (const std::string &groupName, const std::string &slotName, void *p=0)
 Emits an event to the given event slot.
bool getIsKeyDown (EKEY_CODE keyCode) const
 Checks if the given key is down.
bool getIsKeyUp (EKEY_CODE keyCode) const
 Checks if the given key is up.
s32 getMouseX () const
 Returns the X-coordinate of the mouse position.
s32 getMouseY () const
 Returns the Y-coordinate of the mouse position.
const vector2di & getMousePos () const
 Returns the position of the mouse as a 2d vector.
f32 getMouseWheel () const
 Gets the mouse wheel position.
void removeEventGroups ()
 Removes all event groups from the EventManager.
bool removeEventSlots (const std::string &groupName)
 Removes all event slots from the given event group.
bool removeEventGroup (const std::string &groupName)
 Removes the given event group from the Event Manager.
bool removeEventSlot (const std::string &groupName, const std::string &slotName)
 Removes the given event slot from the given event group.
virtual bool OnEvent (const SEvent &event)
 Handles the events sent by the Irrlicht engine.


Detailed Description

The Event Manager is the central interface point to all event related functions of this program.

Definition at line 29 of file EventManager.h.


Constructor & Destructor Documentation

EventManager::EventManager (  ) 

Constructor.

Definition at line 23 of file EventManager.cpp.

EventManager::~EventManager (  ) 

Deconstructor.

Definition at line 29 of file EventManager.cpp.


Member Function Documentation

void EventManager::clear (  ) 

Clears the EventManager.

Definition at line 70 of file EventManager.cpp.

template<typename T >
bool EventManager::connectEventSignal ( const std::string &  groupName,
const std::string &  slotName,
T *  t,
void(T::*)(void *)  m 
) [inline]

Connects a function to the given event slot.

Parameters:
groupName Name of the event group.
slotName Name of the event slot.
t Pointer to the object that will function as this-object when the connect function is called.
m Pointer to the function.

Definition at line 70 of file EventManager.h.

bool EventManager::createEventGroup ( const std::string &  groupName  ) 

Creates a new event group, a collection of events.

Parameters:
groupName Name of the event group.
Returns:
True if creation was successful, false if creation was a failure.

Definition at line 238 of file EventManager.cpp.

bool EventManager::createEventSlot ( const std::string &  groupName,
const std::string &  slotName 
)

Creates a new event slot in the given event group.

Parameters:
groupName Name of the event group.
slotName Name of the event slot.
Returns:
True if creation was successful, false if creation was a failure.

Definition at line 255 of file EventManager.cpp.

template<typename T >
bool EventManager::disconnectEventSignal ( const std::string &  groupName,
const std::string &  slotName,
T *  t 
) [inline]

Disconnects a function from the given event slot.

Parameters:
groupName Name of the event group.
slotName Name of the event slot.
t Pointer to the object that will function as this-object when the connect function is called.

Definition at line 101 of file EventManager.h.

void EventManager::drop (  )  [virtual]

Decreases the reference counter.

Note:
This is a dummy function.

Reimplemented from ReferenceCounted.

Definition at line 232 of file EventManager.cpp.

bool EventManager::emitEvent ( const std::string &  groupName,
const std::string &  slotName,
void *  p = 0 
)

Emits an event to the given event slot.

Parameters:
groupName Name of the event group.
slotName Name of the event slot.
p Pointer to data which will be passed to all functions called.

Definition at line 280 of file EventManager.cpp.

bool EventManager::getIsKeyDown ( EKEY_CODE  keyCode  )  const

Checks if the given key is down.

Definition at line 305 of file EventManager.cpp.

bool EventManager::getIsKeyUp ( EKEY_CODE  keyCode  )  const

Checks if the given key is up.

Definition at line 311 of file EventManager.cpp.

const vector2di & EventManager::getMousePos (  )  const

Returns the position of the mouse as a 2d vector.

Definition at line 329 of file EventManager.cpp.

f32 EventManager::getMouseWheel (  )  const

Gets the mouse wheel position.

Definition at line 335 of file EventManager.cpp.

s32 EventManager::getMouseX (  )  const

Returns the X-coordinate of the mouse position.

Definition at line 317 of file EventManager.cpp.

s32 EventManager::getMouseY (  )  const

Returns the Y-coordinate of the mouse position.

Definition at line 323 of file EventManager.cpp.

void EventManager::grab (  )  [virtual]

Increases the reference counter.

Note:
This is a dummy function.

Reimplemented from ReferenceCounted.

Definition at line 226 of file EventManager.cpp.

void EventManager::init (  ) 

Initialises the EventManager.

Definition at line 35 of file EventManager.cpp.

bool EventManager::OnEvent ( const SEvent &  event  )  [virtual]

Handles the events sent by the Irrlicht engine.

Note:
For internal use only!

Definition at line 404 of file EventManager.cpp.

bool EventManager::removeEventGroup ( const std::string &  groupName  ) 

Removes the given event group from the Event Manager.

Parameters:
groupName Name of the event group to remove.
Returns:
True if removal was successful, false if removal was a failure.

Definition at line 366 of file EventManager.cpp.

void EventManager::removeEventGroups (  ) 

Removes all event groups from the EventManager.

Definition at line 342 of file EventManager.cpp.

bool EventManager::removeEventSlot ( const std::string &  groupName,
const std::string &  slotName 
)

Removes the given event slot from the given event group.

Parameters:
groupName Name of the event group.
slotName Name of the event slot to remove.
Returns:
True if removal was successful, false if removal was a failure.

Definition at line 381 of file EventManager.cpp.

bool EventManager::removeEventSlots ( const std::string &  groupName  ) 

Removes all event slots from the given event group.

Parameters:
groupName Name of the event group.
Returns:
True if removal was successful, false if removal was a failure.

Definition at line 349 of file EventManager.cpp.


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

Generated on Fri Aug 21 23:55:14 2009 for Sirrf - Simple Irrlicht Framework by  doxygen 1.5.8