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;
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()
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)
boost::intrusive_ptr< SharedConnectionBase > connection
virtual const std::string & getName() const
virtual ConnID * clone() const
SharedMutexLock is a scope based Monitor, protecting critical sections with a SharedMutex object thro...
virtual SharedConnID * getConnID()
virtual bool isSameID(ConnID const &id) const
boost::shared_ptr< SharedConnectionRepository > shared_ptr
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
virtual const ConnPolicy * getConnPolicy() const
static Logger::LogFunction endlog()
static SharedConnectionRepository::shared_ptr the_instance
SharedConnectionBase(const ConnPolicy &policy)
MutexLock is a scope based Monitor, protecting critical sections with a Mutex object through locking ...