YARP
Yet Another Robot Platform
MultiNameSpace.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3  * SPDX-License-Identifier: BSD-3-Clause
4  */
5 
6 #ifndef YARP_OS_MULTINAMESPACE_H
7 #define YARP_OS_MULTINAMESPACE_H
8 
9 #include <yarp/os/NameSpace.h>
10 #include <yarp/os/NameStore.h>
11 
12 namespace yarp {
13 namespace os {
14 
16 {
17 public:
19 
20  virtual ~MultiNameSpace();
21 
22  bool setLocalMode(bool flag);
23 
24  bool activate(bool force = false);
25 
26  Contact getNameServerContact() const override;
27 
28  Contact queryName(const std::string& name) override;
29 
30  Contact registerName(const std::string& name) override;
31 
32  Contact registerContact(const Contact& contact) override;
33 
34  Contact unregisterName(const std::string& name) override;
35 
36  Contact unregisterContact(const Contact& contact) override;
37 
38  virtual bool setProperty(const std::string& name,
39  const std::string& key,
40  const Value& value) override;
41 
42  Value* getProperty(const std::string& name, const std::string& key) override;
43 
44  virtual bool connectPortToTopic(const Contact& src,
45  const Contact& dest,
46  const ContactStyle& style) override;
47 
48  virtual bool connectTopicToPort(const Contact& src,
49  const Contact& dest,
50  const ContactStyle& style) override;
51 
52  virtual bool disconnectPortFromTopic(const Contact& src,
53  const Contact& dest,
54  const ContactStyle& style) override;
55 
56  virtual bool disconnectTopicFromPort(const Contact& src,
57  const Contact& dest,
58  const ContactStyle& style) override;
59 
60  virtual bool connectPortToPortPersistently(const Contact& src,
61  const Contact& dest,
62  const ContactStyle& style) override;
63 
64  virtual bool disconnectPortToPortPersistently(const Contact& src,
65  const Contact& dest,
66  const ContactStyle& style) override;
67 
68  bool localOnly() const override;
69 
70  bool usesCentralServer() const override;
71 
72  bool serverAllocatesPortNumbers() const override;
73 
74  bool connectionHasNameOfEndpoints() const override;
75 
83  virtual void queryBypass(NameStore* store);
84 
91  virtual NameStore* getQueryBypass();
92 
93  virtual Contact detectNameServer(bool useDetectedServer,
94  bool& scanNeeded,
95  bool& serverUsed) override;
96 
97  virtual bool writeToNameServer(PortWriter& cmd,
98  PortReader& reply,
99  const ContactStyle& style) override;
100 
101 private:
102  void* system_resource;
103  NameStore* altStore;
104 };
105 
106 } // namespace os
107 } // namespace yarp
108 
109 #endif // YARP_OS_MULTINAMESPACE_H
Preferences for how to communicate with a contact.
Definition: ContactStyle.h:24
Represents how to reach a part of a YARP network.
Definition: Contact.h:36
An abstract name space for ports.
Definition: NameSpace.h:23
Abstract interface for a database of port names.
Definition: NameStore.h:20
Interface implemented by all objects that can read themselves from the network, such as Bottle object...
Definition: PortReader.h:25
Interface implemented by all objects that can write themselves to the network, such as Bottle objects...
Definition: PortWriter.h:24
A single value (typically within a Bottle).
Definition: Value.h:45
The main, catch-all namespace for YARP.
Definition: dirs.h:16
#define YARP_os_API
Definition: api.h:18