39 #include "../os/MutexLock.hpp" 40 #include "../Logger.hpp" 42 #if defined(ORO_HAVE_BOOST_UUID) 43 #include <boost/uuid/random_generator.hpp> 44 #include <boost/uuid/uuid_io.hpp> 45 #elif defined(ORO_HAVE_LIBUUID) 46 #include <uuid/uuid.h> 58 else return real_id->
connection == this->connection;
66 #ifdef ORO_HAVE_BOOST_UUID 67 static boost::uuids::random_generator uuid_generator;
74 if (this->policy.
name_id.empty()) {
75 #if defined(ORO_HAVE_BOOST_UUID) 76 this->policy.
name_id = boost::uuids::to_string(uuid_generator());
77 #elif defined(ORO_HAVE_LIBUUID) 79 uuid_generate_random(uuid);
81 uuid_unparse(uuid, uuid_string);
82 this->policy.
name_id = uuid_string;
97 log(
Debug) <<
"Destroyed shared connection '" <<
getName() <<
"'." << endlog();
127 if (map.count(key))
return false;
128 map[key] = connection;
135 for(Map::iterator it = map.begin(); it != map.end(); )
137 if (it->second == connection) {
138 Map::iterator copy = it++;
149 return map.count(key);
bool add(const key_t &key, SharedConnectionBase *connection)
static shared_ptr Instance()
A repository which stores pointers to all shared connections within the process.
bool has(const key_t &key) const
boost::intrusive_ptr< SharedConnectionBase > shared_ptr
virtual ~SharedConnectionBase()
SharedConnectionBase::shared_ptr get(const key_t &key) const
void remove(SharedConnectionBase *connection)
int type
DATA, BUFFER or CIRCULAR_BUFFER.
A connection policy object describes how a given connection should behave.
boost::intrusive_ptr< SharedConnectionBase > connection
Classes which contain all implementation code for the RTT.
virtual const std::string & getName() const
Represents a shared connection created by the ConnFactory.
virtual ConnID * clone() const
SharedMutexLock is a scope based Monitor, protecting critical sections with a SharedMutex object thro...
Base classes of RTT classes.
virtual SharedConnID * getConnID()
virtual bool isSameID(ConnID const &id) const
boost::shared_ptr< SharedConnectionRepository > shared_ptr
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::string name_id
The name of this connection.
virtual const ConnPolicy * getConnPolicy() const
Get a pointer to the connection policy used to build this channel element, if available.
SharedConnectionBase(const ConnPolicy &policy)
MutexLock is a scope based Monitor, protecting critical sections with a Mutex object through locking ...
Base class for shared connection elements.