YARP  2.3.68+225-20170329.5+gitb0d3289
Yet Another Robot Platform
yarp::os::NameSpace Class Referenceabstract

An abstract name space for ports. More...

#include <yarp/os/NameSpace.h>

+ Inheritance diagram for yarp::os::NameSpace:

Public Member Functions

virtual ~NameSpace ()
 Destructor. More...
 
virtual bool checkNetwork ()
 Check if name space is available. More...
 
virtual bool checkNetwork (double timeout)
 Check if name space is available, with a timeout on any network operations needed. More...
 
virtual Contact getNameServerContact () const =0
 Get an address for a name server that manages the name space, if available. More...
 
virtual ConstString getNameServerName () const
 Get the port name of a name server that manages the name space, if available. More...
 
virtual Contact queryName (const ConstString &name)=0
 Map from port name to contact information. More...
 
virtual Contact registerName (const ConstString &name)=0
 Record contact information to tie to a port name. More...
 
virtual Contact registerContact (const Contact &contact)=0
 Record contact information (should include a port name). More...
 
virtual Contact unregisterName (const ConstString &name)=0
 Disassociate contact information from a port name. More...
 
virtual Contact unregisterContact (const Contact &contact)=0
 Disassociate contact information (should include a port name). More...
 
virtual Contact registerAdvanced (const Contact &contact, NameStore *store)
 Record contact information, with access to the contact information of other ports for cross-referencing. More...
 
virtual Contact unregisterAdvanced (const ConstString &name, NameStore *store)
 Remove contact information, with access to the contact information of other ports for cross-referencing. More...
 
virtual bool setProperty (const ConstString &name, const ConstString &key, const Value &value)=0
 Associate a key/value pair with a named port. More...
 
virtual ValuegetProperty (const ConstString &name, const ConstString &key)=0
 Get the value of a named key from a named port. More...
 
virtual bool connectPortToTopic (const Contact &src, const Contact &dest, ContactStyle style)=0
 Publish a port to a topic. More...
 
virtual bool connectTopicToPort (const Contact &src, const Contact &dest, ContactStyle style)=0
 Subscribe a port to a topic. More...
 
virtual bool disconnectPortFromTopic (const Contact &src, const Contact &dest, ContactStyle style)=0
 Stop publishing a port to a topic. More...
 
virtual bool disconnectTopicFromPort (const Contact &src, const Contact &dest, ContactStyle style)=0
 Stop subscribing a port to a topic. More...
 
virtual bool connectPortToPortPersistently (const Contact &src, const Contact &dest, ContactStyle style)=0
 Connect two ports with persistence. More...
 
virtual bool disconnectPortToPortPersistently (const Contact &src, const Contact &dest, ContactStyle style)=0
 Disconnect two ports, removing any persistence. More...
 
virtual bool localOnly () const =0
 Check if the NameSpace is only valid for the current process ("local"). More...
 
virtual bool usesCentralServer () const =0
 Check if a central server is involved in managing the NameSpace. More...
 
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. More...
 
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? More...
 
virtual Contact detectNameServer (bool useDetectedServer, bool &scanNeeded, bool &serverUsed)=0
 Find a name server for this NameSpace, if applicable. More...
 
virtual bool writeToNameServer (PortWriter &cmd, PortReader &reply, const ContactStyle &style)=0
 Write a message to a name server for this NameSpace, if applicable. More...
 

Detailed Description

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 28 of file NameSpace.h.

Constructor & Destructor Documentation

◆ ~NameSpace()

NameSpace::~NameSpace ( )
virtual

Destructor.

Definition at line 15 of file NameSpace.cpp.

Member Function Documentation

◆ checkNetwork() [1/2]

bool NameSpace::checkNetwork ( )
virtual

Check if name space is available.

Definition at line 18 of file NameSpace.cpp.

◆ checkNetwork() [2/2]

bool NameSpace::checkNetwork ( double  timeout)
virtual

Check if name space is available, with a timeout on any network operations needed.

If the timeout occurs, we assume the name space is not available.

Definition at line 36 of file NameSpace.cpp.

◆ connectionHasNameOfEndpoints()

virtual bool yarp::os::NameSpace::connectionHasNameOfEndpoints ( ) const
pure virtual

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::YarpNameSpace, yarp::os::RosNameSpace, and yarp::os::MultiNameSpace.

◆ connectPortToPortPersistently()

virtual bool yarp::os::NameSpace::connectPortToPortPersistently ( const Contact src,
const Contact dest,
ContactStyle  style 
)
pure virtual

Connect two ports with persistence.

Implemented in yarp::os::YarpNameSpace, yarp::os::MultiNameSpace, and yarp::os::RosNameSpace.

◆ connectPortToTopic()

virtual bool yarp::os::NameSpace::connectPortToTopic ( const Contact src,
const Contact dest,
ContactStyle  style 
)
pure virtual

Publish a port to a topic.

Implemented in yarp::os::RosNameSpace, yarp::os::MultiNameSpace, and yarp::os::YarpNameSpace.

◆ connectTopicToPort()

virtual bool yarp::os::NameSpace::connectTopicToPort ( const Contact src,
const Contact dest,
ContactStyle  style 
)
pure virtual

Subscribe a port to a topic.

Implemented in yarp::os::RosNameSpace, yarp::os::YarpNameSpace, and yarp::os::MultiNameSpace.

◆ detectNameServer()

virtual Contact yarp::os::NameSpace::detectNameServer ( bool  useDetectedServer,
bool &  scanNeeded,
bool &  serverUsed 
)
pure virtual

Find a name server for this NameSpace, if applicable.

Parameters
useDetectedServeruse any server found for future queries.
scanNeededset to true if a search was needed, rather than finding a name server based on cached hints.
serverUsedset to true if a server was found and marked for use in future queries.

Implemented in yarp::os::YarpNameSpace, yarp::os::MultiNameSpace, and yarp::os::RosNameSpace.

◆ disconnectPortFromTopic()

virtual bool yarp::os::NameSpace::disconnectPortFromTopic ( const Contact src,
const Contact dest,
ContactStyle  style 
)
pure virtual

Stop publishing a port to a topic.

Implemented in yarp::os::YarpNameSpace, yarp::os::RosNameSpace, and yarp::os::MultiNameSpace.

◆ disconnectPortToPortPersistently()

virtual bool yarp::os::NameSpace::disconnectPortToPortPersistently ( const Contact src,
const Contact dest,
ContactStyle  style 
)
pure virtual

Disconnect two ports, removing any persistence.

Implemented in yarp::os::YarpNameSpace, yarp::os::MultiNameSpace, and yarp::os::RosNameSpace.

◆ disconnectTopicFromPort()

virtual bool yarp::os::NameSpace::disconnectTopicFromPort ( const Contact src,
const Contact dest,
ContactStyle  style 
)
pure virtual

Stop subscribing a port to a topic.

Implemented in yarp::os::YarpNameSpace, yarp::os::MultiNameSpace, and yarp::os::RosNameSpace.

◆ getNameServerContact()

virtual Contact yarp::os::NameSpace::getNameServerContact ( ) const
pure virtual

Get an address for a name server that manages the name space, if available.

Implemented in yarp::os::YarpDummyNameSpace, yarp::os::RosNameSpace, yarp::os::MultiNameSpace, and yarp::os::YarpNameSpace.

◆ getNameServerName()

ConstString NameSpace::getNameServerName ( ) const
virtual

Get the port name of a name server that manages the name space, if available.

Definition at line 53 of file NameSpace.cpp.

◆ getProperty()

virtual Value* yarp::os::NameSpace::getProperty ( const ConstString name,
const ConstString key 
)
pure virtual

Get the value of a named key from a named port.

Returns
YARP_NULLPTR if no value was set for the named key.

Implemented in yarp::os::RosNameSpace, yarp::os::MultiNameSpace, and yarp::os::YarpNameSpace.

◆ localOnly()

virtual bool yarp::os::NameSpace::localOnly ( ) const
pure virtual

Check if the NameSpace is only valid for the current process ("local").

Implemented in yarp::os::YarpDummyNameSpace, yarp::os::YarpNameSpace, yarp::os::RosNameSpace, and yarp::os::MultiNameSpace.

◆ queryName()

virtual Contact yarp::os::NameSpace::queryName ( const ConstString name)
pure virtual

Map from port name to contact information.

Implemented in yarp::os::RosNameSpace, yarp::os::MultiNameSpace, and yarp::os::YarpNameSpace.

◆ registerAdvanced()

virtual Contact yarp::os::NameSpace::registerAdvanced ( const Contact contact,
NameStore store 
)
inlinevirtual

Record contact information, with access to the contact information of other ports for cross-referencing.

Parameters
contactthe contact information to record
storean 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 116 of file NameSpace.h.

◆ registerContact()

virtual Contact yarp::os::NameSpace::registerContact ( const Contact contact)
pure virtual

Record contact information (should include a port name).

Implemented in yarp::os::MultiNameSpace, yarp::os::YarpNameSpace, and yarp::os::RosNameSpace.

◆ registerName()

virtual Contact yarp::os::NameSpace::registerName ( const ConstString name)
pure virtual

Record contact information to tie to a port name.

Implemented in yarp::os::MultiNameSpace, yarp::os::RosNameSpace, and yarp::os::YarpNameSpace.

◆ serverAllocatesPortNumbers()

virtual bool yarp::os::NameSpace::serverAllocatesPortNumbers ( ) const
pure virtual

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::YarpNameSpace, yarp::os::RosNameSpace, and yarp::os::MultiNameSpace.

◆ setProperty()

virtual bool yarp::os::NameSpace::setProperty ( const ConstString name,
const ConstString key,
const Value value 
)
pure virtual

Associate a key/value pair with a named port.

Implemented in yarp::os::RosNameSpace, yarp::os::MultiNameSpace, and yarp::os::YarpNameSpace.

◆ unregisterAdvanced()

virtual Contact yarp::os::NameSpace::unregisterAdvanced ( const ConstString name,
NameStore store 
)
inlinevirtual

Remove contact information, with access to the contact information of other ports for cross-referencing.

Reimplemented in yarp::os::RosNameSpace.

Definition at line 127 of file NameSpace.h.

◆ unregisterContact()

virtual Contact yarp::os::NameSpace::unregisterContact ( const Contact contact)
pure virtual

Disassociate contact information (should include a port name).

Implemented in yarp::os::MultiNameSpace, yarp::os::YarpNameSpace, and yarp::os::RosNameSpace.

◆ unregisterName()

virtual Contact yarp::os::NameSpace::unregisterName ( const ConstString name)
pure virtual

Disassociate contact information from a port name.

Implemented in yarp::os::MultiNameSpace, yarp::os::YarpNameSpace, and yarp::os::RosNameSpace.

◆ usesCentralServer()

virtual bool yarp::os::NameSpace::usesCentralServer ( ) const
pure virtual

Check if a central server is involved in managing the NameSpace.

Implemented in yarp::os::YarpNameSpace, yarp::os::RosNameSpace, and yarp::os::MultiNameSpace.

◆ writeToNameServer()

virtual bool yarp::os::NameSpace::writeToNameServer ( PortWriter cmd,
PortReader reply,
const ContactStyle style 
)
pure virtual

Write a message to a name server for this NameSpace, if applicable.

Messages are name-server-specific.

Implemented in yarp::os::YarpNameSpace, yarp::os::MultiNameSpace, and yarp::os::RosNameSpace.


The documentation for this class was generated from the following files: