Handler for a given Signal connections. More...
#include <ConnectionHandler.hxx>
Classes | |
struct | tCallback |
Inner type for ConnectionHandler. More... | |
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. |
Handler for a given Signal connections.
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.
typedef std::list<tCallback>::const_iterator SigSlot::ConnectionHandler< SignalType >::const_tCbListIterator |
Helper typedef.
Definition at line 108 of file ConnectionHandler.hxx.
typedef std::list<tCallback> SigSlot::ConnectionHandler< SignalType >::tCallbackList |
Helper typedef.
Definition at line 100 of file ConnectionHandler.hxx.
typedef tCallbackType* SigSlot::ConnectionHandler< SignalType >::tCallbackPtr |
Helper typedef.
Definition at line 88 of file ConnectionHandler.hxx.
typedef SignalType::tCallbackType SigSlot::ConnectionHandler< SignalType >::tCallbackType |
The callback type definition.
Definition at line 61 of file ConnectionHandler.hxx.
typedef std::list<tCallbackPtr >::iterator SigSlot::ConnectionHandler< SignalType >::tCallIterator |
Helper typedef.
Definition at line 96 of file ConnectionHandler.hxx.
typedef std::list<tCallbackPtr> SigSlot::ConnectionHandler< SignalType >::tCallList |
Helper typedef.
Definition at line 92 of file ConnectionHandler.hxx.
typedef std::list<tCallback>::iterator SigSlot::ConnectionHandler< SignalType >::tCbListIterator |
Helper typedef.
Definition at line 104 of file ConnectionHandler.hxx.
typedef SignalType::tConnectionId SigSlot::ConnectionHandler< SignalType >::tConnectionId |
The ConnectionID type definition.
Definition at line 63 of file ConnectionHandler.hxx.
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.
Referenced by SigSlot::Signalv4< ParmType1, ParmType2, ParmType3, ParmType4 >::Connect(), SigSlot::Signalv3< ParmType1, ParmType2, ParmType3 >::Connect(), SigSlot::Signalv2< ParmType1, ParmType2 >::Connect(), SigSlot::Signalv1< ParmType1 >::Connect(), and SigSlot::Signalv0::Connect().
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.
Referenced by SigSlot::Signalv0::~Signalv0(), SigSlot::Signalv1< ParmType1 >::~Signalv1(), SigSlot::Signalv2< ParmType1, ParmType2 >::~Signalv2(), SigSlot::Signalv3< ParmType1, ParmType2, ParmType3 >::~Signalv3(), and SigSlot::Signalv4< ParmType1, ParmType2, ParmType3, ParmType4 >::~Signalv4().
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.
Referenced by SigSlot::Signalv4< ParmType1, ParmType2, ParmType3, ParmType4 >::Emit(), SigSlot::Signalv3< ParmType1, ParmType2, ParmType3 >::Emit(), SigSlot::Signalv2< ParmType1, ParmType2 >::Emit(), SigSlot::Signalv1< ParmType1 >::Emit(), and SigSlot::Signalv0::Emit().
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.
Referenced by SigSlot::Signalv4< ParmType1, ParmType2, ParmType3, ParmType4 >::Emit(), SigSlot::Signalv3< ParmType1, ParmType2, ParmType3 >::Emit(), SigSlot::Signalv2< ParmType1, ParmType2 >::Emit(), SigSlot::Signalv1< ParmType1 >::Emit(), and SigSlot::Signalv0::Emit().
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.
Referenced by SigSlot::Signalv4< ParmType1, ParmType2, ParmType3, ParmType4 >::FreeConnection(), SigSlot::Signalv3< ParmType1, ParmType2, ParmType3 >::FreeConnection(), SigSlot::Signalv2< ParmType1, ParmType2 >::FreeConnection(), SigSlot::Signalv1< ParmType1 >::FreeConnection(), and SigSlot::Signalv0::FreeConnection().