SigSlot::ConnectionHandler< SignalType > Class Template Reference

Handler for a given Signal connections. More...

#include <ConnectionHandler.hxx>

List of all members.

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 tCallbackTypetCallbackPtr
 Helper typedef.
typedef std::list< tCallbackPtrtCallList
 Helper typedef.
typedef std::list
< tCallbackPtr >::iterator 
tCallIterator
 Helper typedef.
typedef std::list< tCallbacktCallbackList
 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 ).
tCallListGetCalls ()
 Accessor to the "List of Calls".
void RemoveCall (tConnectionId id)
 Removes a call from the "List of Calls".
void DestroyConnections ()
 Destroys all Signals connections.

Detailed Description

template<class SignalType>
class SigSlot::ConnectionHandler< SignalType >

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 ).

See also:
Signalv1(SI), Signalv0(SI), Signalv2(SI), Signalv3(SI), Signalv4(SI)

Definition at line 57 of file ConnectionHandler.hxx.


Member Typedef Documentation

template<class SignalType>
typedef std::list<tCallback>::const_iterator SigSlot::ConnectionHandler< SignalType >::const_tCbListIterator

Helper typedef.

Definition at line 108 of file ConnectionHandler.hxx.

template<class SignalType>
typedef std::list<tCallback> SigSlot::ConnectionHandler< SignalType >::tCallbackList

Helper typedef.

Definition at line 100 of file ConnectionHandler.hxx.

template<class SignalType>
typedef tCallbackType* SigSlot::ConnectionHandler< SignalType >::tCallbackPtr

Helper typedef.

Definition at line 88 of file ConnectionHandler.hxx.

template<class SignalType>
typedef SignalType::tCallbackType SigSlot::ConnectionHandler< SignalType >::tCallbackType

The callback type definition.

Definition at line 61 of file ConnectionHandler.hxx.

template<class SignalType>
typedef std::list<tCallbackPtr >::iterator SigSlot::ConnectionHandler< SignalType >::tCallIterator

Helper typedef.

Definition at line 96 of file ConnectionHandler.hxx.

template<class SignalType>
typedef std::list<tCallbackPtr> SigSlot::ConnectionHandler< SignalType >::tCallList

Helper typedef.

Definition at line 92 of file ConnectionHandler.hxx.

template<class SignalType>
typedef std::list<tCallback>::iterator SigSlot::ConnectionHandler< SignalType >::tCbListIterator

Helper typedef.

Definition at line 104 of file ConnectionHandler.hxx.

template<class SignalType>
typedef SignalType::tConnectionId SigSlot::ConnectionHandler< SignalType >::tConnectionId

The ConnectionID type definition.

Definition at line 63 of file ConnectionHandler.hxx.


Member Function Documentation

template<class SignalType>
void SigSlot::ConnectionHandler< SignalType >::AddCallback ( tConnectionId  pConnection,
Slot slot,
tCallbackType  cb 
) [inline]

Adds a callback to the Signal callback list.

Parameters:
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().

template<class SignalType>
void SigSlot::ConnectionHandler< SignalType >::DestroyConnections (  )  [inline]
template<class SignalType>
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.

Returns:
A non-const reference to the list of calls.

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().

template<class SignalType>
bool SigSlot::ConnectionHandler< SignalType >::HasNoCallbacks (  )  const [inline]

Accessor for finding if there are any slots to be notified ( callbacks to be called ).

Returns:
A boolean telling if there are any Slots connected to this Signal

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().

template<class SignalType>
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.

Parameters:
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().


The documentation for this class was generated from the following file:
Generated by  doxygen 1.6.3