RTT::dev::NameServer< _ValueType > Class Template Reference

A nameserver for Orocos Device classes. More...

#include <NameServer.hpp>

List of all members.

Classes

class  name_iterator
 An Iterator to iterate over the registered names. More...
class  value_iterator
 An Iterator to iterate over the registered objects. More...

Public Types

typedef Rep::const_iterator const_iterator
typedef Rep::const_iterator const_iterator
typedef Rep::iterator iterator
typedef Rep::iterator iterator
typedef std::string NameType
typedef std::string NameType
typedef std::map< NameType,
ValueType
Rep
typedef std::map< NameType,
ValueType
Rep
typedef _ValueType ValueType
typedef _ValueType ValueType

Public Member Functions

const NameTypegetName (const ValueType s) const
 Get the name registered for a object.
const NameTypegetName (const ValueType s) const
 Get the name registered for a object.
name_iterator getNameBegin ()
 Get an iterator to the beginning of the names list.
name_iterator getNameBegin ()
 Get an iterator to the beginning of the names list.
name_iterator getNameEnd ()
 Get an iterator to the end of the names list.
name_iterator getNameEnd ()
 Get an iterator to the end of the names list.
ValueType getObject (const NameType &s) const
 Get the object registered for a name.
ValueType getObject (const NameType &s) const
 Get the object registered for a name.
value_iterator getValueBegin ()
 Get an iterator to the beginning of the objects list.
value_iterator getValueBegin ()
 Get an iterator to the beginning of the objects list.
value_iterator getValueEnd ()
 Get an iterator to the end of the objects list.
value_iterator getValueEnd ()
 Get an iterator to the end of the objects list.
bool isNameRegistered (const NameType &s) const
 Determine if a given name is registered.
bool isNameRegistered (const NameType &s) const
 Determine if a given name is registered.
bool isObjectRegistered (const ValueType o) const
 Determine if a given object is registered.
bool isObjectRegistered (const ValueType o) const
 Determine if a given object is registered.
 NameServer ()
 Construct an empty NameServer.
 NameServer ()
 Construct an empty NameServer.
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 not be overwritten, and this call is a no-op.
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 not be overwritten, and this call is a no-op.
void unregisterName (const NameType &name)
 Remove a name from the nameserver registrations.
void unregisterName (const NameType &name)
 Remove a name from the nameserver registrations.
void unregisterObject (const ValueType obj)
 Remove an object from the nameserver registrations.
void unregisterObject (const ValueType obj)
 Remove an object from the nameserver registrations.
 ~NameServer ()
 Destruct a nameserver.
 ~NameServer ()
 Destruct a nameserver.

Private Attributes

Rep objects

Static Private Attributes

static NameType NoName

Detailed Description

template<class _ValueType>
class RTT::dev::NameServer< _ValueType >

A nameserver for Orocos Device classes.

This class allows to globally set up device driver objects and find them back in the same process by querying this class. Every Orocos device driver type has a Device::nameserver type which allows retrieval of the object:

     // At application startup code:
     Device* init_device = new Device("device_name");
     // ...
     // In other places:
     Device* myDevice = Device::nameserver.getObject("device_name");
     

In case two objects are registered with the same name, the first one is kept and the second one rejected.

Parameters:
_ValueType The type of objects you want to have nameserved( usually a pointer type ).

Definition at line 71 of file install/include/rtt/extras/dev/NameServer.hpp.


Member Typedef Documentation

template<class _ValueType>
typedef Rep::const_iterator RTT::dev::NameServer< _ValueType >::const_iterator

The const_iterator for iterating over the internal representation

Definition at line 84 of file rtt/extras/dev/NameServer.hpp.

template<class _ValueType>
typedef Rep::const_iterator RTT::dev::NameServer< _ValueType >::const_iterator

The const_iterator for iterating over the internal representation

Definition at line 84 of file install/include/rtt/extras/dev/NameServer.hpp.

template<class _ValueType>
typedef Rep::iterator RTT::dev::NameServer< _ValueType >::iterator

The iterator for iterating over the internal representation

Definition at line 80 of file rtt/extras/dev/NameServer.hpp.

template<class _ValueType>
typedef Rep::iterator RTT::dev::NameServer< _ValueType >::iterator

The iterator for iterating over the internal representation

Definition at line 80 of file install/include/rtt/extras/dev/NameServer.hpp.

template<class _ValueType>
typedef std::string RTT::dev::NameServer< _ValueType >::NameType

Definition at line 75 of file rtt/extras/dev/NameServer.hpp.

template<class _ValueType>
typedef std::string RTT::dev::NameServer< _ValueType >::NameType
template<class _ValueType>
typedef std::map<NameType, ValueType> RTT::dev::NameServer< _ValueType >::Rep

Definition at line 76 of file rtt/extras/dev/NameServer.hpp.

template<class _ValueType>
typedef std::map<NameType, ValueType> RTT::dev::NameServer< _ValueType >::Rep
template<class _ValueType>
typedef _ValueType RTT::dev::NameServer< _ValueType >::ValueType

Definition at line 74 of file rtt/extras/dev/NameServer.hpp.

template<class _ValueType>
typedef _ValueType RTT::dev::NameServer< _ValueType >::ValueType

Constructor & Destructor Documentation

template<class _ValueType>
RTT::dev::NameServer< _ValueType >::NameServer (  )  [inline]

Construct an empty NameServer.

Definition at line 89 of file install/include/rtt/extras/dev/NameServer.hpp.

template<class _ValueType>
RTT::dev::NameServer< _ValueType >::~NameServer (  )  [inline]

Destruct a nameserver.

Definition at line 95 of file install/include/rtt/extras/dev/NameServer.hpp.

template<class _ValueType>
RTT::dev::NameServer< _ValueType >::NameServer (  )  [inline]

Construct an empty NameServer.

Definition at line 89 of file rtt/extras/dev/NameServer.hpp.

template<class _ValueType>
RTT::dev::NameServer< _ValueType >::~NameServer (  )  [inline]

Destruct a nameserver.

Definition at line 95 of file rtt/extras/dev/NameServer.hpp.


Member Function Documentation

template<class _ValueType>
const NameType& RTT::dev::NameServer< _ValueType >::getName ( const ValueType  s  )  const [inline]

Get the name registered for a object.

Parameters:
s the object of the name you need
Returns:
the name the object is registered with, if the object isn't registered, it will return 0

Definition at line 153 of file rtt/extras/dev/NameServer.hpp.

template<class _ValueType>
const NameType& RTT::dev::NameServer< _ValueType >::getName ( const ValueType  s  )  const [inline]

Get the name registered for a object.

Parameters:
s the object of the name you need
Returns:
the name the object is registered with, if the object isn't registered, it will return 0

Definition at line 153 of file install/include/rtt/extras/dev/NameServer.hpp.

template<class _ValueType>
name_iterator RTT::dev::NameServer< _ValueType >::getNameBegin (  )  [inline]

Get an iterator to the beginning of the names list.

Definition at line 368 of file rtt/extras/dev/NameServer.hpp.

template<class _ValueType>
name_iterator RTT::dev::NameServer< _ValueType >::getNameBegin (  )  [inline]

Get an iterator to the beginning of the names list.

Definition at line 368 of file install/include/rtt/extras/dev/NameServer.hpp.

template<class _ValueType>
name_iterator RTT::dev::NameServer< _ValueType >::getNameEnd (  )  [inline]

Get an iterator to the end of the names list.

Definition at line 373 of file rtt/extras/dev/NameServer.hpp.

template<class _ValueType>
name_iterator RTT::dev::NameServer< _ValueType >::getNameEnd (  )  [inline]

Get an iterator to the end of the names list.

Definition at line 373 of file install/include/rtt/extras/dev/NameServer.hpp.

template<class _ValueType>
ValueType RTT::dev::NameServer< _ValueType >::getObject ( const NameType s  )  const [inline]

Get the object registered for a name.

Parameters:
s the name of the object you need
Returns:
the object the name is registered with, if the name isn't registered, it will return 0

Definition at line 136 of file rtt/extras/dev/NameServer.hpp.

template<class _ValueType>
ValueType RTT::dev::NameServer< _ValueType >::getObject ( const NameType s  )  const [inline]

Get the object registered for a name.

Parameters:
s the name of the object you need
Returns:
the object the name is registered with, if the name isn't registered, it will return 0

Definition at line 136 of file install/include/rtt/extras/dev/NameServer.hpp.

template<class _ValueType>
value_iterator RTT::dev::NameServer< _ValueType >::getValueBegin (  )  [inline]

Get an iterator to the beginning of the objects list.

Definition at line 378 of file rtt/extras/dev/NameServer.hpp.

template<class _ValueType>
value_iterator RTT::dev::NameServer< _ValueType >::getValueBegin (  )  [inline]

Get an iterator to the beginning of the objects list.

Definition at line 378 of file install/include/rtt/extras/dev/NameServer.hpp.

template<class _ValueType>
value_iterator RTT::dev::NameServer< _ValueType >::getValueEnd (  )  [inline]

Get an iterator to the end of the objects list.

Definition at line 383 of file rtt/extras/dev/NameServer.hpp.

template<class _ValueType>
value_iterator RTT::dev::NameServer< _ValueType >::getValueEnd (  )  [inline]

Get an iterator to the end of the objects list.

Definition at line 383 of file install/include/rtt/extras/dev/NameServer.hpp.

template<class _ValueType>
bool RTT::dev::NameServer< _ValueType >::isNameRegistered ( const NameType s  )  const [inline]

Determine if a given name is registered.

Parameters:
s the name to check
Returns:
true if s is registered, false otherwise

Definition at line 105 of file rtt/extras/dev/NameServer.hpp.

template<class _ValueType>
bool RTT::dev::NameServer< _ValueType >::isNameRegistered ( const NameType s  )  const [inline]

Determine if a given name is registered.

Parameters:
s the name to check
Returns:
true if s is registered, false otherwise

Definition at line 105 of file install/include/rtt/extras/dev/NameServer.hpp.

template<class _ValueType>
bool RTT::dev::NameServer< _ValueType >::isObjectRegistered ( const ValueType  o  )  const [inline]

Determine if a given object is registered.

Parameters:
o the object to check
Returns:
true if o is registered, false otherwise

Definition at line 117 of file rtt/extras/dev/NameServer.hpp.

template<class _ValueType>
bool RTT::dev::NameServer< _ValueType >::isObjectRegistered ( const ValueType  o  )  const [inline]

Determine if a given object is registered.

Parameters:
o the object to check
Returns:
true if o is registered, false otherwise

Definition at line 117 of file install/include/rtt/extras/dev/NameServer.hpp.

template<class _ValueType>
bool RTT::dev::NameServer< _ValueType >::registerObject ( const ValueType  obj,
const NameType name 
) [inline]

Register an object with a name. If an object with such a name already exists, the present one will not be overwritten, and this call is a no-op.

Parameters:
obj The instance you wish to register with a name
name The name of the object

Definition at line 172 of file rtt/extras/dev/NameServer.hpp.

template<class _ValueType>
bool RTT::dev::NameServer< _ValueType >::registerObject ( const ValueType  obj,
const NameType name 
) [inline]

Register an object with a name. If an object with such a name already exists, the present one will not be overwritten, and this call is a no-op.

Parameters:
obj The instance you wish to register with a name
name The name of the object

Definition at line 172 of file install/include/rtt/extras/dev/NameServer.hpp.

template<class _ValueType>
void RTT::dev::NameServer< _ValueType >::unregisterName ( const NameType name  )  [inline]

Remove a name from the nameserver registrations.

Parameters:
name the name of the object you want remove

Definition at line 221 of file rtt/extras/dev/NameServer.hpp.

template<class _ValueType>
void RTT::dev::NameServer< _ValueType >::unregisterName ( const NameType name  )  [inline]

Remove a name from the nameserver registrations.

Parameters:
name the name of the object you want remove

Definition at line 221 of file install/include/rtt/extras/dev/NameServer.hpp.

template<class _ValueType>
void RTT::dev::NameServer< _ValueType >::unregisterObject ( const ValueType  obj  )  [inline]

Remove an object from the nameserver registrations.

Parameters:
obj the object you want removed
Postcondition:
obj will not be registered anymore

Todo:
might be improved by using equal_range

Definition at line 190 of file rtt/extras/dev/NameServer.hpp.

template<class _ValueType>
void RTT::dev::NameServer< _ValueType >::unregisterObject ( const ValueType  obj  )  [inline]

Remove an object from the nameserver registrations.

Parameters:
obj the object you want removed
Postcondition:
obj will not be registered anymore

Todo:
might be improved by using equal_range

Definition at line 190 of file install/include/rtt/extras/dev/NameServer.hpp.


Member Data Documentation

template<class _ValueType>
std::string RTT::dev::NameServer< T >::NoName [inline, static, private]
template<class _ValueType>
Rep RTT::dev::NameServer< _ValueType >::objects [private]

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


rtt
Author(s): RTT Developers
autogenerated on Fri Jan 11 09:49:55 2013