SignalBase
Engine/source/core/util/tSignal.h
Signals (Multi-cast Delegates)
Classes:
Protected Attributes
Vector< DelegateLink * >
We need to protect the delegate list against removal of the currently triggering node as well removal of the next node in the list.
Public Functions
bool
isEmpty()
Returns true if the delegate list is empty.
Detailed Description
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"
Protected Attributes
DelegateLink mList
Vector< DelegateLink * > mTriggerNext
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.
Public Functions
SignalBase()
~SignalBase()
isEmpty()
Returns true if the delegate list is empty.
removeAll()
Removes all the delegates from the signal.