Webmaster  |  Imprint 
Platinum
Platinum C++ Framework
Main  |  License  |  Documentation  |  Download  |  Support 

Connectable Class Reference

Connection management for signal and slot objects More...

#include <Pt/Connectable.h>

Inheritance diagram for Connectable:

Delegate Application Layout Widget SelectorBase StreamBuffer Test

List of all members.

Public Member Functions

 Connectable ()
 Default constructor.
virtual ~Connectable ()
 Closes all connections.
virtual void onConnectionOpen (const Connection &c)
 Registers a Connection with the Connectable.
virtual void onConnectionClose (const Connection &c)
 Unregisters a Connection from the Connectable.
std::size_t connectionCount () const

Protected Member Functions

 Connectable (const Connectable &c)
 Copy constructor.
Connectableoperator= (const Connectable &rhs)
 Assignment operator.
const std::list< Connection > & connections () const
 Returns a list of all current connections.
std::list< Connection > & connections ()
 Returns a list of all current connections.
void clear ()

Protected Attributes

std::list< Connection_connections
 A list of all current connections.


Detailed Description

This class implements connection management for signal and slot objects. It makes sure that all connections where this object is involved are closed on destruction. Deriving classes can overload Connectable::opened and Connectable::closed to tune connection managenment.

Constructor & Destructor Documentation

Connectable (  ) 

Creates an empty Connectable.

virtual ~Connectable (  )  [virtual]

When a Connectable object is destroyed, it closes all its connections automatically.

Connectable ( const Connectable c  )  [protected]


Member Function Documentation

virtual void onConnectionOpen ( const Connection c  )  [virtual]

This function is called when a new Connection involving this object is opened. The default implementation adds the connection to a list, so the destructor can close it.

Parameters:
c Connection being opened
Returns:
True if the Connection was accepted

virtual void onConnectionClose ( const Connection c  )  [virtual]

This function is called when a new Connection involving this object is closed. The default implementation removes the connection from its list of connections.

Parameters:
c Connection being opened

Connectable& operator= ( const Connectable rhs  )  [protected]

Connectables can be copy constructed if the derived class provides a public copy constructor. Copying a Connectable will not change its connections.

Copyright © 2003-2007 The Pt Development Team
Pt 1.0