47 #include <boost/bind.hpp> 48 #include <boost/scoped_ptr.hpp> 49 #include "../base/PortInterface.hpp" 50 #include "../os/MutexLock.hpp" 51 #include "../base/InputPortInterface.hpp" 52 #include "../Logger.hpp" 57 using namespace detail;
74 boost::scoped_ptr<ConnID> conn_id( port->
getPortID() );
87 Connections::iterator next =
connections.erase(descriptor);
91 bool is_forward =
true;
92 if ( dynamic_cast<InputPortInterface*>(
mport) )
115 boost::scoped_ptr<ConnID> conn_id( port->
getPortID() );
116 for(Connections::const_iterator conn_it =
connections.begin(); conn_it !=
connections.end(); ++conn_it ) {
117 if (conn_it->get<0>() && conn_id->isSameID(*conn_it->get<0>()))
return true;
144 if (conn_it->get<0>() && conn_id->
isSameID(*conn_it->get<0>())) {
159 if (conn_it->get<1>() && channel == conn_it->get<1>()) {
virtual bool isSameID(ConnID const &id) const =0
Connections::iterator eraseConnection(const Connections::iterator &descriptor, bool disconnect)
Helper method for disconnect()
boost::intrusive_ptr< SharedConnectionBase > shared_ptr
bool removeConnection(ConnID *port_id, bool disconnect=true)
void disconnect()
Disconnect all connections.
bool connectedTo(base::PortInterface *port)
Returns true if there exists a connection to the given port.
const std::string & getName() const
Get the name of this Port.
internal::SharedConnectionBase::shared_ptr shared_connection
A pointer to the shared connection this port may be connected to.
A connection policy object describes how a given connection should behave.
void lock() const
Locks the mutex protecting the channel element list.
virtual ChannelElementBase * getEndpoint() const =0
Returns the input or output endpoint of this port (if any).
ConnectionManager(base::PortInterface *port)
Creates a connection manager to manage the connections of port.
virtual void disconnect(bool forward)
Performs a disconnection of this channel's endpoints.
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. ...
bool addConnection(ConnID *port_id, base::ChannelElementBase::shared_ptr channel, ConnPolicy policy)
Helper method for port-to-port connection establishment.
virtual internal::ConnID * getPortID() const
Returns the identity of this port in a ConnID object.
This class is used in places where a permanent representation of a reference to a connection is neede...
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.
bool connected() const
Returns true if there is at least one connection registered in this port's list of outputs...
MutexLock is a scope based Monitor, protecting critical sections with a Mutex object through locking ...
Base class for shared connection elements.