Boost logo

Boost Users :

Subject: [Boost-users] boost version of qt signals (including cross-thread event generation)
From: Daniel Oberhoff (daniel_at_[hidden])
Date: 2011-09-14 05:49:57


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.



Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at