Extracting a boost::function from a boost::signals2::signal

Hello, I would like to create an "Interceptor" class that can generically receive a void-returning signal with n arguments (as something like a boost::function<void()>) and, at runtime, decide whether the signal will be delivered to the final slot. Or perhaps even deliver the signal at some later time. Psuedocode might look like this: class Interceptor { template<class Signal> void Connect(Signal& signal, const Signal::slot_type& slot) { signal.connect_generic(slot, bind(&Interceptor::Dispatch, this, _1)); } void Dispatch(const boost::function<void()>& Function) { if (DispatchNow()) { Function(); } else if (DispatchLater()) { DispatchLater.push_back(Function); } } }; Is such a thing possible? Thank you, Chris
participants (1)
-
Chris Stankevitz