|
YARP
Yet Another Robot Platform
|
|
Go to the documentation of this file.
10 #ifndef YARP_OS_NETWORK_H
11 #define YARP_OS_NETWORK_H
31 #define YARP_DECLARE_PLUGINS(name) extern "C" void add_ ## name ## _plugins();
32 #define YARP_REGISTER_PLUGINS(name) add_ ## name ## _plugins();
50 static void initMinimum();
65 static void autoInitMinimum();
96 Clock* custom =
nullptr);
101 static void finiMinimum();
108 static bool isNetworkInitialized();
118 static bool connect(
const std::string& src,
119 const std::string& dest,
120 const std::string& carrier =
"",
129 return connect(std::string(src),
131 std::string((carrier ==
nullptr) ?
"" : carrier),
142 static bool connect(
const std::string& src,
143 const std::string& dest,
153 static bool disconnect(
const std::string& src,
154 const std::string& dest,
164 static bool disconnect(
const std::string& src,
165 const std::string& dest,
176 static bool disconnect(
const std::string& src,
177 const std::string& dest,
178 const std::string& carrier =
"",
187 return disconnect(std::string(src),
189 std::string((carrier ==
nullptr) ?
"" : carrier),
200 static bool isConnected(
const std::string& src,
201 const std::string& dest,
211 static bool isConnected(
const std::string& src,
212 const std::string& dest,
223 static bool isConnected(
const std::string& src,
224 const std::string& dest,
225 const std::string& carrier =
"",
234 return isConnected(std::string(src),
236 std::string((carrier ==
nullptr) ?
"" : carrier),
246 static bool exists(
const std::string& port,
248 bool checkVer =
true);
256 static bool exists(
const std::string& port,
258 bool checkVer =
true);
266 static bool sync(
const std::string& port,
275 static void assertion(
bool shouldBeTrue);
287 static Contact queryName(
const std::string& name);
297 static Contact registerName(
const std::string& name);
316 static Contact unregisterName(
const std::string& name);
338 static bool setProperty(
const char* name,
350 static Value* getProperty(
const char* name,
360 static std::string getNameServerName();
368 static Contact getNameServerContact();
379 static bool setNameServerName(
const std::string& name);
389 static bool setLocalMode(
bool flag);
395 static bool getLocalMode();
397 #ifndef YARP_NO_DEPRECATED // Since YARP 3.0.0
413 static std::string
readString(
bool* eof =
nullptr);
414 #endif // YARP_NO_DEPRECATED
438 double timeout = -1);
466 static bool writeToNameServer(
PortWriter& cmd,
480 static bool write(
const std::string& port_name,
493 static bool checkNetwork();
506 static bool checkNetwork(
double timeout);
516 static bool initialized();
518 #ifndef YARP_NO_DEPRECATED // Since YARP 3.4
526 static
void setVerbosity(
int verbosity);
527 #endif // YARP_NO_DEPRECATED
534 static void queryBypass(
NameStore* store);
538 #ifndef YARP_NO_DEPRECATED // Since YARP 3.4
550 bool* found =
nullptr);
562 const std::
string& val);
573 #endif // YARP_NO_DEPRECATED
576 #ifndef YARP_NO_DEPRECATED // Since YARP 3.3.0
583 static std::
string getDirectorySeparator();
591 static std::
string getPathSeparator();
592 #endif // YARP_NO_DEPRECATED
602 static bool registerCarrier(
const char* name,
613 static void unlock();
623 static bool localNetworkAllocation();
636 static Contact detectNameServer(
bool useDetectedServer,
646 static bool setNameServerContact(
Contact& nameServerContact);
657 static std::string getConfigFile(
const char* fname);
669 static int getDefaultPortRange();
679 static bool setConnectionQos(
const std::string& src,
680 const std::string& dest,
692 static bool setConnectionQos(
const std::string& src,
693 const std::string& dest,
705 static bool getConnectionQos(
const std::string& src,
706 const std::string& dest,
716 static bool isValidPortName(
const std::string& portName);
725 static bool waitConnection(
const std::string& source,
726 const std::string& destination,
735 static bool waitPort(
const std::string& target,
bool quiet =
false);
741 static int sendMessage(
const std::string& port,
743 bool silent =
false);
753 static int sendMessage(
const std::string& port,
765 static int disconnectInput(
const std::string& src,
766 const std::string& dest,
767 bool silent =
false);
776 static int poll(
const std::string& target,
bool silent =
false);
829 Clock* custom =
nullptr);
843 #endif // YARP_OS_NETWORK_H
static bool isConnected(const char *src, const char *dest, const char *carrier, bool quiet=true)
Preferences for the port's Quality of Service.
static void fini()
Deinitialization.
Abstract interface for a database of port names.
virtual ~Network()
Destructor.
static void init(yarp::os::yarpClockType clockType, Clock *custom=nullptr)
Initialization.
std::string getEnvironment(const char *key, bool *found=nullptr)
Read a variable from the environment.
#define YARP_DEPRECATED
Expands to either the standard [[deprecated]] attribute or a compiler-specific decorator such as __at...
static constexpr value_type path_separator
Interface implemented by all objects that can write themselves to the network, such as Bottle objects...
void unsetEnvironment(const std::string &key)
Remove an environment variable.
std::string readString(bool *eof)
Interface implemented by all objects that can read themselves from the network, such as Bottle object...
static void init()
Initialization.
#define YARP_DEPRECATED_MSG(MSG)
Expands to either the standard [[deprecated]] attribute or a compiler-specific decorator such as __at...
Utilities for manipulating the YARP network, including initialization and shutdown.
The main, catch-all namespace for YARP.
void setEnvironment(const std::string &key, const std::string &val)
Set or change an environment variable.
Network(yarp::os::yarpClockType clockType, yarp::os::Clock *custom=nullptr)
Initialize the YARP network using the specified clock.
bool write(const ImageOf< PixelRgb > &src, const std::string &dest, image_fileformat format=FORMAT_PPM)
A single value (typically within a Bottle).
static bool disconnect(const char *src, const char *dest, const char *carrier, bool quiet=true)
Utilities for manipulating the YARP network, excluding initialization and shutdown.
static bool connect(const char *src, const char *dest, const char *carrier, bool quiet=true)