Boost logo

Boost Users :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2008-01-02 14:43:37


Frank Mori Hess wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Tuesday 01 January 2008 17:13 pm, Vladimir Prus wrote:
>> It should be noted that in general, porting Qt signals/slots
>> to Boost is not possible:
>>
>> 1. Qt signals/slots are dynamic, so declaration of either signal
>> or slot need not be present in the static type of objects being
>> connected.
>
> Could you elaborate on what you mean by dynamic? I haven't used qt
> signals/slots since qt 3, but in those days I believe both the signal and
> slot end had to be in classes derived from QObject,

Right.

> plus have the Q_OBJECT
> macro in their declaration,

Right.

> as well as "slots:" and "signals:"
> pseudo-access specifications for the moc preprocessor to chew on.

Not exactly. In order to 'connect' call to compile, you don't need anything
extra at all -- either slot or signal being connected is allowed to not
exist in the dynamic type of the objects, or not exist in the static type.

At runtime, connect will check if the signal and slot are actually present,
and connect them if so.

>> 2. Boost does not support inter-thread signals.
>
> thread_safe_signals in the review queue does, although it doesn't have a
> review manager yet.

I think it's not that. "inter-thread" signals are signals that are send from
one thread, and delivered and processed in another thread. I don't think such
solution for boost was announced in any form on mailing lists.

See http://doc.trolltech.com/4.3/threads.html#signals-and-slots-across-threads
for more details.

- Volodya

- Volodya


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net