void EventCtrl::addEventListener(EventSender * sender, void (*handler) (Event * event), void * listener, ConnectionType connectionType) { EventCtrl * ctrl; #ifndef MONO_THREAD ctrl = getEventCtrl(pthread_self()); #else ctrl = getEventCtrl(); #endif EventListenerList::iterator i; for (i = ctrl->listeners.begin(); i != ctrl->listeners.end(); i++) if ((i->sender == sender) && (i->handler == handler) && (i->listener == listener)) return; ctrl->listeners.push_back(EventListener(sender, handler, listener, connectionType)); }
HamService::HamService(EventDispatcher& event_dispatcher, const CmdPropertyMap& command_property_map) : BaseApplicationService(event_dispatcher) , command_property_map_(command_property_map) { event_dispatcher_.Connect(PreCommandExecuteEvent::type, EventListener(EventListenerType("HamService::handleSuccessfulObjectControllerCommand"), std::bind(&HamService::handlePreCommandExecuteEvent, this, std::placeholders::_1))); }