Boost logo

Boost Users :

From: Scott Meyers (usenet_at_[hidden])
Date: 2006-08-21 18:06:42


I've been trying to make sense of Boost.Signals, especially in terms of
some other libraries I'm familiar with. Part of the problem is
terminology, I think, e.g., callbacks, slots, and delegates (as in .NET,
but also as used by some for bound member function pointers
(e.g.,http://www.codeproject.com/cpp/FastDelegate.asp)). I'm hoping people
will take a look at what follows, correct any errors they see, and maybe
lend additional insight so that my understanding will be improved.

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.

Thanks,

Scott


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