#include <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 ). |
Definition at line 71 of file NameServer.hpp.
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 () | |
| ~NameServer () | |
| bool | isNameRegistered (const NameType &s) const |
| bool | isObjectRegistered (const ValueType o) const |
| ValueType | getObject (const NameType &s) const |
| const NameType & | getName (const ValueType s) const |
| bool | registerObject (const ValueType obj, const NameType &name) |
| void | unregisterObject (const ValueType obj) |
| void | unregisterName (const NameType &name) |
| name_iterator | getNameBegin () |
| name_iterator | getNameEnd () |
| value_iterator | getValueBegin () |
| value_iterator | getValueEnd () |
Classes | |
| class | name_iterator |
| class | value_iterator |
| NameServer | ( | ) | [inline] |
Construct an empty NameServer.
Definition at line 89 of file NameServer.hpp.
| ~NameServer | ( | ) | [inline] |
Destruct a nameserver.
Definition at line 95 of file NameServer.hpp.
| bool isNameRegistered | ( | const NameType & | s | ) | const [inline] |
Determine if a given name is registered
| s | the name to check |
Definition at line 105 of file NameServer.hpp.
Referenced by NameServer< RTT::Event< SignatureT > * >::registerObject().
| bool isObjectRegistered | ( | const ValueType | o | ) | const [inline] |
Determine if a given object is registered
| o | the object to check |
Definition at line 117 of file NameServer.hpp.
Get the object registered for a name.
| s | the name of the object you need |
Definition at line 136 of file NameServer.hpp.
Get the name registered for a object.
| s | the object of the name you need |
Definition at line 153 of file NameServer.hpp.
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 |
Definition at line 172 of file NameServer.hpp.
Referenced by NameServerRegistrator< RTT::Event< SignatureT > * >::NameServerRegistrator().
| void unregisterObject | ( | const ValueType | obj | ) | [inline] |
Remove an object from the nameserver registrations.
| obj | the object you want removed |
Definition at line 190 of file NameServer.hpp.
Referenced by NameServerRegistrator< RTT::Event< SignatureT > * >::~NameServerRegistrator().
| void unregisterName | ( | const NameType & | name | ) | [inline] |
Remove a name from the nameserver registrations.
| name | the name of the object you want remove |
Definition at line 222 of file NameServer.hpp.
| name_iterator getNameBegin | ( | ) | [inline] |
Get an iterator to the beginning of the names list.
Definition at line 369 of file NameServer.hpp.
| name_iterator getNameEnd | ( | ) | [inline] |
Get an iterator to the end of the names list.
Definition at line 374 of file NameServer.hpp.
| value_iterator getValueBegin | ( | ) | [inline] |
Get an iterator to the beginning of the objects list.
Definition at line 379 of file NameServer.hpp.
| value_iterator getValueEnd | ( | ) | [inline] |
Get an iterator to the end of the objects list.
Definition at line 384 of file NameServer.hpp.
1.5.3