46 #ifndef CONNECTIONMANAGER_HPP_ 47 #define CONNECTIONMANAGER_HPP_ 53 #include "../ConnPolicy.hpp" 54 #include "../os/Mutex.hpp" 55 #include "../base/rtt-base-fwd.hpp" 56 #include "../base/ChannelElementBase.hpp" 57 #include <boost/tuple/tuple.hpp> 58 #include <boost/function.hpp> 59 #include <boost/bind.hpp> 60 #include <boost/shared_ptr.hpp> 104 bool addConnection(
ConnID* port_id, base::ChannelElementBase::shared_ptr channel,
ConnPolicy policy);
106 bool removeConnection(
ConnID* port_id,
bool disconnect =
true);
117 bool connected()
const;
144 return shared_connection;
151 connection_lock.lock();
158 connection_lock.unlock();
166 Connections::iterator eraseConnection(
const Connections::iterator& descriptor,
bool disconnect);
We can't use typedefs since C++ doesn't allow it for templated classes without specifying all the tem...
boost::intrusive_ptr< SharedConnectionBase > shared_ptr
internal::SharedConnectionBase::shared_ptr shared_connection
A pointer to the shared connection this port may be connected to.
Manages connections between ports.
A connection policy object describes how a given connection should behave.
void unlock() const
Unlocks the mutex protecting the channel element list.
void lock() const
Locks the mutex protecting the channel element list.
std::list< ChannelDescriptor > Connections
base::PortInterface * mport
The port for which we manage connections.
boost::tuple< boost::shared_ptr< ConnID >, base::ChannelElementBase::shared_ptr, ConnPolicy > ChannelDescriptor
A connection is described by an opaque ConnID object, the first element of the connection and the pol...
boost::intrusive_ptr< ChannelElementBase > shared_ptr
RTT::os::Mutex connection_lock
Lock that should be taken before the list of connections is accessed or modified. ...
Connections getConnections() const
Returns a list of all connections managed by this object.
bool isSingleConnection() const
Returns true if this manager manages only one connection.
This class is used in places where a permanent representation of a reference to a connection is neede...
An object oriented wrapper around a non recursive mutex.
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
std::list< ChannelDescriptor > connections
A list of all our connections.
In the data flow implementation, a channel is created by chaining ChannelElementBase objects...
The base class of every data flow port.
internal::SharedConnectionBase::shared_ptr getSharedConnection() const
Returns a pointer to the shared connection element this port may be connected to. ...