Classes |
struct | EmitGuard |
| Used to guard against nested Emit() calls. More...
|
Public Member Functions |
| BaseSignal () |
| Constructor.
|
virtual | ~BaseSignal () |
| Virtual destructor.
|
bool | Empty () const |
| Queries whether there are any connected slots.
|
std::size_t | GetConnectionCount () const |
| Queries the number of slots.
|
void | Emit () |
| Emits a signal with no parameters.
|
template<typename Ret > |
Ret | EmitReturn () |
| Emits a signal with no parameters.
|
template<typename Arg0 > |
void | Emit (Arg0 arg0) |
| Emits a signal with 1 parameter.
|
template<typename Ret , typename Arg0 > |
Ret | EmitReturn (Arg0 arg0) |
| Emits a signal with 1 parameter.
|
template<typename Arg0 , typename Arg1 > |
void | Emit (Arg0 arg0, Arg1 arg1) |
| Emits a signal with 2 parameters.
|
template<typename Ret , typename Arg0 , typename Arg1 > |
Ret | EmitReturn (Arg0 arg0, Arg1 arg1) |
| Emits a signal with 2 parameters.
|
template<typename Arg0 , typename Arg1 , typename Arg2 > |
void | Emit (Arg0 arg0, Arg1 arg1, Arg2 arg2) |
| Emits a signal with 3 parameters.
|
template<typename Ret , typename Arg0 , typename Arg1 , typename Arg2 > |
Ret | EmitReturn (Arg0 arg0, Arg1 arg1, Arg2 arg2) |
| Emits a signal with 3 parameters.
|
void | OnConnect (CallbackBase *callback) |
| Called by Signal implementations, when the user calls Signal.Connect( ... ).
|
void | OnDisconnect (CallbackBase *callback) |
| Called by Signal implementations, when the user calls Signal.Disconnect( ... ).
|
void | OnConnect (ConnectionTrackerInterface *tracker, CallbackBase *callback) |
| Called by Signal implementations, when the user calls Signal.Connect( ... ).
|
void | OnDisconnect (ConnectionTrackerInterface *tracker, CallbackBase *callback) |
| Called by Signal implementations, when the user calls Signal.Disconnect( ... ).
|
Implementation class for Dali::Signal.
A slot can be connected to many signals A signal can be connected to many slots
To provide automatic disconnection when either a signal or the object owning the slot dies, observers are used.
A signal is an object with state. It holds a list of SignalConnections.
E.g. Signal OnTouch. mSignalConnections contains
OnTouch.Emit() will run callbacks 0, 1 and 2.
When the signal is destroyed. SignalDisconnected() is called on each Signal Observer.
Slots are just static or member functions, so have no state. E.g. they can't keep track of how many signals they are connected to. If the object owning a slot dies, it must automatically disconnected from all signals. If it doesn't disconnect and the signal is emitted, there will be a crash.
To keep track of connections between slots and signals, a Connection tracker is used. It holds a list of SlotConnections.
Callback 0 | Slot Observer 0 |
Callback 1 | Slot Observer 1 |
Callback 2 | Slot Observer 2 |
When the connection tracker is destroyed, SlotDisconnected() is called on every slot observer ( signal ). Signals implement the Slot Observer interface, to be told when a slot has disconnected. Connection tracker implements the Signal Observer interface, to be told when a signal has disconnected (died).
- Since:
- 2.4, DALi version 1.0.0