This page attempts to provide a comprehensive comparison of various features of various signals/slots libraries. You'll find compared here :
Each feature is qualified as good, bad or unknown. Of course it's always to argue to know if a particular feature is either good or bad. For example, I consider the possibility to copy signals objects a good thing, but you can consider it's a bad thing. So don't start a flame.
Not surprisingly, SlotSig is the one which has the most "good" features - after all, I designed it to "fix" things I considered as "bad" in others. If however you find errors, or if you think something is missing, please let me know.
| Feature | SlotSig | Qt | libsigc++ | Boost |
| Compilation and general features | ||||
| Needs some special preprocessor | N | Y | N | N |
| Compile-time type checking | Y | N | Y | Y |
| Thread-safe | N | N | N | N |
| Free use of templates for signals, slots, and their containing class | Y | N | Y | Y |
| Needs partial template specialization somewhere | Y | N | Y | Y |
| Provides an easy way to identify a signal or a slot by a char string | N | Y | N | N |
| Signals objects | ||||
| Able to get back values returned by slots (signal level) | N | N | Y | Y |
| Can be cloned, copied | Y | N | Y | N |
| Can be public | Y | N | Y | Y |
| Can be protected | Y | N | Y | Y |
| Can be private | Y | Y | Y | Y |
| Slots objects | ||||
| Can call arbitrary global function | Y | N | Y | Y |
| Can call arbitraty class method (but see the next one) | Y | N | Y | Y(4) |
| Class containing slots MUST inherit from a provided class | N(3) | Y | Y | N(5) |
| Connections and emitting | ||||
| Ensure unicity of each connection | Y(2) | Y | N | N |
| Can connect a signal to a signal | Y | Y | Y | Y |
| Avoid cycling (a slot emitting a signal being emitted) | Y | N | N | N |
| Conditionnal emitting (a running signal can be interrupted) | Y | N | N | N |
| Able to get back values returned by slots (emit level) | Y | N | N | N |
| Automatic disconnection when an instance containing slots is deleted | Y (1) | Y | Y | Y(5) |
| Can change signature between signal and slot (bindable arguments) | N | N | Y | Y |
| Provide some type of connection identifier | N | N | Y | Y |
| Can disconnect using some kind of identifier | N | N | Y | Y |
| MUST disconnect using some kind of identifier | N | N | Y | Y |
| Disconnecting is a "mirror" of connecting | Y | Y | N | N |
| Optimised parameters sending (use references on non-trivial values) | Y | Y | Y | N |
| Feature | SlotSig | Qt | libsigc++ | Boost |
| Global score (numbers of good, bad, unknown) | 19, 7, 0 | 9, 17, 0 | 16, 10, 0 | 15, 11, 0 |
(1) Only if the class
inherits from SlotSig::SlotsSetBase, otherwise you must use
SlotSig::about_to_delete().
(2) Optional, enabled by default.
(3) But if not, some manual steps are required to avoid crash - see (1).
(4) But through a binder.
(5) A base class is provided
to avoid crashes (trackable), a bit like SlotSig.
Last updated 2006-04-17