X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=senf%2FPPI%2FEventManager.cc;h=c07f3688e3f74c35b514f0d76f22995bcb8c895c;hb=93d9568d448749dc187e7622b733a4a3caa319df;hp=be2dc76f7d6735cf0ea84e74877a5685afacf048;hpb=601d1f509f5bb24df167a4dd5a20da67a0af9af8;p=senf.git diff --git a/senf/PPI/EventManager.cc b/senf/PPI/EventManager.cc index be2dc76..c07f368 100644 --- a/senf/PPI/EventManager.cc +++ b/senf/PPI/EventManager.cc @@ -28,30 +28,39 @@ // Custom includes #include +#include //#include "EventManager.mpp" #define prefix_ -///////////////////////////////cc.p//////////////////////////////////////// +//-///////////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////// +//-///////////////////////////////////////////////////////////////////////////////////////////////// // senf::ppi::EventManager -//////////////////////////////////////// +//-///////////////////////////////////////////////////////////////////////////////////////////////// // private members prefix_ void senf::ppi::EventManager::destroyModule(module::Module & module) { using boost::lambda::_1; + namespace l = boost::lambda; - // boost::ptr_vector::erase(f,l) asserts !empty() .. why ?? - if (!registrations_.empty()) - registrations_.erase( - std::remove_if(registrations_.begin(), registrations_.end(), - ((&_1) ->* & detail::EventBindingBase::module_) == & module), - registrations_.end()); + registrations_.erase_if(l::bind(&detail::EventBindingBase::module_,_1) == &module); } -///////////////////////////////cc.e//////////////////////////////////////// +prefix_ void senf::ppi::EventManager::destroyEvent(EventDescriptor & event) +{ + using boost::lambda::_1; + namespace l = boost::lambda; + + SENF_ASSERT( + std::find_if(registrations_.begin(), registrations_.end(), + l::bind(&detail::EventBindingBase::descriptor_,_1) == &event) + == registrations_.end(), + "Internal failure: registrations still active while destroying event ??"); +} + +//-///////////////////////////////////////////////////////////////////////////////////////////////// #undef prefix_ //#include "EventManager.mpp"