HasEvents Class Reference

This class provides a base for classes that need a decentralized event system. By deriving from this class, the derived class gains all needed methods for the management of a decentralized event system. More...

Inheritance diagram for HasEvents:

Inheritance graph
[legend]

List of all members.

Public Member Functions

 HasEvents ()
 Constructor.
virtual ~HasEvents ()
 Deconstructor.
bool createEventSlot (const std::string &slotName)
 Creates a new event slot.
template<typename T >
bool connectEventSignal (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 &slotName, T *t)
 Disconnects a function from the given event slot.
bool emitEvent (const std::string &slotName, void *p=0)
 Emits an event to the given event slot.
void removeEventSlots ()
 Removes all event slots.
bool removeEventSlot (const std::string &slotName)
 Removes the given event slot.


Detailed Description

This class provides a base for classes that need a decentralized event system. By deriving from this class, the derived class gains all needed methods for the management of a decentralized event system.

Definition at line 28 of file HasEvents.h.


Constructor & Destructor Documentation

HasEvents::HasEvents (  ) 

Constructor.

Definition at line 25 of file HasEvents.cpp.

HasEvents::~HasEvents (  )  [virtual]

Deconstructor.

Definition at line 30 of file HasEvents.cpp.


Member Function Documentation

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

Connects a function to the given event slot.

Parameters:
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 50 of file HasEvents.h.

bool HasEvents::createEventSlot ( const std::string &  slotName  ) 

Creates a new event slot.

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

Definition at line 36 of file HasEvents.cpp.

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

Disconnects a function from the given event slot.

Parameters:
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 70 of file HasEvents.h.

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

Emits an event to the given event slot.

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

Definition at line 52 of file HasEvents.cpp.

bool HasEvents::removeEventSlot ( const std::string &  slotName  ) 

Removes the given event slot.

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

Definition at line 74 of file HasEvents.cpp.

void HasEvents::removeEventSlots (  ) 

Removes all event slots.

Definition at line 68 of file HasEvents.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