Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
RTT::internal::ConnectionManager Class Reference

#include <ConnectionManager.hpp>

Public Types

typedef boost::tuple< boost::shared_ptr< ConnID >, base::ChannelElementBase::shared_ptr, ConnPolicyChannelDescriptor
 
typedef std::list< ChannelDescriptorConnections
 

Public Member Functions

bool addConnection (ConnID *port_id, base::ChannelElementBase::shared_ptr channel, ConnPolicy policy)
 
bool connected () const
 
bool connectedTo (base::PortInterface *port)
 
 ConnectionManager (base::PortInterface *port)
 
void disconnect ()
 
bool disconnect (base::PortInterface *port)
 
Connections getConnections () const
 
internal::SharedConnectionBase::shared_ptr getSharedConnection () const
 
bool isSingleConnection () const
 
bool removeConnection (ConnID *port_id, bool disconnect=true)
 
bool removeConnection (base::ChannelElementBase *channel, bool disconnect=true)
 
 ~ConnectionManager ()
 

Protected Member Functions

Connections::iterator eraseConnection (const Connections::iterator &descriptor, bool disconnect)
 

Protected Attributes

std::list< ChannelDescriptorconnections
 
base::PortInterfacemport
 
internal::SharedConnectionBase::shared_ptr shared_connection
 

Detailed Description

Manages connections between ports. This class is used for input and output ports in order to manage their connections. TODO: use the mutex lock !!!

Definition at line 78 of file ConnectionManager.hpp.

Member Typedef Documentation

A connection is described by an opaque ConnID object, the first element of the connection and the policy of the connection. The policy is only given for read-only access, modifying it will not have any effect on the connection.

Definition at line 87 of file ConnectionManager.hpp.

Definition at line 89 of file ConnectionManager.hpp.

Constructor & Destructor Documentation

RTT::internal::ConnectionManager::ConnectionManager ( base::PortInterface port)

Creates a connection manager to manage the connections of port.

Parameters
portThe port whose connections to manage.

Definition at line 63 of file ConnectionManager.cpp.

RTT::internal::ConnectionManager::~ConnectionManager ( )

Definition at line 68 of file ConnectionManager.cpp.

Member Function Documentation

bool RTT::internal::ConnectionManager::addConnection ( ConnID port_id,
base::ChannelElementBase::shared_ptr  channel,
ConnPolicy  policy 
)

Helper method for port-to-port connection establishment. This is the last step in adding a connection to an output port and also validates if the connection is sound.

Returns
false if the connection failed to work, true otherwise.

Definition at line 126 of file ConnectionManager.cpp.

bool RTT::internal::ConnectionManager::connected ( ) const

Returns true if there is at least one connection registered in this port's list of outputs

Definition at line 110 of file ConnectionManager.cpp.

bool RTT::internal::ConnectionManager::connectedTo ( base::PortInterface port)

Returns true if there exists a connection to the given port

Definition at line 116 of file ConnectionManager.cpp.

void RTT::internal::ConnectionManager::disconnect ( )

Disconnect all connections.

Definition at line 102 of file ConnectionManager.cpp.

bool RTT::internal::ConnectionManager::disconnect ( base::PortInterface port)

Removes the connection that connects this port to port

Definition at line 73 of file ConnectionManager.cpp.

ConnectionManager::Connections::iterator RTT::internal::ConnectionManager::eraseConnection ( const Connections::iterator &  descriptor,
bool  disconnect 
)
protected

Locks the mutex protecting the channel element list. Unlocks the mutex protecting the channel element list. Helper method for disconnect()

Unconditionally removes the given connection and returns the next connection in the list or connections.end()

Definition at line 79 of file ConnectionManager.cpp.

Connections RTT::internal::ConnectionManager::getConnections ( ) const
inline

Returns a list of all connections managed by this object.

Definition at line 136 of file ConnectionManager.hpp.

internal::SharedConnectionBase::shared_ptr RTT::internal::ConnectionManager::getSharedConnection ( ) const
inline

Returns a pointer to the shared connection element this port may be connected to.

Definition at line 143 of file ConnectionManager.hpp.

bool RTT::internal::ConnectionManager::isSingleConnection ( ) const
inline

Returns true if this manager manages only one connection.

Returns

Definition at line 131 of file ConnectionManager.hpp.

bool RTT::internal::ConnectionManager::removeConnection ( ConnID port_id,
bool  disconnect = true 
)

Definition at line 144 of file ConnectionManager.cpp.

bool RTT::internal::ConnectionManager::removeConnection ( base::ChannelElementBase channel,
bool  disconnect = true 
)

Definition at line 159 of file ConnectionManager.cpp.

Member Data Documentation

std::list< ChannelDescriptor > RTT::internal::ConnectionManager::connections
protected

A list of all our connections. Only non-null if two or more connections were added.

Definition at line 178 of file ConnectionManager.hpp.

base::PortInterface* RTT::internal::ConnectionManager::mport
protected

The port for which we manage connections.

Definition at line 172 of file ConnectionManager.hpp.

internal::SharedConnectionBase::shared_ptr RTT::internal::ConnectionManager::shared_connection
protected

A pointer to the shared connection this port may be connected to.

Definition at line 183 of file ConnectionManager.hpp.


The documentation for this class was generated from the following files:


rtt
Author(s): RTT Developers
autogenerated on Fri Oct 25 2019 03:59:46