|
Boost Users : |
From: Ames Andreas (Andreas.Ames_at_[hidden])
Date: 2006-08-22 06:42:47
> -----Original Message-----
> From: boost-users-bounces_at_[hidden]
> [mailto:boost-users-bounces_at_[hidden]] On Behalf Of Scott Meyers
> Sent: Tuesday, August 22, 2006 12:07 AM
> Subject: [Boost-users] [Signals] Relationships to other
> libraries and terms
>
> We start with "callable entities" -- things that can be called, e.g.,
> function pointers, function objects, bound member functions,
> etc. As I
> understand it:
>
> - A callback (function or object) is a callable entity
> - A slot in Boost.Signals is a callable entity
> - boost::bind and boost::lambda create callable entities.
> - A boost::function object stores a callable entity.
>
> We also have collections of callable entities:
>
> - A .NET delegate is a collection of 0 or more callable
> entities with a
> given signature.
> - A signal in Boost.Signals is a collection of 0 or more callable
> entities with signatures compatible with a given signature.
>
> Objects of these collection types are also callable entities:
>
> - When a Boost.Signals signal or a .NET delegate is
> called, it invokes
> the callable entities it contains.
>
> Is that correct?
>
> Also, does anybody know where the name "slot" comes from in
> this context?
> I've found this term to be a stumbling block for trying to
> understand this
> stuff.
I think the callability of signals is just a detail. Libsigc++ seems to prefer signal.emit() (although they also have operator()).
A slot corresponds to the Observer (in the corresponding GoF pattern), i.e the receipient of a signal (which comes closest to the subject in the GoF pattern).
Regarding the terminology: IIRC, it was introduced by a signal/slot lib in C, unfortunately I can't find the links, sorry (I'd also be interested in them, if anyone can find them). There are quite some implementations in C++: Qt, libsigc++, boost and others. On the libsigc++ mailing list was a discussion about the terminology, you can find it in the thread starting with http://mail.gnome.org/archives/libsigc-list/2005-July/msg00014.html.
cheers,
aa
-- Andreas Ames | Programmer | Comergo GmbH | Voice: +49 69 7505 3213 | ames AT avaya DOT com
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