YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
yarp::os::YarpNameSpace Class Reference

#include <yarp/os/YarpNameSpace.h>

+ Inheritance diagram for yarp::os::YarpNameSpace:

Public Member Functions

 YarpNameSpace (const Contact &contact)
 
virtual ~YarpNameSpace ()
 
Contact getNameServerContact () const override
 Get an address for a name server that manages the name space, if available.
 
Contact queryName (const std::string &name) override
 Map from port name to contact information.
 
Contact registerName (const std::string &name) override
 Record contact information to tie to a port name.
 
Contact registerContact (const Contact &contact) override
 Record contact information (should include a port name).
 
Contact unregisterName (const std::string &name) override
 Disassociate contact information from a port name.
 
Contact unregisterContact (const Contact &contact) override
 Disassociate contact information (should include a port name).
 
virtual bool setProperty (const std::string &name, const std::string &key, const Value &value) override
 Associate a key/value pair with a named port.
 
virtual ValuegetProperty (const std::string &name, const std::string &key) override
 Get the value of a named key from a named port.
 
virtual bool connectPortToTopic (const Contact &src, const Contact &dest, const ContactStyle &style) override
 Publish a port to a topic.
 
virtual bool connectTopicToPort (const Contact &src, const Contact &dest, const ContactStyle &style) override
 Subscribe a port to a topic.
 
virtual bool disconnectPortFromTopic (const Contact &src, const Contact &dest, const ContactStyle &style) override
 Stop publishing a port to a topic.
 
virtual bool disconnectTopicFromPort (const Contact &src, const Contact &dest, const ContactStyle &style) override
 Stop subscribing a port to a topic.
 
virtual bool connectPortToPortPersistently (const Contact &src, const Contact &dest, const ContactStyle &style) override
 Connect two ports with persistence.
 
virtual bool disconnectPortToPortPersistently (const Contact &src, const Contact &dest, const ContactStyle &style) override
 Disconnect two ports, removing any persistence.
 
virtual bool connectTopic (const std::string &dir, bool srcIsTopic, bool destIsTopic, const Contact &src, const Contact &dest, const ContactStyle &style)
 
bool localOnly () const override
 Check if the NameSpace is only valid for the current process ("local").
 
bool usesCentralServer () const override
 Check if a central server is involved in managing the NameSpace.
 
bool serverAllocatesPortNumbers () const override
 Check if a central server is responsible for allocating port numbers, or if this should be left up to the operating system.
 
bool connectionHasNameOfEndpoints () const override
 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) override
 Find a name server for this NameSpace, if applicable.
 
virtual bool writeToNameServer (PortWriter &cmd, PortReader &reply, const ContactStyle &style) override
 Write a message to a name server for this NameSpace, if applicable.
 
- Public Member Functions inherited from yarp::os::NameSpace
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 std::string getNameServerName () const
 Get the port name of a name server that manages the name space, if available.
 
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.
 

Detailed Description

Definition at line 15 of file YarpNameSpace.h.

Constructor & Destructor Documentation

◆ YarpNameSpace()

YarpNameSpace::YarpNameSpace ( const Contact contact)

Definition at line 25 of file YarpNameSpace.cpp.

◆ ~YarpNameSpace()

YarpNameSpace::~YarpNameSpace ( )
virtual

Definition at line 33 of file YarpNameSpace.cpp.

Member Function Documentation

◆ connectionHasNameOfEndpoints()

bool yarp::os::YarpNameSpace::connectionHasNameOfEndpoints ( ) const
inlineoverridevirtual

When connections are made involving ports managed by this NameSpace do the ports involved end up knowing the names of their counterparties?

Implements yarp::os::NameSpace.

Definition at line 150 of file YarpNameSpace.h.

◆ connectPortToPortPersistently()

virtual bool yarp::os::YarpNameSpace::connectPortToPortPersistently ( const Contact src,
const Contact dest,
const ContactStyle style 
)
inlineoverridevirtual

Connect two ports with persistence.

Implements yarp::os::NameSpace.

Definition at line 72 of file YarpNameSpace.h.

◆ connectPortToTopic()

virtual bool yarp::os::YarpNameSpace::connectPortToTopic ( const Contact src,
const Contact dest,
const ContactStyle style 
)
inlineoverridevirtual

Publish a port to a topic.

Implements yarp::os::NameSpace.

Definition at line 44 of file YarpNameSpace.h.

◆ connectTopic()

virtual bool yarp::os::YarpNameSpace::connectTopic ( const std::string &  dir,
bool  srcIsTopic,
bool  destIsTopic,
const Contact src,
const Contact dest,
const ContactStyle style 
)
inlinevirtual

Definition at line 86 of file YarpNameSpace.h.

◆ connectTopicToPort()

virtual bool yarp::os::YarpNameSpace::connectTopicToPort ( const Contact src,
const Contact dest,
const ContactStyle style 
)
inlineoverridevirtual

Subscribe a port to a topic.

Implements yarp::os::NameSpace.

Definition at line 51 of file YarpNameSpace.h.

◆ detectNameServer()

Contact YarpNameSpace::detectNameServer ( bool  useDetectedServer,
bool scanNeeded,
bool serverUsed 
)
overridevirtual

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.

Implements yarp::os::NameSpace.

Definition at line 141 of file YarpNameSpace.cpp.

◆ disconnectPortFromTopic()

virtual bool yarp::os::YarpNameSpace::disconnectPortFromTopic ( const Contact src,
const Contact dest,
const ContactStyle style 
)
inlineoverridevirtual

Stop publishing a port to a topic.

Implements yarp::os::NameSpace.

Definition at line 58 of file YarpNameSpace.h.

◆ disconnectPortToPortPersistently()

virtual bool yarp::os::YarpNameSpace::disconnectPortToPortPersistently ( const Contact src,
const Contact dest,
const ContactStyle style 
)
inlineoverridevirtual

Disconnect two ports, removing any persistence.

Implements yarp::os::NameSpace.

Definition at line 79 of file YarpNameSpace.h.

◆ disconnectTopicFromPort()

virtual bool yarp::os::YarpNameSpace::disconnectTopicFromPort ( const Contact src,
const Contact dest,
const ContactStyle style 
)
inlineoverridevirtual

Stop subscribing a port to a topic.

Implements yarp::os::NameSpace.

Definition at line 65 of file YarpNameSpace.h.

◆ getNameServerContact()

Contact yarp::os::YarpNameSpace::getNameServerContact ( ) const
inlineoverridevirtual

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

Implements yarp::os::NameSpace.

Definition at line 22 of file YarpNameSpace.h.

◆ getProperty()

Value * YarpNameSpace::getProperty ( const std::string &  name,
const std::string &  key 
)
overridevirtual

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

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

Implements yarp::os::NameSpace.

Definition at line 128 of file YarpNameSpace.cpp.

◆ localOnly()

bool yarp::os::YarpNameSpace::localOnly ( ) const
inlineoverridevirtual

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

Implements yarp::os::NameSpace.

Definition at line 135 of file YarpNameSpace.h.

◆ queryName()

Contact YarpNameSpace::queryName ( const std::string &  name)
overridevirtual

Map from port name to contact information.

Implements yarp::os::NameSpace.

Definition at line 41 of file YarpNameSpace.cpp.

◆ registerContact()

Contact YarpNameSpace::registerContact ( const Contact contact)
overridevirtual

Record contact information (should include a port name).

Implements yarp::os::NameSpace.

Definition at line 53 of file YarpNameSpace.cpp.

◆ registerName()

Contact YarpNameSpace::registerName ( const std::string &  name)
overridevirtual

Record contact information to tie to a port name.

Implements yarp::os::NameSpace.

Definition at line 48 of file YarpNameSpace.cpp.

◆ serverAllocatesPortNumbers()

bool yarp::os::YarpNameSpace::serverAllocatesPortNumbers ( ) const
inlineoverridevirtual

Check if a central server is responsible for allocating port numbers, or if this should be left up to the operating system.

Implements yarp::os::NameSpace.

Definition at line 145 of file YarpNameSpace.h.

◆ setProperty()

bool YarpNameSpace::setProperty ( const std::string &  name,
const std::string &  key,
const Value value 
)
overridevirtual

Associate a key/value pair with a named port.

Implements yarp::os::NameSpace.

Definition at line 114 of file YarpNameSpace.cpp.

◆ unregisterContact()

Contact YarpNameSpace::unregisterContact ( const Contact contact)
overridevirtual

Disassociate contact information (should include a port name).

Implements yarp::os::NameSpace.

Definition at line 107 of file YarpNameSpace.cpp.

◆ unregisterName()

Contact YarpNameSpace::unregisterName ( const std::string &  name)
overridevirtual

Disassociate contact information from a port name.

Implements yarp::os::NameSpace.

Definition at line 84 of file YarpNameSpace.cpp.

◆ usesCentralServer()

bool yarp::os::YarpNameSpace::usesCentralServer ( ) const
inlineoverridevirtual

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

Implements yarp::os::NameSpace.

Definition at line 140 of file YarpNameSpace.h.

◆ writeToNameServer()

bool YarpNameSpace::writeToNameServer ( PortWriter cmd,
PortReader reply,
const ContactStyle style 
)
overridevirtual

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

Messages are name-server-specific.

Implements yarp::os::NameSpace.

Definition at line 169 of file YarpNameSpace.cpp.


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