EventManager Class Reference

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

List of all members.

Public Member Functions

 EventManager ()
 Constructor.
 ~EventManager ()
 Deconstructor.
void init ()
 Initialises the EventManager.
void clear ()
 Clears the EventManager.
void refAdd ()
 Increases the reference counter.
void refRelease ()
 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, void(T::*m)(void *))
 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 removeAllEventGroups ()
 Removes all event groups from the EventManager.
bool removeAllEventSlots (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 28 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 67 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 69 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 235 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 252 of file EventManager.cpp.

template<typename T >
bool EventManager::disconnectEventSignal ( const std::string &  groupName,
const std::string &  slotName,
T *  t,
void(T::*)(void *)  m 
) [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.
m Pointer to the function.

Definition at line 101 of file EventManager.h.

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 277 of file EventManager.cpp.

bool EventManager::getIsKeyDown ( EKEY_CODE  keyCode  )  const

Checks if the given key is down.

Definition at line 302 of file EventManager.cpp.

bool EventManager::getIsKeyUp ( EKEY_CODE  keyCode  )  const

Checks if the given key is up.

Definition at line 308 of file EventManager.cpp.

const vector2di & EventManager::getMousePos (  )  const

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

Definition at line 326 of file EventManager.cpp.

f32 EventManager::getMouseWheel (  )  const

Gets the mouse wheel position.

Definition at line 332 of file EventManager.cpp.

s32 EventManager::getMouseX (  )  const

Returns the X-coordinate of the mouse position.

Definition at line 314 of file EventManager.cpp.

s32 EventManager::getMouseY (  )  const

Returns the Y-coordinate of the mouse position.

Definition at line 320 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 401 of file EventManager.cpp.

void EventManager::refAdd (  ) 

Increases the reference counter.

Note:
For internal use only!

Definition at line 223 of file EventManager.cpp.

void EventManager::refRelease (  ) 

Decreases the reference counter.

Note:
For internal use only!

Definition at line 229 of file EventManager.cpp.

void EventManager::removeAllEventGroups (  ) 

Removes all event groups from the EventManager.

Definition at line 339 of file EventManager.cpp.

bool EventManager::removeAllEventSlots ( 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 346 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 363 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.

Definition at line 378 of file EventManager.cpp.


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

Generated on Wed Jun 10 22:26:25 2009 for Sirrf - Simple Irrlicht Framework by  doxygen 1.5.8