Questions tagged [signals2]

The Boost.Signals2 library is an implementation of a managed signals and slots system.

The Boost.Signals2 library is an implementation of a managed signals and slots system. Signals represent callbacks with multiple targets, and are also called publishers or events in similar systems. Signals are connected to some set of slots, which are callback receivers (also called event targets or subscribers), which are called when the signal is "emitted."

Signals and slots are managed, in that signals and slots (or, more properly, objects that occur as part of the slots) can track connections and are capable of automatically disconnecting signal/slot connections when either is destroyed. This enables the user to make signal/slot connections without expending a great effort to manage the lifetimes of those connections with regard to the lifetimes of all objects involved.

When signals are connected to multiple slots, there is a question regarding the relationship between the return values of the slots and the return value of the signals. Boost.Signals2 allows the user to specify the manner in which multiple return values are combined.

More information on usage on latest official documentation page.

9 questions
3
votes
2 answers

Boost::signals2 passing invalid data

I've been a C/C++ developer for about 20 years now, but templates have always been a weak spot for me. With template programming becoming ever more useful, and complicated, in the C++11 and C++14 standards, I decided to try an exercise to learn. …
lk75
  • 61
  • 1
  • 7
2
votes
1 answer

Deleting calling signal from callback boost::signals c++

I have the following code that deletes the signal during one of the callbacks from the signal: #include #include struct Foo { boost::signals2::signal signal; }; std::vector
Sigmund Fraud
  • 173
  • 1
  • 7
1
vote
1 answer

boost::signals2: connect to a slot of a diffeent class

I am trying to use the boost::signals2 functionalities in my program. In my "Main Class" called "Solid" I have a member which I initialize inside the constructor body (so after the member initializer list) like this: pointer_M =…
Simon
  • 325
  • 1
  • 6
1
vote
0 answers

Boost::signals2 and const-ness

having some observable class, the way I naively use signals2 is to provide a member signal so that anybody can connect struct Observable { boost::signals2::signal aSignal; void foo() { //something happens …
Teloze
  • 279
  • 2
  • 8
1
vote
1 answer

boost signals2 - error when pass a slot to disconnect

I want to pass a slot to disconnect like in the boost signals2 documentation: Pass slot to disconnect: in this interface model, the disconnection of a slot connected with sig.connect(typeof(sig)::slot_type(slot_func)) is performed via…
Thomas Fischer
  • 540
  • 4
  • 16
1
vote
0 answers

signals2: signal with templatized parameter

I'm designing a base class for camera classes. The intent is to use a signal to notify the clients of a newly available image. Cameras may have 8- or 16-bit pixels. I'm trying to templatize them as follows: #include #include…
Mike C
  • 1,224
  • 10
  • 26
0
votes
1 answer

Boost Signal References Object Out of Scope?

typedef boost::signals2::signal signal_t; class AAA { public: void Connect(const signal_t::slot_type& subscriber) { return m_sig.connect(subscriber); } void FireSignal() { m_sig(); } private: signal_t sig; }; //…
Joseph
  • 3
  • 2
0
votes
0 answers

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

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…
BigBoss
  • 6,904
  • 2
  • 23
  • 38
-1
votes
1 answer

Access violation when using boost::signals2 and unloading DLLs

I'm trying to figure out this problem. Suppose, you have a code that uses boost::signals2 for communicating between objects. Lets call them "colorscales". Code for these colorscales is usually situated in the same DLL as the code that uses them.…
JustSomeGuy
  • 3,677
  • 1
  • 23
  • 31