Re: [Boost-users] [Signals] Relationships to other libraries and terms
-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] 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
participants (1)
-
Ames Andreas