void EventManager::DoEvent(typeEventID theEventID,void* theContext) { std::map<const typeEventID, IEvent*>::const_iterator anIter = mList.find(theEventID); if (anIter != mList.end()) { // Get the event to execute IEvent* anEvent = anIter->second; // Now call DoEvent for this event with theContext provided anEvent->DoEvent(theContext); } }
void EventManager::DoEvents(void* theContext) { std::map<const typeEventID, IEvent*>::const_iterator anIter = mList.begin(); while(anIter != mList.end()) { // Get the event to execute IEvent* anEvent = anIter->second; // Iterate to the next event anIter++; // Now call DoEvent for this event with theContext provided anEvent->DoEvent(theContext); } }