7 #ifndef YARP_OS_NETWORK_H
8 #define YARP_OS_NETWORK_H
28 #define YARP_DECLARE_PLUGINS(name) extern "C" void add_ ## name ## _plugins();
29 #define YARP_REGISTER_PLUGINS(name) add_ ## name ## _plugins();
47 static void initMinimum();
62 static void autoInitMinimum();
93 Clock* custom =
nullptr);
98 static void finiMinimum();
105 static bool isNetworkInitialized();
115 static bool connect(
const std::string& src,
116 const std::string& dest,
117 const std::string& carrier =
"",
126 return connect(std::string(src),
128 std::string((carrier ==
nullptr) ?
"" : carrier),
139 static bool connect(
const std::string& src,
140 const std::string& dest,
150 static bool disconnect(
const std::string& src,
151 const std::string& dest,
161 static bool disconnect(
const std::string& src,
162 const std::string& dest,
173 static bool disconnect(
const std::string& src,
174 const std::string& dest,
175 const std::string& carrier =
"",
184 return disconnect(std::string(src),
186 std::string((carrier ==
nullptr) ?
"" : carrier),
197 static bool isConnected(
const std::string& src,
198 const std::string& dest,
208 static bool isConnected(
const std::string& src,
209 const std::string& dest,
220 static bool isConnected(
const std::string& src,
221 const std::string& dest,
222 const std::string& carrier =
"",
231 return isConnected(std::string(src),
233 std::string((carrier ==
nullptr) ?
"" : carrier),
243 static bool exists(
const std::string& port,
245 bool checkVer =
true);
253 static bool exists(
const std::string& port,
255 bool checkVer =
true);
263 static bool sync(
const std::string& port,
272 static void assertion(
bool shouldBeTrue);
284 static Contact queryName(
const std::string& name);
294 static Contact registerName(
const std::string& name);
313 static Contact unregisterName(
const std::string& name);
335 static bool setProperty(
const char* name,
347 static Value* getProperty(
const char* name,
357 static std::string getNameServerName();
365 static Contact getNameServerContact();
376 static bool setNameServerName(
const std::string& name);
386 static bool setLocalMode(
bool flag);
392 static bool getLocalMode();
394 #ifndef YARP_NO_DEPRECATED
410 static std::string
readString(
bool* eof =
nullptr);
435 double timeout = -1);
463 static bool writeToNameServer(
PortWriter& cmd,
477 static bool write(
const std::string& port_name,
490 static bool checkNetwork();
503 static bool checkNetwork(
double timeout);
513 static bool initialized();
515 #ifndef YARP_NO_DEPRECATED
522 YARP_DEPRECATED_MSG("Use LogComponents instead")
523 static void setVerbosity(
int verbosity);
531 static void queryBypass(
NameStore* store);
535 #ifndef YARP_NO_DEPRECATED
545 YARP_DEPRECATED_MSG("Use yarp::conf::environment::get_string instead")
547 bool* found =
nullptr);
559 const std::
string& val);
573 #ifndef YARP_NO_DEPRECATED
579 YARP_DEPRECATED_MSG("Use yarp::conf::filesystem::preferred_separator instead")
580 static std::string getDirectorySeparator();
588 static std::
string getPathSeparator();
599 static bool registerCarrier(
const char* name,
610 static void unlock();
620 static bool localNetworkAllocation();
633 static Contact detectNameServer(
bool useDetectedServer,
643 static bool setNameServerContact(
Contact& nameServerContact);
654 static std::string getConfigFile(
const char* fname);
666 static int getDefaultPortRange();
676 static bool setConnectionQos(
const std::string& src,
677 const std::string& dest,
689 static bool setConnectionQos(
const std::string& src,
690 const std::string& dest,
702 static bool getConnectionQos(
const std::string& src,
703 const std::string& dest,
713 static bool isValidPortName(
const std::string& portName);
722 static bool waitConnection(
const std::string& source,
723 const std::string& destination,
732 static bool waitPort(
const std::string& target,
bool quiet =
false);
738 static int sendMessage(
const std::string& port,
740 bool silent =
false);
750 static int sendMessage(
const std::string& port,
762 static int disconnectInput(
const std::string& src,
763 const std::string& dest,
764 bool silent =
false);
773 static int poll(
const std::string& target,
bool silent =
false);
826 Clock* custom =
nullptr);
Abstract interface for a database of port names.
Utilities for manipulating the YARP network, excluding initialization and shutdown.
static bool isConnected(const char *src, const char *dest, const char *carrier, bool quiet=true)
static bool connect(const char *src, const char *dest, const char *carrier, bool quiet=true)
static bool disconnect(const char *src, const char *dest, const char *carrier, bool quiet=true)
Utilities for manipulating the YARP network, including initialization and shutdown.
Network(yarp::os::yarpClockType clockType, yarp::os::Clock *custom=nullptr)
Initialize the YARP network using the specified clock.
static void fini()
Deinitialization.
virtual ~Network()
Destructor.
static void init()
Initialization.
static void init(yarp::os::yarpClockType clockType, Clock *custom=nullptr)
Initialization.
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...
Preferences for the port's Quality of Service.
A single value (typically within a Bottle).
#define YARP_DEPRECATED_MSG(MSG)
Expands to either the standard [[deprecated]] attribute or a compiler-specific decorator such as __at...
void setEnvironment(const std::string &key, const std::string &value)
Set or change an environment variable.
bool unset(const std::string &key)
Remove an environment variable.
std::string getEnvironment(const char *key, bool *found=nullptr)
Read a string from an environment variable.
void unsetEnvironment(const std::string &key)
Remove an environment variable.
std::string readString(bool *eof)
bool write(const ImageOf< PixelRgb > &src, const std::string &dest, image_fileformat format=FORMAT_PPM)
The main, catch-all namespace for YARP.