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