#include <EventConnectionManager.h>
Public Member Functions | |
| ~EventConnectionManager () | |
| void | AddHandler (const tHashValue eventType, tEventHandler handler) |
| void | RemoveHandler (const tHashValue eventType) |
| void | AddConnection (const tHashValue eventType, tEventConnection connection) |
Private Types | |
| typedef std::map< const tHashValue, tEventConnection > | tEventConnectionMap |
| typedef std::pair< const tHashValue, tEventConnection > | tEventConnectionMapPair |
Private Attributes | |
| tEventConnectionMap | mMap |
Definition at line 43 of file EventConnectionManager.h.
typedef std::map< const tHashValue, tEventConnection > pcce::EventConnectionManager::tEventConnectionMap [private] |
Definition at line 53 of file EventConnectionManager.h.
typedef std::pair< const tHashValue, tEventConnection > pcce::EventConnectionManager::tEventConnectionMapPair [private] |
Definition at line 54 of file EventConnectionManager.h.
| EventConnectionManager::~EventConnectionManager | ( | ) |
Definition at line 39 of file EventConnectionManager.cpp.
References mMap.
00039 { 00040 for (tEventConnectionMap::const_iterator i = mMap.begin(); i != mMap.end(); ++i) { 00041 i->second.disconnect(); 00042 } 00043 }
| void EventConnectionManager::AddHandler | ( | const tHashValue | eventType, | |
| tEventHandler | handler | |||
| ) |
Definition at line 45 of file EventConnectionManager.cpp.
References pcce::Singleton< T >::Get(), mMap, and PCCE_CHECK.
Referenced by pcce::RenderSubSystem::vInitialize(), and pcce::InputSubSystem::vInitialize().
00045 { 00046 tEventConnectionMap::iterator i = mMap.find(eventType); 00047 PCCE_CHECK( 00048 i == mMap.end(), "EventConnectionManager::AddHandler: Already registered for event type"); 00049 tEventConnection connection = EventSystemSingleton::Get()->AddHandler(eventType, handler); 00050 mMap.insert(i, tEventConnectionMapPair(eventType, connection)); 00051 }
| void EventConnectionManager::RemoveHandler | ( | const tHashValue | eventType | ) |
Definition at line 53 of file EventConnectionManager.cpp.
References mMap.
Referenced by pcce::RenderSubSystem::vShutdown().
00053 { 00054 tEventConnectionMap::iterator i = mMap.find(eventType); 00055 if (i != mMap.end()) { 00056 i->second.disconnect(); 00057 mMap.erase(i); 00058 } 00059 }
| void EventConnectionManager::AddConnection | ( | const tHashValue | eventType, | |
| tEventConnection | connection | |||
| ) |
Definition at line 61 of file EventConnectionManager.cpp.
References mMap, and PCCE_CHECK.
00061 { 00062 tEventConnectionMap::iterator i = mMap.find(eventType); 00063 PCCE_CHECK( 00064 i == mMap.end(), "EventConnectionManager::AddConnection: Already registered for event type"); 00065 mMap.insert(i, tEventConnectionMapPair(eventType, connection)); 00066 }
Definition at line 56 of file EventConnectionManager.h.
Referenced by AddConnection(), AddHandler(), RemoveHandler(), and ~EventConnectionManager().
1.5.5