Esempio n. 1
0
void GlobalEvents::clearMap(GlobalEventMap& map)
{
	GlobalEventMap::iterator it;
	for(it = map.begin(); it != map.end(); ++it)
		delete it->second;

	map.clear();
}
Esempio n. 2
0
void GlobalEvents::clearMap(GlobalEventMap& map)
{
	for (const auto& it : map) {
		delete it.second;
	}
	map.clear();
}
Esempio n. 3
0
GlobalEventMap GlobalEvents::getEventMap(GlobalEvent_t type)
{
	// TODO: This should be better implemented. Maybe have a map for every type.
	switch (type) {
		case GLOBALEVENT_NONE: return thinkMap;
		case GLOBALEVENT_TIMER: return timerMap;
		case GLOBALEVENT_STARTUP:
		case GLOBALEVENT_SHUTDOWN:
		case GLOBALEVENT_RECORD: {
			GlobalEventMap retMap;
			for (const auto& it : serverMap) {
				if (it.second.getEventType() == type) {
					retMap.emplace(it.first, it.second);
				}
			}
			return retMap;
		}
		default: return GlobalEventMap();
	}
}
Esempio n. 4
0
void GlobalEvents::clearMap(GlobalEventMap& map)
{
	map.clear();
}