6#ifndef YARP_OS_YARPNAMESPACE_H
7#define YARP_OS_YARPNAMESPACE_H
27 Contact queryName(
const std::string& name)
override;
29 Contact registerName(
const std::string& name)
override;
33 Contact unregisterName(
const std::string& name)
override;
37 virtual bool setProperty(
const std::string& name,
38 const std::string& key,
39 const Value& value)
override;
41 virtual Value* getProperty(
const std::string& name,
42 const std::string& key)
override;
48 return connectTopic(
"subscribe",
false,
true, src, dest, style);
55 return connectTopic(
"subscribe",
true,
false, src, dest, style);
62 return connectTopic(
"unsubscribe",
false,
true, src, dest, style);
69 return connectTopic(
"unsubscribe",
true,
false, src, dest, style);
76 return connectTopic(
"subscribe",
false,
false, src, dest, style);
83 return connectTopic(
"unsubscribe",
false,
false, src, dest, style);
109 case ContactStyle::END_WITH_FROM_PORT:
112 case ContactStyle::END_WITH_TO_PORT:
120 if (!NetworkBase::getQueryBypass()) {
121 ok = NetworkBase::write(getNameServerContact(), cmd, reply);
124 ok = NetworkBase::writeToNameServer(cmd, reply, style);
126 bool fail = (reply.
get(0).
toString() ==
"fail") || !ok;
129 fprintf(
stderr,
"Failure: name server did not accept connection to topic.\n");
159 virtual bool writeToNameServer(
PortWriter& cmd,
164 void* system_resource;
A simple collection of objects that can be described and transmitted in a portable way.
Value & get(size_type index) const
Reads a Value v from a certain part of the list.
void addString(const char *str)
Places a string in the bottle, at the end of the list.
A mini-server for performing network communication in the background.
An abstract name space for ports.
Interface implemented by all objects that can read themselves from the network, such as Bottle object...
Interface implemented by all objects that can write themselves to the network, such as Bottle objects...
A single value (typically within a Bottle).
std::string toString() const override
Return a standard text representation of the content of the object.
Contact getNameServerContact() const override
Get an address for a name server that manages the name space, if available.
bool localOnly() const override
Check if the NameSpace is only valid for the current process ("local").
virtual bool disconnectPortFromTopic(const Contact &src, const Contact &dest, const ContactStyle &style) override
Stop publishing a port to a topic.
bool usesCentralServer() const override
Check if a central server is involved in managing the NameSpace.
virtual bool connectTopic(const std::string &dir, bool srcIsTopic, bool destIsTopic, const Contact &src, const Contact &dest, const ContactStyle &style)
virtual bool connectPortToPortPersistently(const Contact &src, const Contact &dest, const ContactStyle &style) override
Connect two ports with persistence.
bool localOnly() const override
Check if the NameSpace is only valid for the current process ("local").
Contact getNameServerContact() const override
Get an address for a name server that manages the name space, if available.
virtual bool disconnectTopicFromPort(const Contact &src, const Contact &dest, const ContactStyle &style) override
Stop subscribing a port to a topic.
bool connectionHasNameOfEndpoints() const override
When connections are made involving ports managed by this NameSpace do the ports involved end up know...
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.
bool serverAllocatesPortNumbers() const override
Check if a central server is responsible for allocating port numbers, or if this should be left up to...
virtual bool disconnectPortToPortPersistently(const Contact &src, const Contact &dest, const ContactStyle &style) override
Disconnect two ports, removing any persistence.
An interface to the operating system, including Port based communication.