#include </home/sspr/src/www/orocos-1.0/export/build/orocos-rtt-1.2.2/build/rtt/NameServer.hpp>
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");
| _ValueType | The type of objects you want to have nameserved( usually a pointer type ). |
Public Types | |
| typedef _ValueType | ValueType |
| typedef std::string | NameType |
|
typedef std::map< NameType, ValueType > | Rep |
| typedef Rep::iterator | iterator |
| The iterator for iterating over the internal representation. | |
| typedef Rep::const_iterator | const_iterator |
| The const_iterator for iterating over the internal representation. | |
Public Member Functions | |
| NameServer () | |
| Construct an empty NameServer. | |
| ~NameServer () | |
| Destruct a nameserver. | |
| 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. | |
| ValueType | getObject (const NameType &s) const |
| Get the object registered for a name. | |
| const NameType & | getName (const ValueType s) const |
| Get the name registered for a object. | |
| bool | registerObject (const ValueType obj, const NameType &name) |
| Register an object with a name. | |
| void | unregisterObject (const ValueType obj) |
| Remove an object from the nameserver registrations. | |
| void | unregisterName (const NameType &name) |
| Remove a name from the nameserver registrations. | |
| 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. | |
| 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. | |
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... | |
| bool isNameRegistered | ( | const NameType & | s | ) | const [inline] |
Determine if a given name is registered.
| s | the name to check |
| bool isObjectRegistered | ( | const ValueType | o | ) | const [inline] |
Determine if a given object is registered.
| o | the object to check |
| ValueType getObject | ( | const NameType & | s | ) | const [inline] |
Get the object registered for a name.
| s | the name of the object you need |
| const NameType& getName | ( | const ValueType | s | ) | const [inline] |
Get the name registered for a object.
| s | the object of the name you need |
| bool 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.
| obj | The instance you wish to register with a name | |
| name | The name of the object |
| void unregisterObject | ( | const ValueType | obj | ) | [inline] |
Remove an object from the nameserver registrations.
| obj | the object you want removed |
| void unregisterName | ( | const NameType & | name | ) | [inline] |
Remove a name from the nameserver registrations.
| name | the name of the object you want remove |
1.5.1