Questions tagged [boost-signals2]

The Boost.Signals2 library is a thread-safe C++ implementation of a managed signals and slots system.

The Boost.Signals2 library is a thread-safe C++ 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.

109 questions
0
votes
1 answer

Doxygen documentation of boost::signals2 function signature

like in the title: does anyone know how to properly write Doxygen documentation of the signature of a boost::signals2 /** * @brief aSignal * void : aVoidReturn * int : anInteger * doulbe : aDouble …
Teloze
  • 279
  • 2
  • 8
0
votes
0 answers

how to connect a member function to a boost signal

Is there a way to avoid the use of boost::bind to attach a member function to a boost::signal slot? The only way I can get it to work is to use bind like this: mysignal.connect(boost::bind(&myClass::listenerMember, this, _1, _2)); but I really want…
Jimbo
  • 85
  • 7
0
votes
1 answer

boost signal and slot not working in different thread (using boost::asio::io_service)

I have written a small test program to understand the signal and slot mechanism provided by boost and their behavior when posted in different thread. I want to have slot's being called in different threads but the output of my program shows slots…
abhiarora
  • 9,743
  • 5
  • 32
  • 57
0
votes
1 answer

Cast return value to templated type

I have the following template class. template class Event { public: typedef boost::signals2::signal signal_t; virtual R fire(const T& argument) { return…
Johan
  • 502
  • 4
  • 18
0
votes
0 answers

how can a class be changed to a function in C++?

template class signalN; // partial template specialization …
kwontwitch
  • 11
  • 1
0
votes
0 answers

Boost signals 2, custom combiner, why it triggers a copy

I have a program making use of boost::signals2. I need to return a non-copyable value. In order to achieve this, I tried to change the combiner template parameter. The curious thing about this is that inside the combiner I get an error. This…
Germán Diago
  • 7,473
  • 1
  • 36
  • 59
0
votes
0 answers

Boost::signals2 blocking multiple slots

Say I want to implement a signal system based on ordered slots and I would also be able to block the connection toward a function. To be more clear: Case Full Connection: mysignal("string","string") this connects to both functions. Case Selected:…
Podarce
  • 473
  • 1
  • 6
  • 22
0
votes
0 answers

Signals instead of exceptions

Let's suppose we are developing a store, and, depending on the session state, the user is allowed to do different things. For example, suppose a widget must be blocked during a while in some specific moment, because some specific user actions, and…
ABu
  • 10,423
  • 6
  • 52
  • 103
0
votes
1 answer

Boost Signals2: How do I register events such as mouse clicks and key presses?

I'm working on a game at the moment, and I'm planning on using the signals2 library for event handling in C++. However, I don't understand how it all fits together, as I'm wanting to have events such as "on key press" and "on mouse click", as well…
Taliyah
  • 3
  • 1
  • 2
0
votes
1 answer

boost::signal2 bind to pure or member function using enable_if

I am currently trying to implement a member function of a class which allows for setting a callback that is either itself a member function (of a potentially different class) or a pure function not being part of a class. Given such a class, #include…
gilgamash
  • 862
  • 10
  • 31
0
votes
1 answer

How can I prevent signals2::scoped_connection from aborting in disconnect()?

I'm using boost::signals2 and have a connection management issue. I'm storing scoped_connections in a list that is later pruned. However, I have found that if the object owning the associated signal has been destroyed,…
pelotron
  • 95
  • 3
  • 13
0
votes
1 answer

How do I get boost.msm to properly change state when using a signal handler to trigger events?

My (boost.msm) state machine appears to 'roll-back' when using signal handlers to trigger events. However, when I use direct calls to trigger events the state machine behaves correctly. I looked in the boost documentation and searched the web, but…
mikero
  • 134
  • 8
0
votes
0 answers

Upgrade to boost::signals2 in VS2013 results in C4996 warnings

From the following compiler warning message in VS2013: CL : warning : Boost.Signals is no longer being maintained and is now deprecated. Please switch to Boost.Signals2. To disable this warning message, define…
David Carr
  • 400
  • 4
  • 7
0
votes
1 answer

Error when boost signals2 connect with void() bound

When I try to compile this code I get the error In constructor 'Foo::Foo()': 15:40: error: 'bind' was not declared in this scope #include #include class Foo { public: Foo(); void slot1(int i); void…
Thomas Fischer
  • 540
  • 4
  • 16
0
votes
1 answer

Boost signals2 giving noncopyable errors

I'm currently working on a C++ application where I need to create a module that sends boost signals to another class. I'm using the Document-View example as a basis for my application…