Execute a code when a callback disconnect from boost::signals2::signal

470 views Asked by At

Short: Is there any way that I execute a code when a callback that connected using connect disconnected?

Long: I have a class with multiple callbacks that are expensive and I want to only generate callbacks for those that interested by user:

boost::signals2::connection bind_to_signal(signal_code code, signal_signature const& fn)
{
    start_callback(code);
    return signal_[code].connect(fn);
}

Now I want to execute stop_callback when all callbacks that bound to a signal disconnected.

0

There are 0 answers