Boost logo

Boost :

Subject: [boost] [signals2] Uncombined signal
From: Ivan Le Lann (ivan.lelann_at_[hidden])
Date: 2013-04-10 19:44:09


Hi,

I have a project where I use boost::signals2 in the spirit of the "Signal Return Values (Advanced)" section of the tutorial.
That is, I have signals roughly equivalent to :

boost::signals2::signal<float (), maximum<float> > sig; // slots produce values accumulated by the combiner

Problem comes when I want multiple combiners on the same slots. Especially combiners of different types :
You need to duplicate signals, and you need your connection setup code to know about used combiners.

IMHO, having a basic signal class with no combiner makes sense.
Attached is a POC patch to version 1.50, to add to boost::signals2::signal the method :

 slot_call_range all (BOOST_SIGNALS2_SIGNATURE_FULL_ARGS(BOOST_SIGNALS2_NUM_ARGS)) const

(in boost/signals2/detail/signal_template.hpp)

>From there, I think one could use any algorithm/accumulator directly on the signal.all() result.
Implementation left aside, any feedback on this ?

Regards,
Ivan




Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk