Torque2D Reference
|
#include <delegateSignal.h>
Classes | |
struct | DelegateLink |
Public Member Functions | |
SignalBase () | |
~SignalBase () | |
void | removeAll () |
Removes all the delegates from the signal. More... | |
bool | isEmpty () const |
Returns true if the delegate list is empty. More... | |
Protected Attributes | |
DelegateLink | mList |
Vector< DelegateLink * > | mTriggerNext |
Signals (Multi-cast Delegates)
Signals are used throughout this engine to allow subscribers to listen for generated events for various things.
Signals are called according to their order parameter (lower numbers first).
Signal functions can return bool or void. If bool then returning false from a signal function will cause entries in the ordered signal list after that one to not be called.
This allows handlers of a given event to say to the signal generator, "I handled this message, and it is no longer appropriate for other listeners to handle it"
|
inline |
~SignalBase | ( | ) |
|
inline |
Returns true if the delegate list is empty.
void removeAll | ( | ) |
Removes all the delegates from the signal.
|
protected |
|
protected |
We need to protect the delegate list against removal of the currently triggering node as well removal of the next node in the list. When not handling these two cases correctly, removing delegates from a signal while it is triggering will lead to crashes.
So this field stores the next node of each active traversal so that when we unlink a node, we can check it against this field and move the traversal along if needed.