8 #ifndef EVENTDISPATCHER_H_
9 #define EVENTDISPATCHER_H_
34 : _dispatcher(dispatcher) { };
36 virtual ~EventProcessorImpl() { };
38 void process(
const Event *evt)
41 for (std::list<EventReceiver*>::iterator iter = _dispatcher._receivers.begin();
42 iter != _dispatcher._receivers.end(); ++iter)
48 _dispatcher._stat_count++;
62 void _raise(
Event *evt)
64 _processor.process(evt);
71 void _queue(
Event *evt)
79 _receivers.push_back(receiver);
84 for (std::list<EventReceiver*>::iterator iter = _receivers.begin(); iter != _receivers.end(); ++iter)
86 if ((*iter) == receiver)
88 _receivers.erase(iter);
106 instance()._raise(evt);
113 instance()._queue(evt);
117 instance()._add(receiver);
121 instance()._remove(receiver);
129 return instance()._stat_count;
134 std::list<EventReceiver*> _receivers;
135 EventProcessorImpl _processor;