An abstract name space for ports. More...
#include <yarp/os/NameSpace.h>
Public Member Functions | |
virtual | ~NameSpace () |
Destructor. | |
virtual bool | checkNetwork () |
Check if a name space is available. | |
virtual bool | checkNetwork (double timeout) |
Check if a name space is available, with a timeout on any network operations needed. | |
virtual Contact | getNameServerContact () const =0 |
Get an address for a name server that manages the name space, if available. | |
virtual std::string | getNameServerName () const |
Get the port name of a name server that manages the name space, if available. | |
virtual Contact | queryName (const std::string &name)=0 |
Map from port name to contact information. | |
virtual Contact | registerName (const std::string &name)=0 |
Record contact information to tie to a port name. | |
virtual Contact | registerContact (const Contact &contact)=0 |
Record contact information (should include a port name). | |
virtual Contact | unregisterName (const std::string &name)=0 |
Disassociate contact information from a port name. | |
virtual Contact | unregisterContact (const Contact &contact)=0 |
Disassociate contact information (should include a port name). | |
virtual Contact | registerAdvanced (const Contact &contact, NameStore *store) |
Record contact information, with access to the contact information of other ports for cross-referencing. | |
virtual Contact | unregisterAdvanced (const std::string &name, NameStore *store) |
Remove contact information, with access to the contact information of other ports for cross-referencing. | |
virtual bool | setProperty (const std::string &name, const std::string &key, const Value &value)=0 |
Associate a key/value pair with a named port. | |
virtual Value * | getProperty (const std::string &name, const std::string &key)=0 |
Get the value of a named key from a named port. | |
virtual bool | connectPortToTopic (const Contact &src, const Contact &dest, const ContactStyle &style)=0 |
Publish a port to a topic. | |
virtual bool | connectTopicToPort (const Contact &src, const Contact &dest, const ContactStyle &style)=0 |
Subscribe a port to a topic. | |
virtual bool | disconnectPortFromTopic (const Contact &src, const Contact &dest, const ContactStyle &style)=0 |
Stop publishing a port to a topic. | |
virtual bool | disconnectTopicFromPort (const Contact &src, const Contact &dest, const ContactStyle &style)=0 |
Stop subscribing a port to a topic. | |
virtual bool | connectPortToPortPersistently (const Contact &src, const Contact &dest, const ContactStyle &style)=0 |
Connect two ports with persistence. | |
virtual bool | disconnectPortToPortPersistently (const Contact &src, const Contact &dest, const ContactStyle &style)=0 |
Disconnect two ports, removing any persistence. | |
virtual bool | localOnly () const =0 |
Check if the NameSpace is only valid for the current process ("local"). | |
virtual bool | usesCentralServer () const =0 |
Check if a central server is involved in managing the NameSpace. | |
virtual bool | serverAllocatesPortNumbers () const =0 |
Check if a central server is responsible for allocating port numbers, or if this should be left up to the operating system. | |
virtual bool | connectionHasNameOfEndpoints () const =0 |
When connections are made involving ports managed by this NameSpace do the ports involved end up knowing the names of their counterparties? | |
virtual Contact | detectNameServer (bool useDetectedServer, bool &scanNeeded, bool &serverUsed)=0 |
Find a name server for this NameSpace, if applicable. | |
virtual bool | writeToNameServer (PortWriter &cmd, PortReader &reply, const ContactStyle &style)=0 |
Write a message to a name server for this NameSpace, if applicable. | |
An abstract name space for ports.
This collects all the services we may ask of a name server, to simplify plugging in alternate implementations.
Definition at line 21 of file NameSpace.h.
|
virtualdefault |
Destructor.
|
virtual |
Check if a name space is available.
Definition at line 17 of file NameSpace.cpp.
Check if a name space is available, with a timeout on any network operations needed.
If the timeout occurs, we assume the name space is not available.
[in] | timeout | time in seconds to wait for a response in any network operation needed. |
Definition at line 40 of file NameSpace.cpp.
When connections are made involving ports managed by this NameSpace do the ports involved end up knowing the names of their counterparties?
Implemented in yarp::os::MultiNameSpace, yarp::os::RosNameSpace, and yarp::os::YarpNameSpace.
|
pure virtual |
Connect two ports with persistence.
Implemented in yarp::os::MultiNameSpace, yarp::os::RosNameSpace, and yarp::os::YarpNameSpace.
|
pure virtual |
Publish a port to a topic.
Implemented in yarp::os::MultiNameSpace, yarp::os::RosNameSpace, and yarp::os::YarpNameSpace.
|
pure virtual |
Subscribe a port to a topic.
Implemented in yarp::os::MultiNameSpace, yarp::os::RosNameSpace, and yarp::os::YarpNameSpace.
|
pure virtual |
Find a name server for this NameSpace, if applicable.
useDetectedServer | use any server found for future queries. |
scanNeeded | set to true if a search was needed, rather than finding a name server based on cached hints. |
serverUsed | set to true if a server was found and marked for use in future queries. |
Implemented in yarp::os::MultiNameSpace, yarp::os::RosNameSpace, and yarp::os::YarpNameSpace.
|
pure virtual |
Stop publishing a port to a topic.
Implemented in yarp::os::MultiNameSpace, yarp::os::RosNameSpace, and yarp::os::YarpNameSpace.
|
pure virtual |
Disconnect two ports, removing any persistence.
Implemented in yarp::os::MultiNameSpace, yarp::os::RosNameSpace, and yarp::os::YarpNameSpace.
|
pure virtual |
Stop subscribing a port to a topic.
Implemented in yarp::os::MultiNameSpace, yarp::os::RosNameSpace, and yarp::os::YarpNameSpace.
Get an address for a name server that manages the name space, if available.
Implemented in yarp::os::MultiNameSpace, yarp::os::RosNameSpace, yarp::os::YarpNameSpace, and yarp::os::YarpDummyNameSpace.
|
virtual |
Get the port name of a name server that manages the name space, if available.
Definition at line 64 of file NameSpace.cpp.
|
pure virtual |
Get the value of a named key from a named port.
Implemented in yarp::os::MultiNameSpace, yarp::os::RosNameSpace, and yarp::os::YarpNameSpace.
Check if the NameSpace is only valid for the current process ("local").
Implemented in yarp::os::MultiNameSpace, yarp::os::RosNameSpace, yarp::os::YarpNameSpace, and yarp::os::YarpDummyNameSpace.
Map from port name to contact information.
Implemented in yarp::os::MultiNameSpace, yarp::os::RosNameSpace, and yarp::os::YarpNameSpace.
|
inlinevirtual |
Record contact information, with access to the contact information of other ports for cross-referencing.
contact | the contact information to record |
store | an interface to port information as presented via the YARP client API (as opposed to what a single NameSpace would have access to). |
Reimplemented in yarp::os::RosNameSpace.
Definition at line 92 of file NameSpace.h.
Record contact information (should include a port name).
Implemented in yarp::os::MultiNameSpace, yarp::os::RosNameSpace, and yarp::os::YarpNameSpace.
Record contact information to tie to a port name.
Implemented in yarp::os::MultiNameSpace, yarp::os::RosNameSpace, and yarp::os::YarpNameSpace.
Check if a central server is responsible for allocating port numbers, or if this should be left up to the operating system.
Implemented in yarp::os::MultiNameSpace, yarp::os::RosNameSpace, and yarp::os::YarpNameSpace.
|
pure virtual |
Associate a key/value pair with a named port.
Implemented in yarp::os::MultiNameSpace, yarp::os::RosNameSpace, and yarp::os::YarpNameSpace.
|
inlinevirtual |
Remove contact information, with access to the contact information of other ports for cross-referencing.
Reimplemented in yarp::os::RosNameSpace.
Definition at line 103 of file NameSpace.h.
Disassociate contact information (should include a port name).
Implemented in yarp::os::MultiNameSpace, yarp::os::RosNameSpace, and yarp::os::YarpNameSpace.
Disassociate contact information from a port name.
Implemented in yarp::os::MultiNameSpace, yarp::os::RosNameSpace, and yarp::os::YarpNameSpace.
Check if a central server is involved in managing the NameSpace.
Implemented in yarp::os::MultiNameSpace, yarp::os::RosNameSpace, and yarp::os::YarpNameSpace.
|
pure virtual |
Write a message to a name server for this NameSpace, if applicable.
Messages are name-server-specific.
Implemented in yarp::os::MultiNameSpace, yarp::os::RosNameSpace, and yarp::os::YarpNameSpace.