YARP
Yet Another Robot Platform
yarp::os::MultiNameSpace Class Reference

#include <yarp/os/MultiNameSpace.h>

+ Inheritance diagram for yarp::os::MultiNameSpace:

Detailed Description

Definition at line 21 of file MultiNameSpace.h.

Public Member Functions

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

Private Attributes

void * system_resource
 
NameStorealtStore
 

Constructor & Destructor Documentation

◆ MultiNameSpace()

MultiNameSpace::MultiNameSpace ( )

Definition at line 200 of file MultiNameSpace.cpp.

◆ ~MultiNameSpace()

MultiNameSpace::~MultiNameSpace ( )
virtual

Definition at line 206 of file MultiNameSpace.cpp.

Member Function Documentation

◆ activate()

bool MultiNameSpace::activate ( bool  force = false)

Definition at line 245 of file MultiNameSpace.cpp.

◆ connectionHasNameOfEndpoints()

bool MultiNameSpace::connectionHasNameOfEndpoints ( ) const
overridevirtual

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 227 of file MultiNameSpace.cpp.

◆ connectPortToPortPersistently()

bool MultiNameSpace::connectPortToPortPersistently ( const Contact src,
const Contact dest,
ContactStyle  style 
)
overridevirtual

Connect two ports with persistence.

Implements yarp::os::NameSpace.

Definition at line 289 of file MultiNameSpace.cpp.

◆ connectPortToTopic()

bool MultiNameSpace::connectPortToTopic ( const Contact src,
const Contact dest,
ContactStyle  style 
)
overridevirtual

Publish a port to a topic.

Implements yarp::os::NameSpace.

Definition at line 257 of file MultiNameSpace.cpp.

◆ connectTopicToPort()

bool MultiNameSpace::connectTopicToPort ( const Contact src,
const Contact dest,
ContactStyle  style 
)
overridevirtual

Subscribe a port to a topic.

Implements yarp::os::NameSpace.

Definition at line 265 of file MultiNameSpace.cpp.

◆ detectNameServer()

Contact MultiNameSpace::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 372 of file MultiNameSpace.cpp.

◆ disconnectPortFromTopic()

bool MultiNameSpace::disconnectPortFromTopic ( const Contact src,
const Contact dest,
ContactStyle  style 
)
overridevirtual

Stop publishing a port to a topic.

Implements yarp::os::NameSpace.

Definition at line 273 of file MultiNameSpace.cpp.

◆ disconnectPortToPortPersistently()

bool MultiNameSpace::disconnectPortToPortPersistently ( const Contact src,
const Contact dest,
ContactStyle  style 
)
overridevirtual

Disconnect two ports, removing any persistence.

Implements yarp::os::NameSpace.

Definition at line 297 of file MultiNameSpace.cpp.

◆ disconnectTopicFromPort()

bool MultiNameSpace::disconnectTopicFromPort ( const Contact src,
const Contact dest,
ContactStyle  style 
)
overridevirtual

Stop subscribing a port to a topic.

Implements yarp::os::NameSpace.

Definition at line 281 of file MultiNameSpace.cpp.

◆ getNameServerContact()

Contact MultiNameSpace::getNameServerContact ( ) const
overridevirtual

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

Implements yarp::os::NameSpace.

Definition at line 249 of file MultiNameSpace.cpp.

◆ getProperty()

Value * MultiNameSpace::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 366 of file MultiNameSpace.cpp.

◆ getQueryBypass()

NameStore * MultiNameSpace::getQueryBypass ( )
virtual

Get any alternative place to make name queries, if one was set by queryBypass()

Definition at line 236 of file MultiNameSpace.cpp.

◆ localOnly()

bool MultiNameSpace::localOnly ( ) const
overridevirtual

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

Implements yarp::os::NameSpace.

Definition at line 217 of file MultiNameSpace.cpp.

◆ queryBypass()

void MultiNameSpace::queryBypass ( NameStore store)
virtual

Set an alternative place to make name queries.

This method is typically used when writing name servers in YARP, so you don't end up with a loop.

Definition at line 232 of file MultiNameSpace.cpp.

◆ queryName()

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

Map from port name to contact information.

Implements yarp::os::NameSpace.

Definition at line 253 of file MultiNameSpace.cpp.

◆ registerContact()

Contact MultiNameSpace::registerContact ( const Contact contact)
overridevirtual

Record contact information (should include a port name).

Implements yarp::os::NameSpace.

Definition at line 326 of file MultiNameSpace.cpp.

◆ registerName()

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

Record contact information to tie to a port name.

Implements yarp::os::NameSpace.

Definition at line 305 of file MultiNameSpace.cpp.

◆ serverAllocatesPortNumbers()

bool MultiNameSpace::serverAllocatesPortNumbers ( ) const
overridevirtual

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 240 of file MultiNameSpace.cpp.

◆ setLocalMode()

bool MultiNameSpace::setLocalMode ( bool  flag)

Definition at line 213 of file MultiNameSpace.cpp.

◆ setProperty()

bool MultiNameSpace::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 359 of file MultiNameSpace.cpp.

◆ unregisterContact()

Contact MultiNameSpace::unregisterContact ( const Contact contact)
overridevirtual

Disassociate contact information (should include a port name).

Implements yarp::os::NameSpace.

Definition at line 348 of file MultiNameSpace.cpp.

◆ unregisterName()

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

Disassociate contact information from a port name.

Implements yarp::os::NameSpace.

Definition at line 337 of file MultiNameSpace.cpp.

◆ usesCentralServer()

bool MultiNameSpace::usesCentralServer ( ) const
overridevirtual

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

Implements yarp::os::NameSpace.

Definition at line 222 of file MultiNameSpace.cpp.

◆ writeToNameServer()

bool MultiNameSpace::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 399 of file MultiNameSpace.cpp.

Member Data Documentation

◆ altStore

NameStore* yarp::os::MultiNameSpace::altStore
private

Definition at line 107 of file MultiNameSpace.h.

◆ system_resource

void* yarp::os::MultiNameSpace::system_resource
private

Definition at line 106 of file MultiNameSpace.h.


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