|
![](/i/fill.gif) |
I've been trying to get acquainted with boost::signals. I've done some
development with Qt, so I have used the signal/slot model, but I'm not
intimately familiar with it.
The problem I'm having, at the moment, is that the explanation (Explicitly for
Beginners) in the boost documentation seems rather confusing, to say the least.
They "begin" by introducing "an object with a slot" in the form of a struct with
an overloaded ()() operator... How is this a "Beginner" tutorial, again?
Okay, so if you're poking around with event handling, it can be assumed you know
what overloaded operators are... maybe. And I'll set aside my prejudices about
the use of structs, which are likely irrational anyway.
but they then proceed to create an instance of the struct, and connect it with a
signal...
Now here's my problem: Slots are functions. it would make more sense to me, to
start with a simple, unadorned function, and connect it with a signal.
An object, on the other hand, might have multiple slots. It makes absolutely no
sense to me to connect an entire object -- thereby, connecting all of its slots
-- with a given signal.
So, in the interest of learning, and at the risk of looking like an idiot, I
ask: Is this actually how signals are supposed to be used, or is this a boost
peculiarity? Am I missing something?
Regards,
A.D.B.
Post a reply to this message
|
![](/i/fill.gif) |