#include <yarp/os/RosNameSpace.h>
Public Member Functions | |
RosNameSpace (const Contact &contact) | |
virtual | ~RosNameSpace () |
Contact | getNameServerContact () const override |
Get an address for a name server that manages the name space, if available. More... | |
Contact | queryName (const std::string &name) override |
Map from port name to contact information. More... | |
Contact | registerName (const std::string &name) override |
Record contact information to tie to a port name. More... | |
Contact | registerContact (const Contact &contact) override |
Record contact information (should include a port name). More... | |
Contact | unregisterName (const std::string &name) override |
Disassociate contact information from a port name. More... | |
Contact | unregisterContact (const Contact &contact) override |
Disassociate contact information (should include a port name). More... | |
virtual Contact | registerAdvanced (const Contact &contact, NameStore *store) override |
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) override |
Remove contact information, with access to the contact information of other ports for cross-referencing. 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 Value * | getProperty (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, const ContactStyle &style) override |
Publish a port to a topic. More... | |
virtual bool | connectTopicToPort (const Contact &src, const Contact &dest, const ContactStyle &style) override |
Subscribe a port to a topic. More... | |
virtual bool | disconnectPortFromTopic (const Contact &src, const Contact &dest, const ContactStyle &style) override |
Stop publishing a port to a topic. More... | |
virtual bool | disconnectTopicFromPort (const Contact &src, const Contact &dest, const ContactStyle &style) override |
Stop subscribing a port to a topic. More... | |
virtual bool | connectPortToPortPersistently (const Contact &src, const Contact &dest, const ContactStyle &style) override |
Connect two ports with persistence. More... | |
virtual bool | disconnectPortToPortPersistently (const Contact &src, const Contact &dest, const ContactStyle &style) override |
Disconnect two ports, removing any persistence. More... | |
virtual bool | connectTopic (Bottle &cmd, bool srcIsTopic, const Contact &src, const Contact &dest, const ContactStyle &style, bool activeRegistration) |
bool | localOnly () const override |
Check if the NameSpace is only valid for the current process ("local"). More... | |
bool | usesCentralServer () const override |
Check if a central server is involved in managing the NameSpace. More... | |
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... | |
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 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... | |
void | run () override |
Main body of the new thread. 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... | |
Public Member Functions inherited from yarp::os::Thread | |
Thread () | |
Constructor. More... | |
virtual | ~Thread () |
Destructor. More... | |
virtual void | onStop () |
Call-back, called while halting the thread (before join). More... | |
bool | start () |
Start the new thread running. More... | |
bool | stop () |
Stop the thread. More... | |
virtual void | beforeStart () |
Called just before a new thread starts. More... | |
virtual void | afterStart (bool success) |
Called just after a new thread starts (or fails to start), this is executed by the same thread that calls start(). More... | |
virtual bool | threadInit () |
Initialization method. More... | |
virtual void | threadRelease () |
Release method. More... | |
bool | isStopping () |
Returns true if the thread is stopping (Thread::stop has been called). More... | |
bool | isRunning () |
Returns true if the thread is running (Thread::start has been called successfully and the thread has not stopped). More... | |
long int | getKey () |
Get a unique identifier for the thread. More... | |
int | setPriority (int priority, int policy=-1) |
Set the priority and scheduling policy of the thread, if the OS supports that. More... | |
int | getPriority () |
Query the current priority of the thread, if the OS supports that. More... | |
int | getPolicy () |
Query the current scheduling policy of the thread, if the OS supports that. More... | |
bool | join (double seconds=-1) |
The function returns when the thread execution has completed. More... | |
void | setOptions (int stackSize=0) |
Set the stack size for the new thread. More... | |
Static Public Member Functions | |
static std::string | toRosName (const std::string &name) |
Possible ROS names are a subset of YARP names. More... | |
static std::string | fromRosName (const std::string &name) |
static std::string | toRosNodeName (const std::string &name) |
static std::string | fromRosNodeName (const std::string &name) |
static Contact | rosify (const Contact &contact) |
Static Public Member Functions inherited from yarp::os::Thread | |
static int | getCount () |
Check how many threads are running. More... | |
static long int | getKeyOfCaller () |
Get a unique identifier for the calling thread. More... | |
static void | yield () |
Reschedule the execution of current thread, allowing other threads to run. More... | |
static void | setDefaultStackSize (int stackSize) |
Set the default stack size for all threads created after this point. More... | |
Definition at line 23 of file RosNameSpace.h.
RosNameSpace::RosNameSpace | ( | const Contact & | contact | ) |
Definition at line 32 of file RosNameSpace.cpp.
|
virtual |
Definition at line 38 of file RosNameSpace.cpp.
|
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 540 of file RosNameSpace.cpp.
|
overridevirtual |
Connect two ports with persistence.
Implements yarp::os::NameSpace.
Definition at line 456 of file RosNameSpace.cpp.
|
overridevirtual |
Publish a port to a topic.
Implements yarp::os::NameSpace.
Definition at line 404 of file RosNameSpace.cpp.
|
virtual |
Definition at line 476 of file RosNameSpace.cpp.
|
overridevirtual |
Subscribe a port to a topic.
Implements yarp::os::NameSpace.
Definition at line 418 of file RosNameSpace.cpp.
|
overridevirtual |
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. |
Implements yarp::os::NameSpace.
Definition at line 545 of file RosNameSpace.cpp.
|
overridevirtual |
Stop publishing a port to a topic.
Implements yarp::os::NameSpace.
Definition at line 432 of file RosNameSpace.cpp.
|
overridevirtual |
Disconnect two ports, removing any persistence.
Implements yarp::os::NameSpace.
Definition at line 466 of file RosNameSpace.cpp.
|
overridevirtual |
Stop subscribing a port to a topic.
Implements yarp::os::NameSpace.
Definition at line 444 of file RosNameSpace.cpp.
|
static |
Definition at line 678 of file RosNameSpace.cpp.
|
static |
Definition at line 712 of file RosNameSpace.cpp.
|
overridevirtual |
Get an address for a name server that manages the name space, if available.
Implements yarp::os::NameSpace.
Definition at line 43 of file RosNameSpace.cpp.
|
overridevirtual |
Get the value of a named key from a named port.
Implements yarp::os::NameSpace.
Definition at line 396 of file RosNameSpace.cpp.
|
overridevirtual |
Check if the NameSpace is only valid for the current process ("local").
Implements yarp::os::NameSpace.
Definition at line 525 of file RosNameSpace.cpp.
|
overridevirtual |
Map from port name to contact information.
Implements yarp::os::NameSpace.
Definition at line 48 of file RosNameSpace.cpp.
|
overridevirtual |
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 from yarp::os::NameSpace.
Definition at line 110 of file RosNameSpace.cpp.
Record contact information (should include a port name).
Implements yarp::os::NameSpace.
Definition at line 105 of file RosNameSpace.cpp.
|
overridevirtual |
Record contact information to tie to a port name.
Implements yarp::os::NameSpace.
Definition at line 95 of file RosNameSpace.cpp.
Definition at line 717 of file RosNameSpace.cpp.
|
overridevirtual |
Main body of the new thread.
Override this method to do what you want. After Thread::start is called, this method will start running in a separate thread. It is important that this method either keeps checking Thread::isStopping to see if it should stop, or you override the Thread::onStop method to interact with it in some way to shut the new thread down. There is no really reliable, portable way to stop a thread cleanly unless that thread cooperates.
Implements yarp::os::Thread.
Definition at line 730 of file RosNameSpace.cpp.
|
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 535 of file RosNameSpace.cpp.
|
overridevirtual |
Associate a key/value pair with a named port.
Implements yarp::os::NameSpace.
Definition at line 386 of file RosNameSpace.cpp.
|
static |
Possible ROS names are a subset of YARP names.
For nodes, in practice there isn't much restriction, except ":" is definitely ruled out. Since plenty of valid YARP ports have a ":" in them, we need to quote this.
Definition at line 662 of file RosNameSpace.cpp.
|
static |
Definition at line 707 of file RosNameSpace.cpp.
|
overridevirtual |
Remove contact information, with access to the contact information of other ports for cross-referencing.
Reimplemented from yarp::os::NameSpace.
Definition at line 270 of file RosNameSpace.cpp.
Disassociate contact information (should include a port name).
Implements yarp::os::NameSpace.
Definition at line 366 of file RosNameSpace.cpp.
|
overridevirtual |
Disassociate contact information from a port name.
Implements yarp::os::NameSpace.
Definition at line 265 of file RosNameSpace.cpp.
|
overridevirtual |
Check if a central server is involved in managing the NameSpace.
Implements yarp::os::NameSpace.
Definition at line 530 of file RosNameSpace.cpp.
|
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 574 of file RosNameSpace.cpp.