X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=senf%2FPPI%2FEventManager.cc;h=0b6a48263835396ccb8db46daf0138bc4b3d9034;hb=33d8f945cadcf912e8637a59d97ac1d1b320af9f;hp=be2dc76f7d6735cf0ea84e74877a5685afacf048;hpb=601d1f509f5bb24df167a4dd5a20da67a0af9af8;p=senf.git diff --git a/senf/PPI/EventManager.cc b/senf/PPI/EventManager.cc index be2dc76..0b6a482 100644 --- a/senf/PPI/EventManager.cc +++ b/senf/PPI/EventManager.cc @@ -28,6 +28,7 @@ // Custom includes #include +#include //#include "EventManager.mpp" #define prefix_ @@ -42,13 +43,20 @@ 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); +} + +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()); } ///////////////////////////////cc.e////////////////////////////////////////