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,
219 static bool isConnected(
const std::string& src,
220 const std::string& dest,
221 const std::string& carrier =
"",
230 return isConnected(std::string(src),
232 std::string((carrier ==
nullptr) ?
"" : carrier),
242 static bool exists(
const std::string& port,
252 static bool exists(
const std::string& port,
262 static bool sync(
const std::string& port,
283 static Contact queryName(
const std::string& name);
293 static Contact registerName(
const std::string& name);
312 static Contact unregisterName(
const std::string& name);
333 static bool cleanUnresponsivePorts(
double timeout=-1);
346 static bool setProperty(
const char* name,
358 static Value* getProperty(
const char* name,
368 static std::string getNameServerName();
376 static Contact getNameServerContact();
387 static bool setNameServerName(
const std::string& name);
397 static bool setLocalMode(
bool flag);
403 static bool getLocalMode();
421 static bool write(
const Contact& contact,
426 double timeout = -1);
440 static bool write(
const Contact& contact,
454 static bool writeToNameServer(
PortWriter& cmd,
468 static bool write(
const std::string& port_name,
481 static bool checkNetwork();
494 static bool checkNetwork(
double timeout);
504 static bool initialized();
506#ifndef YARP_NO_DEPRECATED
513 YARP_DEPRECATED_MSG("Use LogComponents instead")
522 static void queryBypass(
NameStore* store);
534 static bool registerCarrier(
const char* name,
545 static void unlock();
555 static bool localNetworkAllocation();
589 static std::string getConfigFile(
const char*
fname);
601 static int getDefaultPortRange();
611 static bool setConnectionQos(
const std::string& src,
612 const std::string& dest,
624 static bool setConnectionQos(
const std::string& src,
625 const std::string& dest,
637 static bool getConnectionQos(
const std::string& src,
638 const std::string& dest,
648 static bool isValidPortName(
const std::string& portName);
657 static bool waitConnection(
const std::string& source,
658 const std::string& destination,
667 static bool waitPort(
const std::string& target,
bool quiet =
false);
673 static int sendMessage(
const std::string& port,
675 bool silent =
false);
685 static int sendMessage(
const std::string& port,
697 static int disconnectInput(
const std::string& src,
698 const std::string& dest,
699 bool silent =
false);
708 static int poll(
const std::string& target,
bool silent =
false);
761 Clock* custom =
nullptr);
A mini-server for performing network communication in the background.
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).
An interface to the operating system, including Port based communication.