YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
NameClient.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-FileCopyrightText: 2006-2010 RobotCub Consortium
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef YARP_OS_IMPL_NAMECLIENT_H
8#define YARP_OS_IMPL_NAMECLIENT_H
9
10#include <yarp/os/Contact.h>
12
13namespace yarp::os {
14
15class Bottle;
16class NameStore;
17
18} // namespace yarp::os
19
20namespace yarp::os::impl {
21
22class NameServer;
23
32{
33private:
34 NameClient();
36
37public:
41 virtual ~NameClient();
42
50 static NameClient& getNameClient();
51
52 static NameClient* create();
53
58 Contact getAddress();
59
65 Contact queryName(const std::string& name);
66
72 Contact registerName(const std::string& name);
73
80 Contact registerName(const std::string& name, const Contact& suggest);
81
87 Contact unregisterName(const std::string& name);
88
98 Contact probe(const std::string& cmd);
99
107 static Contact extractAddress(const std::string& txt);
108
109 static Contact extractAddress(const Bottle& bot);
110
119 std::string send(const std::string& cmd, bool multi = true, const ContactStyle& style = ContactStyle());
120
130 bool send(yarp::os::Bottle& cmd, yarp::os::Bottle& reply);
131
138 void setFakeMode(bool fake = true);
139
145 bool isFakeMode() const;
146
153 void setScan(bool allow = true);
154
161 void setSave(bool allow = true);
162
169 bool didScan();
170
177 bool didSave();
178
185 bool updateAddress();
186
187 bool setContact(const yarp::os::Contact& contact);
188
189 void queryBypass(NameStore* store);
190
191 NameStore* getQueryBypass();
192
193 std::string getMode();
194
195private:
196 Contact address;
199 bool fake;
200 NameServer* fakeServer;
201 bool allowScan;
202 bool allowSaveScan;
203 bool reportScan;
204 bool reportSaveScan;
205 bool isSetup;
206 NameStore* altStore;
207
208 NameServer& getServer();
209 void setup();
210};
211
212} // namespace yarp::os::impl
213
214#endif // YARP_OS_IMPL_NAMECLIENT_H
FeatureMode mode
A simple collection of objects that can be described and transmitted in a portable way.
Definition Bottle.h:65
A mini-server for performing network communication in the background.
Preferences for how to communicate with a contact.
Represents how to reach a part of a YARP network.
Definition Contact.h:33
Abstract interface for a database of port names.
Definition NameStore.h:19
Client for YARP name server.
Definition NameClient.h:32
Implementation of a YARP2-conforming name server.
Definition NameServer.h:43
The components from which ports and connections are built.
An interface to the operating system, including Port based communication.
#define YARP_SUPPRESS_DLL_INTERFACE_WARNING_ARG(x)
Suppress MSVC C4251 warning for the declaration.
Definition system.h:338
#define YARP_os_impl_API
Definition api.h:46