boost version of qt signals (including cross-thread event generation)
Hi, I am currently building a software component that does stream processing in a dataflow like scheme (i.e. data flows through a network of algorithm blocks, much like in simulink, if you know matlab). I am currently implementing it all using qt signals and slots, since this allows me to push parts off to different threads, and qt magically handles the event generation. i.e. when I connect across threads instead of directly invoking the slot qt will generate an event in the receivers thread's eventloop (such eventloops are automatically generated for all QThreads). Now I am a bit frutrated by the hackishnes of the qt preprocessor (moc) that implements the signal/slot magic, as it does not compute with templates and typedefs, making my code unneccesarily verbose. So I was wondering how easy/hard it would be to implement such a thing with boost? I nknow there is signals2, but that does not implement the message passing scheme I want, instead it just savely calls slot directly. In terms of event-loops there is boost asio, right? Is there a sane way to combine these? It would be great as I think this kind of scheme can be used in many places. Best Daniel
Now I am a bit frutrated by the hackishnes of the qt preprocessor (moc) that implements the signal/slot magic, as it does not compute with templates and typedefs, making my code unneccesarily verbose. So I was wondering how easy/hard it would be to implement such a thing with boost? I nknow there is signals2, but that does not implement the message passing scheme I want, instead it just savely calls slot directly. In terms of event-loops there is boost asio, right? Is there a sane way to combine these? It would be great as I think this kind of scheme can be used in many places.
It calls slots directly. You definitely can combine this with Asio, but it should be done manually - i.e. "high-level" slot function/functor should just post() a "real" functor to asio::io_service.
On Sep 14, 2011, at 5:49 AM, Daniel Oberhoff
I am currently building a software component that does stream processing in a dataflow like scheme (i.e. data flows through a network of algorithm blocks, much like in simulink, if you know matlab).
Have you looked at all at the emerging Boost.Dataflow library? I think it's in the Vault, but could be in the sandbox; search the archives for this mailing list.
participants (3)
-
Daniel Oberhoff
-
Igor R
-
Nat Goodspeed