7#ifndef YARP_OS_NETWORK_H
8#define YARP_OS_NETWORK_H
26#define YARP_DECLARE_PLUGINS(name) extern "C" void add_ ## name ## _plugins();
27#define YARP_REGISTER_PLUGINS(name) add_ ## name ## _plugins();
44 static void initMinimum();
59 static void autoInitMinimum();
90 Clock* custom =
nullptr);
95 static void finiMinimum();
102 static bool isNetworkInitialized();
112 static bool connect(
const std::string& src,
113 const std::string& dest,
114 const std::string& carrier =
"",
123 return connect(std::string(src),
125 std::string((carrier ==
nullptr) ?
"" : carrier),
136 static bool connect(
const std::string& src,
137 const std::string& dest,
147 static bool disconnect(
const std::string& src,
148 const std::string& dest,
158 static bool disconnect(
const std::string& src,
159 const std::string& dest,
170 static bool disconnect(
const std::string& src,
171 const std::string& dest,
172 const std::string& carrier =
"",
181 return disconnect(std::string(src),
183 std::string((carrier ==
nullptr) ?
"" : carrier),
194 static bool isConnected(
const std::string& src,
195 const std::string& dest,
205 static bool isConnected(
const std::string& src,
206 const std::string& dest,
217 static bool isConnected(
const std::string& src,
218 const std::string& dest,
219 const std::string& carrier =
"",
228 return isConnected(std::string(src),
230 std::string((carrier ==
nullptr) ?
"" : carrier),
240 static bool exists(
const std::string& port,
242 bool checkVer =
true);
250 static bool exists(
const std::string& port,
252 bool checkVer =
true);
260 static bool sync(
const std::string& port,
269 static void assertion(
bool shouldBeTrue);
281 static Contact queryName(
const std::string& name);
291 static Contact registerName(
const std::string& name);
310 static Contact unregisterName(
const std::string& name);
332 static bool setProperty(
const char* name,
344 static Value* getProperty(
const char* name,
354 static std::string getNameServerName();
362 static Contact getNameServerContact();
373 static bool setNameServerName(
const std::string& name);
383 static bool setLocalMode(
bool flag);
389 static bool getLocalMode();
391#ifndef YARP_NO_DEPRECATED
407 static std::string
readString(
bool* eof =
nullptr);
432 double timeout = -1);
460 static bool writeToNameServer(
PortWriter& cmd,
474 static bool write(
const std::string& port_name,
487 static bool checkNetwork();
500 static bool checkNetwork(
double timeout);
510 static bool initialized();
512#ifndef YARP_NO_DEPRECATED
519 YARP_DEPRECATED_MSG("Use LogComponents instead")
520 static void setVerbosity(
int verbosity);
528 static void queryBypass(
NameStore* store);
532#ifndef YARP_NO_DEPRECATED
542 YARP_DEPRECATED_MSG("Use yarp::conf::environment::get_string instead")
544 bool* found =
nullptr);
556 const
std::
string& val);
570#ifndef YARP_NO_DEPRECATED
576 YARP_DEPRECATED_MSG("Use yarp::conf::filesystem::preferred_separator instead")
577 static std::string getDirectorySeparator();
585 static
std::
string getPathSeparator();
596 static bool registerCarrier(
const char* name,
607 static void unlock();
617 static bool localNetworkAllocation();
630 static Contact detectNameServer(
bool useDetectedServer,
640 static bool setNameServerContact(
Contact& nameServerContact);
651 static std::string getConfigFile(
const char* fname);
663 static int getDefaultPortRange();
673 static bool setConnectionQos(
const std::string& src,
674 const std::string& dest,
686 static bool setConnectionQos(
const std::string& src,
687 const std::string& dest,
699 static bool getConnectionQos(
const std::string& src,
700 const std::string& dest,
710 static bool isValidPortName(
const std::string& portName);
719 static bool waitConnection(
const std::string& source,
720 const std::string& destination,
729 static bool waitPort(
const std::string& target,
bool quiet =
false);
735 static int sendMessage(
const std::string& port,
737 bool silent =
false);
747 static int sendMessage(
const std::string& port,
759 static int disconnectInput(
const std::string& src,
760 const std::string& dest,
761 bool silent =
false);
770 static int poll(
const std::string& target,
bool silent =
false);
823 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)
An interface to the operating system, including Port based communication.
bool write(const ImageOf< PixelRgb > &src, const std::string &dest, image_fileformat format=FORMAT_PPM)
The main, catch-all namespace for YARP.