boost-signals

Can I create a software watchdog timer thread in C++ using Boost Signals2 and Threads?

北城余情 提交于 2019-11-27 23:06:07
I am running function Foo from somebody else's library in a single-threaded application currently. Most of the time, I make a call to Foo and it's really quick, some times, I make a call to Foo and it takes forever. I am not a patient man, if Foo is going to take forever, I want to stop execution of Foo and not call it with those arguments. What is the best way to call Foo in a controlled manner (my current environment is POSIX/C++) such that I can stop execution after a certain number of seconds. I feel like the right thing to do here is to create a second thread to call Foo, while in my main

Can Qt signals return a value?

吃可爱长大的小学妹 提交于 2019-11-27 13:00:25
Boost.Signals allows various strategies of using the return values of slots to form the return value of the signal. E.g. adding them, forming a vector out of them, or returning the last one. The common wisdom (expressed in the Qt documentation [EDIT: as well as some answers to this question ] ) is that no such thing is possible with Qt signals. However, when I run the moc on the following class definition: class Object : public QObject { Q_OBJECT public: explicit Object( QObject * parent=0 ) : QObject( parent ) {} public Q_SLOTS: void voidSlot(); int intSlot(); Q_SIGNALS: void voidSignal();

Complete example using Boost::Signals for C++ Eventing

允我心安 提交于 2019-11-27 06:02:14
I’m aware of the tutorial at boost.org addressing this: Boost.org Signals Tutorial , but the examples are not complete and somewhat over simplified. The examples there don’t show the include files and some sections of the code are a little vague. Here is what I need: ClassA raises multiple events/signals ClassB subscribes to those events (Multiple classes may subscribe) In my project I have a lower-level message handler class that raises events to a business class that does some processing of those messages and notifies the UI (wxFrames). I need to know how these all might get wired up (what

Can I create a software watchdog timer thread in C++ using Boost Signals2 and Threads?

余生颓废 提交于 2019-11-26 23:15:55
问题 I am running function Foo from somebody else's library in a single-threaded application currently. Most of the time, I make a call to Foo and it's really quick, some times, I make a call to Foo and it takes forever. I am not a patient man, if Foo is going to take forever, I want to stop execution of Foo and not call it with those arguments. What is the best way to call Foo in a controlled manner (my current environment is POSIX/C++) such that I can stop execution after a certain number of

Complete example using Boost::Signals for C++ Eventing

落爺英雄遲暮 提交于 2019-11-26 11:49:50
问题 I’m aware of the tutorial at boost.org addressing this: Boost.org Signals Tutorial, but the examples are not complete and somewhat over simplified. The examples there don’t show the include files and some sections of the code are a little vague. Here is what I need: ClassA raises multiple events/signals ClassB subscribes to those events (Multiple classes may subscribe) In my project I have a lower-level message handler class that raises events to a business class that does some processing of