38 #ifndef ORO_NAMESERVER_HPP 39 #define ORO_NAMESERVER_HPP 70 template <
class _ValueType >
76 typedef std::map<NameType, ValueType>
Rep;
119 for ( const_iterator i =
objects.begin(); i !=
objects.end(); ++i )
121 if ( ( *i ).second == o )
138 const_iterator itc =
objects.find( s );
141 return( *itc ).second;
155 for ( const_iterator i =
objects.begin(); i !=
objects.end(); ++i )
157 if ( ( *i ).second == s )
179 objects.insert(std::make_pair(name,obj));
203 if ( ( *i ).second == obj )
207 if ( i ==
objects.end() )
return;
223 iterator i(
objects.find( name ) );
239 class value_iterator :
public bidirectional_iterator<ValueType, int>
253 return ( ( *i ).second );
284 return ( i == other.
i );
289 return ( i != other.
i );
294 return ( i -other.
i );
304 class name_iterator :
public bidirectional_iterator<NameType, int>
306 class
name_iterator :
public std::iterator< std::input_iterator_tag , NameType>
320 return ( ( *i ).first );
351 return ( i == other.
i );
356 return ( i != other.
i );
361 return ( i -other.
i );
395 #endif // NAMESERVER_HPP value_iterator & operator++()
value_iterator operator--(int)
name_iterator(iterator _i)
bool operator!=(value_iterator other)
~NameServer()
Destruct a nameserver.
bool operator==(value_iterator other)
A nameserver for Orocos Device classes.
An Iterator to iterate over the registered objects.
name_iterator & operator++()
bool registerObject(const ValueType obj, const NameType &name)
Register an object with a name. If an object with such a name already exists, the present one will no...
bool isNameRegistered(const NameType &s) const
Determine if a given name is registered.
name_iterator operator--(int)
value_iterator(iterator _i)
An Iterator to iterate over the registered names.
NameServer< _ValueType >::iterator i
name_iterator getNameEnd()
Get an iterator to the end of the names list.
bool operator==(name_iterator other)
value_iterator & operator--()
value_iterator getValueBegin()
Get an iterator to the beginning of the objects list.
NameServer< _ValueType >::iterator i
Rep::const_iterator const_iterator
ValueType getObject(const NameType &s) const
Get the object registered for a name.
std::map< NameType, ValueType > Rep
const NameType & getName(const ValueType s) const
Get the name registered for a object.
bool isObjectRegistered(const ValueType o) const
Determine if a given object is registered.
int operator-(value_iterator other)
void unregisterObject(const ValueType obj)
Remove an object from the nameserver registrations.
bool operator!=(name_iterator other)
name_iterator getNameBegin()
Get an iterator to the beginning of the names list.
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
value_iterator getValueEnd()
Get an iterator to the end of the objects list.
name_iterator operator++(int)
NameServer()
Construct an empty NameServer.
void unregisterName(const NameType &name)
Remove a name from the nameserver registrations.
name_iterator & operator--()
value_iterator operator++(int)