Boost logo

Boost :

From: Soren Frank Andersen (sfa_at_[hidden])
Date: 2002-02-26 13:10:54


> -----Original Message-----
> From: Douglas Gregor [mailto:gregod_at_[hidden]]
> Sent: 26. februar 2002 16:18
>
> Interesting. With a bit of modification to Signals, it would be
> possible to use the named connection system as an ordering, but
> not quite as it is used above.
> If I connect two slots, s1 and s2, with the same signal_order
> value, the connection of s2 would disconnect s1.

I had missed that.

I thing it would be better if you could connect several slots with
the same name. And then disconnect them all with one disconnect call.

If the user wants the other behaviour he can always 'just' disconnect
before connecting. Or maybe add a unique_connect(..) method.
Ex.
        s.connect( name, slot );
becomes:
        s.disconnect( name );
        s.connect( name, slot );

> It is possible to implement full ordering control. The ordering
> would be a lexicographical ordering of the tuple (priority, name,
> uniquifier), where:
>
> 1) priority is an integer. if p1 and p2 are priorities, the slot with
> priority p1 will execute first if p1 < p2. Default priority is 0.
> 2) name is an optional slot/connection name. Named slots with the same
> priority will be ordered by name. Unnamed slots will have no
> name. The names of all unnamed slots are considered equivalent in the
> partial order. The names of unnamed slots precede the names of named
> slots.
> 3) uniquifier is a value used by the implementation to keep
> unnamed slots
> unique. It does not guarantee any ordering for the user.
>
> The above implementation scheme almost entirely dictates
> implementation via a map or set, but perhaps that's not a
> concern. From an efficiency standpoint, the connection of unnamed
> slots would become an O(lg n) operation (it was O(1)), but
> everything else would be equivalent.

It is really nice that the connection time for unnamed signals is
O(1), I was not aware of this. It would be nice if we could keep
it this way.

If it is possible to connect with a priority value, It is not
important to sort by name.

I guess this will help with the O(lg n) connection time for
unnamed connections with default priority?

I would prefer a ordering by name.

Soren


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk