#include <Connection.hxx>
This class model the concept of signal and slot connection i.e. the knowledge a signal has about who it has to notify whenever the client invoke the Emit( ) method on a Signal object. Also it becomes the passage through the Slot::Unbind method can access the bound signals to disconnect them. Each time a Signal and a Slot are bound together a Connection object is created, being tagged by a Global Unique IDenfier ( GUID ). These GUID's are reused whenever the Connection object holding it is destroyed.
Definition at line 46 of file Connection.hxx.
Public Types | |
typedef unsigned | tConnectionId |
Type declaration for the ConnectionId. | |
Public Member Functions | |
Connection () | |
Default constructor. | |
Connection (tConnectionId id, Signal *connectedSignal) | |
Explicit constructor. | |
Connection & | operator= (Connection &s) |
Assignment operator. | |
Connection (const Connection &s) | |
Copy constructor. | |
tConnectionId | GetID () const |
Accessor to the GUID. | |
~Connection () | |
Destructor. |
SigSlot::Connection::Connection | ( | ) |
Default constructor.
Initializes the Connection so to be nil. This constructor should not be used from the client: its existence is justified for allowing to have Connection objects inside STL containers
Definition at line 28 of file Connection.cxx.
SigSlot::Connection::Connection | ( | tConnectionId | id, | |
Signal * | connectedSignal | |||
) |
Explicit constructor.
Initializes the object with a GUID and a reference to the Signal the Slot is being connected to.
Definition at line 39 of file Connection.cxx.
SigSlot::Connection::Connection | ( | const Connection & | s | ) |
Copy constructor.
Definition at line 44 of file Connection.cxx.
References mConnectedSignal, mID, and mMustFreeSignal.
SigSlot::Connection::~Connection | ( | ) |
Destructor.
When connections are destroyed it is checked that the connection is active, if that is the case then the Signal is notified about not calling anymore the involved slot object.
Definition at line 33 of file Connection.cxx.
References SigSlot::Signal::FreeConnection().
Connection & SigSlot::Connection::operator= | ( | Connection & | s | ) |
Assignment operator.
Copies the Connection object provided, keeping the GUID and the reference to the signal. To avoid owning problems, the source Connection object is marked as 'disabled'.
Definition at line 52 of file Connection.cxx.
References mConnectedSignal, mID, and mMustFreeSignal.
tConnectionId SigSlot::Connection::GetID | ( | ) | const [inline] |
Accessor to the GUID.
Accessor for getting the GUID hold by the Connection object.
Definition at line 85 of file Connection.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(), SigSlot::Signalv0::Connect(), 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().