[signals] Chaining signals
13 Mar
2009
13 Mar
'09
4:32 p.m.
Hi, Is it possible to 'chain' boost signals? I.e., connect signal a to signal b, such that whenever signal a fires, all slots of signal b are called. thanks, Remko
13 Mar
13 Mar
5:33 p.m.
Remko Tronçon wrote:
Is it possible to 'chain' boost signals? I.e., connect signal a to signal b, such that whenever signal a fires, all slots of signal b are called.
#include <boost/signals.hpp> #include <boost/bind.hpp> #include <iostream> void gotit() { std::cout << "Received the signal\n"; } int main(int argc, char *argv[]) { typedef boost::signal<void()> signal_type; signal_type first; signal_type second; first.connect(boost::bind(boost::ref(second))); second.connect(boost::bind(gotit)); first(); return 0; }
5670
Age (days ago)
5670
Last active (days ago)
2 comments
2 participants
participants (2)
-
Nat Goodspeed
-
Remko Tronçon