#include <ConnectionHandler.hxx>
This helper class, as its name implies, handles the bookkeeping that the Signal has to maintain about the Slots that are to be called upon a call to the Emit method. This class is only used by the "Signal Serious Implementations" since some compilers go nuts when using derivation from template bases.
Note that the Handler class is templated by the Signal type that is going to use this handler, allowing to define nicely the types of the callbacks ( the Slots to be called ).
Definition at line 57 of file ConnectionHandler.hxx.
Public Types | |
typedef SignalType::tCallbackType | tCallbackType |
The callback type definition. | |
typedef SignalType::tConnectionId | tConnectionId |
The ConnectionID type definition. | |
typedef tCallbackType * | tCallbackPtr |
Helper typedef. | |
typedef std::list< tCallbackPtr > | tCallList |
Helper typedef. | |
typedef std::list < tCallbackPtr >::iterator | tCallIterator |
Helper typedef. | |
typedef std::list< tCallback > | tCallbackList |
Helper typedef. | |
typedef std::list< tCallback > ::iterator | tCbListIterator |
Helper typedef. | |
typedef std::list< tCallback > ::const_iterator | const_tCbListIterator |
Helper typedef. | |
Public Member Functions | |
void | AddCallback (tConnectionId pConnection, Slot *slot, tCallbackType cb) |
Adds a callback to the Signal callback list. | |
bool | HasNoCallbacks () const |
Accessor for finding if there are any slots to be notified ( callbacks to be called ). | |
tCallList & | GetCalls () |
Accessor to the "List of Calls". | |
void | RemoveCall (tConnectionId id) |
Removes a call from the "List of Calls". | |
void | DestroyConnections () |
Destroys all Signals connections. | |
Classes | |
struct | tCallback |
Inner type for ConnectionHandler. More... |
typedef SignalType::tCallbackType SigSlot::ConnectionHandler< SignalType >::tCallbackType |
typedef SignalType::tConnectionId SigSlot::ConnectionHandler< SignalType >::tConnectionId |
typedef tCallbackType* SigSlot::ConnectionHandler< SignalType >::tCallbackPtr |
typedef std::list<tCallbackPtr> SigSlot::ConnectionHandler< SignalType >::tCallList |
typedef std::list<tCallbackPtr >::iterator SigSlot::ConnectionHandler< SignalType >::tCallIterator |
typedef std::list<tCallback> SigSlot::ConnectionHandler< SignalType >::tCallbackList |
typedef std::list<tCallback>::iterator SigSlot::ConnectionHandler< SignalType >::tCbListIterator |
typedef std::list<tCallback>::const_iterator SigSlot::ConnectionHandler< SignalType >::const_tCbListIterator |
void SigSlot::ConnectionHandler< SignalType >::AddCallback | ( | tConnectionId | pConnection, | |
Slot * | slot, | |||
tCallbackType | cb | |||
) | [inline] |
Adds a callback to the Signal callback list.
pConnection | The connection ID corresponding to the callback | |
slot | The Slot object that has been connected to the Signal | |
cb | The callback object. |
Definition at line 118 of file ConnectionHandler.hxx.
bool SigSlot::ConnectionHandler< SignalType >::HasNoCallbacks | ( | ) | const [inline] |
Accessor for finding if there are any slots to be notified ( callbacks to be called ).
Definition at line 128 of file ConnectionHandler.hxx.
tCallList& SigSlot::ConnectionHandler< SignalType >::GetCalls | ( | ) | [inline] |
Accessor to the "List of Calls".
Given a Signal and several Slots connected to it, we define the "List of Calls", as the list of function calls the SignalvX::Emit method has to execute in order to notify all the connected slots. This method, returns the current "List of Calls" for the Signal.
Definition at line 141 of file ConnectionHandler.hxx.
void SigSlot::ConnectionHandler< SignalType >::RemoveCall | ( | tConnectionId | id | ) | [inline] |
Removes a call from the "List of Calls".
Given a valid Connection GUID this methods searches for the connection with this ID and removes the call from the list, so the Signal does not notify any longer that Slot.
id | The GUID of the connection to be severed. |
Definition at line 165 of file ConnectionHandler.hxx.
void SigSlot::ConnectionHandler< SignalType >::DestroyConnections | ( | ) | [inline] |
Destroys all Signals connections.
Disconnects all the Slots bound to the Signal.
Definition at line 185 of file ConnectionHandler.hxx.