37# include <ace/Init_ACE.h>
38# include <ace/config.h>
95 if (!contact.
getHost().empty()) {
119 if (store !=
nullptr) {
173 "enactConnection: SRC %s DST %s using carrier %s, MODE=%d, rev=%d",
196 yCInfo(
NETWORK,
"Success: port-to-port persistent connection added.");
211 "Connection found between %s and %s using carrier %s",
214 info.carrier.c_str());
224 if (
info.connectionless && ((reversed &&
info.push) || (!reversed && !
info.push))) {
241 if (
c2.getPort() <= 0) {
265 msg =
"no such connection";
284 if (pos != std::string::npos) {
304 const std::string& dest)
306 if (src.find (
"/log") != std::string::npos &&
307 dest.find(
"/log") != std::string::npos &&
308 src.find (
"/logger") != std::string::npos &&
309 dest.find(
"/logger") != std::string::npos)
325 const std::string& dest)
327 if (src.find (
"/stats_monitor") != std::string::npos &&
328 dest.find(
"/stats_monitor") != std::string::npos &&
329 src.find (
"/yarpConnectionsStats") != std::string::npos &&
330 dest.find(
"/yarpConnectionsStats") != std::string::npos)
338 const std::string& dest,
359 if (style.
carrier.find(
"portmonitor") != std::string::npos)
365 while (style.
carrier.find(
"file" + std::to_string(
idx) +
".") != std::string::npos) {
368 const std::string
suffix = std::to_string(
idx);
374 style.
carrier +=
"+send.portmonitor+file.stats_monitor+type.dll";
379 yCWarning(
NETWORK,
"Failure: stats_monitor not available. Using default connection.");
401 const std::string& dest,
406 "working on connection %s to %s (%s)",
411 if (dest.find(
' ') != std::string::npos || src.find(
' ') != std::string::npos) {
413 "Failure: no way to make connection %s->%s, one of the port names contains a space character.",
420 "METACONNECT: src=%s dest=%s style=%s",
430 "DYNAMIC_SRC: name=%s, carrier=%s",
434 "DYNAMIC_DST: name=%s, carrier=%s",
440 "Failure: no way to make connection, invalid source '%s'",
446 "Failure: no way to make connection, invalid destination '%s'",
467 "Failure: could not find source port %s",
490 "Failure: could not find destination port %s",
502 "STATIC_SRC: name=%s, carrier=%s",
506 "STATIC_DST: name=%s, carrier=%s",
521 "staticSrc.getCarrier = %s",
528 "srcCarrier is NOT null; its name is %s",
534 "it is competent (bootstrapname is %s), while its name is %s",
543 "it is NOT competent. its constraint is %s",
561 "staticDest.getCarrier = %s",
568 "destCarrier is NOT null; its name is %s",
573 "it is competent (bootstrapname is %s), while its name is %s",
582 "it is NOT competent. its constraint is %s",
630 "dynamicSrc.getCarrier() = %s",
633 "dynamicDest.getCarrier() = %s",
636 "staticSrc.getCarrier() = %s",
639 "staticDest.getCarrier() = %s",
642 "carrierConstraint is %s",
646 "style.carrier (1) is %s",
653 "style.carrier is %s ==> in connect command the user specified the carrier of src port",
660 "style.carrier is %s ==> in connect command the user specified the carrier of dest port or the carrier of the connection",
665 "at the end style style.carrier is %s",
682 "style_carrier_name=%s and carrier_constraint_name=%s are equals!",
693 "if I'm here means that source or dest is not competent");
707 "if I'm here means that both src and dest are compentent and the user didn't specified a carrier in the connect command");
722 "style_carrier with params =%s",
730 if (style.
carrier !=
"topic") {
768 yCInfo(
NETWORK,
"Success: added connection using custom carrier method");
778 yCError(
NETWORK,
"Failure: no way to make connection %s->%s", src.c_str(), dest.c_str());
784bool NetworkBase::connect(
const std::string& src,
const std::string& dest,
const std::string& carrier,
bool quiet)
788 if (!carrier.empty()) {
791 return connect(src, dest, style);
795 const std::string& dest,
803 const std::string& dest,
812 const std::string& dest,
823 if (!carrier.empty()) {
830 const std::string& dest,
842 if (!carrier.empty()) {
857 bool silent = style.
quiet;
861 yCInfo(
NETWORK,
"Address of port %s is not valid", port.c_str());
872 if (out ==
nullptr) {
898 yCInfo(
NETWORK,
"Waiting for %s->%s...", source.c_str(), destination.c_str());
925 bool result =
exists(target,
true,
false);
937 bool result =
waitPort(port, quiet);
969#if defined(YARP_HAS_ACE)
1051 if (!
clock.empty()) {
1078 yCFatal(
NETWORK,
"yarpClockInit called with unknown clock type. Quitting");
1087 yCDebug(
NETWORK,
"query recognized as name server: %s", name.c_str());
1091 if (
c.isValid() &&
c.getPort() > 0) {
1163static bool setPortQos(
const std::string& port,
const std::string& other,
bool isOutput,
const QosStyle& style,
bool quiet)
1203 std::string name =
nc.getNamespace();
1205 msg.addString(
"bot");
1206 msg.addString(
"list");
1207 yCInfo(
NETWORK,
"Requesting list of ports from name server... ");
1211 int ct = reply.
size()-1;
1214 for (
size_t i=1; i<reply.
size(); i++) {
1216 if (
entry !=
nullptr) {
1217 std::string port =
entry->check(
"name",
Value(
"")).asString();
1218 if (port!=
"" && port!=
"fallback" && port!=name) {
1220 if (
c.getCarrier()==
"mcast") {
1226 addr.toURI().c_str());
1227 if (
addr.isValid()) {
1229 addr.setTimeout((
float)timeout);
1232 if (out ==
nullptr) {
1233 yCInfo(
NETWORK,
"* No response, removing port %s", port.c_str());
1247 yCInfo(
NETWORK,
"Giving name server a chance to do garbage collection.");
1259static bool getPortQos(
const std::string& port,
const std::string& other,
bool isOutput,
QosStyle& style,
bool quiet)
1270 if (!result.
found) {
1272 yCError(
NETWORK,
"Cannot get qos properties of '%s': no connection %s '%s'",
1273 port.c_str(), isOutput ?
"to" :
"from", other.c_str());
1298 if (portName.empty()) {
1302 if (portName ==
"...") {
1306 if (portName.at(0) !=
'/') {
1310 if (portName.at(portName.size() - 1) ==
'/') {
1314 if (portName.find(
' ') != std::string::npos) {
1330 style.
admin = admin;
1331 style.
quiet = quiet;
1334 return write(contact, cmd, reply, style);
1359 bool ok = port.
write(cmd, reply);
1364 std::string name = contact.
getName();
1365 const char* targetName = name.c_str();
1381 if (out ==
nullptr) {
1417 bw.setReplyHandler(reply);
1420 if (out !=
nullptr) {
1451 std::string name =
nc.getNamespace(
false);
1466 nc.writeConfig(
fname, name +
"\n");
1467 nc.getNamespace(
true);
1490#ifndef YARP_NO_DEPRECATED
1516 static std::mutex mutex;
1542 std::string& output,
1554 if (out ==
nullptr) {
1560 Route route(
"admin", port,
"text");
1563 bool ok = out->
open(route);
1615 const std::string& dest,
1651 if (
factory->getReferenceCount() <= 0) {
1659 return car.getContent();
1664 return car.getContent();
1677 return car.isValid();
1682 return getContent().isTextMode();
1687 return getContent().isBareMode();
1692 return getContent().canEscape();
1697 getContent().handleEnvelope(envelope);
1702 return getContent().requireAck();
1707 return getContent().supportReply();
1712 return getContent().isLocal();
1717 return getContent().isPush();
1722 return getContent().isConnectionless();
1727 return getContent().isBroadcast();
1732 return getContent().isActive();
1737 return getContent().modifiesIncomingData();
1742 return getContent().modifyIncomingData(reader);
1747 return getContent().acceptIncomingData(reader);
1752 return getContent().modifiesOutgoingData();
1757 return getContent().modifyOutgoingData(writer);
1762 return getContent().acceptOutgoingData(writer);
1767 return getContent().modifiesReply();
1772 return getContent().modifyReply(reader);
1777 getContent().setCarrierParams(params);
1782 getContent().getCarrierParams(params);
1787 getContent().getHeader(header);
1792 getContent().prepareDisconnect();
1797 return getContent().getName();
1805 return getContent().checkHeader(header);
1810 getContent().setParameters(header);
1815 return getContent().canAccept();
1820 return getContent().canOffer();
1825 return getContent().prepareSend(
proto);
1830 return getContent().sendHeader(
proto);
1835 return getContent().expectReplyToHeader(
proto);
1845 return getContent().reply(
proto, writer);
1850 return getContent().expectExtraHeader(
proto);
1855 return getContent().respondToHeader(
proto);
1860 return getContent().expectIndex(
proto);
1865 return getContent().expectSenderSpecifier(
proto);
1870 return getContent().sendAck(
proto);
1875 return getContent().expectAck(
proto);
1880 return getContent().toString();
1885 getContent().
close();
1890 return getContent().getBootstrapCarrierName();
1897 bool reversed)
override
1899 return getContent().connect(src, dest, style,
mode, reversed);
1904 return getContent().configure(
proto);
1908 return getContent().configureFromProperty(options);
1913 return getContent().createFace();
1942 if (plugin.
open(settings)) {
1943 car.
open(*plugin.getFactory());
1951 return car.getContent();
1956 return car.getContent();
1962 if (
ncar ==
nullptr) {
1965 if (!
ncar->isValid()) {
1988 if (dll ==
nullptr) {
2001 if (dll !=
nullptr) {
2002 yCError(
NETWORK,
"Failed to find library %s with carrier %s", dll, name);
2004 yCError(
NETWORK,
"Failed to find library support for carrier %s", name);
2050 if (store !=
nullptr) {
2052 return store->
process(cmd, reply, contact);
2054 return getNameSpace().writeToNameServer(cmd, reply, style);
2067 if (!
range.empty()) {
2068 int irange = yarp::conf::numeric::from_string<int>(
range);
#define YARP_ENACT_DISCONNECT
#define YARP_ENACT_EXISTS
#define YARP_ENACT_CONNECT
#define YARP_CONFIG_NAMESPACE_FILENAME
static bool is_stats_port(const std::string &src, const std::string &dest)
Check if the given source and destination ports are stats ports.
static int enactConnection(const Contact &src, const Contact &dest, const ContactStyle &style, int mode, bool reversed)
Connect, disconnect, or check the connection between two ports, by sending administrative commands to...
static void addStatsMonitorIfNeeded(const std::string &src, const std::string &dest, ContactStyle &style, int mode)
static MultiNameSpace & getNameSpace()
static bool is_log_port(const std::string &src, const std::string &dest)
Check if the given source and destination ports are log ports.
static bool getPortQos(const std::string &port, const std::string &other, bool isOutput, QosStyle &style, bool quiet)
static std::string collectParams(Contact &c)
static int metaConnect(const std::string &src, const std::string &dest, ContactStyle style, int mode)
static bool needsLookup(const Contact &contact)
static int __yarp_is_initialized
static YarpAutoInit yarp_auto_init
destructor is called on shutdown.
static std::string extractCarrierNameOnly(const std::string &carrier_name_with_params)
static bool setPortQos(const std::string &port, const std::string &other, bool isOutput, const QosStyle &style, bool quiet)
static int noteDud(const Contact &src)
Notify the name server that a port did not respond (i.e.
static bool __yarp_auto_init_active
bool modifiesReply() const override
Check if this carrier modifies outgoing data through the Carrier::modifyReply method.
void getHeader(yarp::os::Bytes &header) const override
Provide 8 bytes describing this connection sufficiently to allow the other side of a connection to se...
bool canEscape() const override
Check if carrier can encode administrative messages, as opposed to just user data.
bool checkHeader(const yarp::os::Bytes &header) override
Given the first 8 bytes received on a connection, decide if this is the right carrier type to use for...
std::string getName() const override
Get the name of this connection type ("tcp", "mcast", "shmem", ...)
ConnectionReader & modifyIncomingData(ConnectionReader &reader) override
Modify incoming payload data, if appropriate.
bool sendAck(ConnectionState &proto) override
Send an acknowledgement, if needed for this carrier.
bool isTextMode() const override
Check if carrier is textual in nature.
bool expectAck(ConnectionState &proto) override
Receive an acknowledgement, if expected for this carrier.
void prepareDisconnect() override
Do cleanup and preparation for the coming disconnect, if necessary.
bool reply(ConnectionState &proto, SizedWriter &writer) override
bool isBareMode() const override
Check if carrier excludes type information from payload.
bool modifiesIncomingData() const override
Check if this carrier modifies incoming data through the Carrier::modifyIncomingData method.
SharedLibraryClassFactory< Carrier > * factory
void handleEnvelope(const std::string &envelope) override
Carriers that do not distinguish data from administrative headers (i.e.
bool expectReplyToHeader(ConnectionState &proto) override
Process reply to header, if one is expected for this carrier.
bool sendHeader(ConnectionState &proto) override
Write a header appropriate to the carrier to the connection, followed by any carrier-specific data.
bool isBroadcast() const override
Check if this carrier uses a broadcast mechanism.
bool write(ConnectionState &proto, SizedWriter &writer) override
Write a message.
bool modifiesOutgoingData() const override
Check if this carrier modifies outgoing data through the Carrier::modifyOutgoingData method.
const PortWriter & modifyOutgoingData(const PortWriter &writer) override
Modify outgoing payload data, if appropriate.
SharedLibraryClass< Carrier > car
Carrier * create() const override
Factory method.
bool isPush() const override
Check if carrier is "push" or "pull" style.
bool canAccept() const override
Check if reading is implemented for this carrier.
bool configure(ConnectionState &proto) override
Give carrier a shot at looking at how the connection is set up.
PortReader & modifyReply(PortReader &reader) override
Modify reply payload data, if appropriate.
bool configureFromProperty(yarp::os::Property &options) override
bool isLocal() const override
Check if carrier operates within a single process.
bool acceptIncomingData(ConnectionReader &reader) override
Determine whether incoming data should be accepted.
virtual const Carrier & getContent() const
virtual Carrier & getContent()
ForwardingCarrier(SharedLibraryClassFactory< Carrier > *factory, Carrier *owner)
bool supportReply() const override
This flag is used by YARP to determine whether the connection can carry RPC traffic,...
std::string toString() const override
Get name of carrier.
bool canOffer() const override
Check if writing is implemented for this carrier.
bool isConnectionless() const override
Check if this carrier is connectionless (like udp, mcast) or connection based (like tcp).
bool prepareSend(ConnectionState &proto) override
Perform any initialization needed before writing on a connection.
std::string getBootstrapCarrierName() const override
Get the name of the carrier that should be used prior to handshaking, if a port is registered with th...
void setCarrierParams(const Property ¶ms) override
Configure carrier from port administrative commands.
~ForwardingCarrier() override
bool isValid() const override
Check if this object is really a connection, or just an empty placeholder.
int connect(const yarp::os::Contact &src, const yarp::os::Contact &dest, const yarp::os::ContactStyle &style, int mode, bool reversed) override
Some carrier types may require special connection logic.
bool acceptOutgoingData(const PortWriter &writer) override
Determine whether outgoing data should be accepted.
bool expectExtraHeader(ConnectionState &proto) override
Receive any carrier-specific header.
yarp::os::Face * createFace() const override
Create new Face object that the carrier needs.
bool respondToHeader(ConnectionState &proto) override
Respond to the header.
bool expectIndex(ConnectionState &proto) override
Expect a message header, if there is one for this carrier.
bool isActive() const override
Check if carrier is alive and error free.
void close() override
Close the carrier.
bool expectSenderSpecifier(ConnectionState &proto) override
Expect the name of the sending port.
void setParameters(const yarp::os::Bytes &header) override
Configure this carrier based on the first 8 bytes of the connection.
bool requireAck() const override
Check if carrier has flow control, requiring sent messages to be acknowledged by recipient.
void getCarrierParams(Property ¶ms) const override
Get carrier configuration and deliver it by port administrative commands.
std::string getDllName() const
StubCarrier(const char *dll_name, const char *fn_name)
std::string getFnName() const
Carrier * create() const override
Factory method.
StubCarrier(const char *name)
const Carrier & getContent() const override
Carrier & getContent() override
A single-use class to shut down the yarp library if it was initialized automatically.
~YarpAutoInit()
Shut down the yarp library if it was automatically initialized.
A simple collection of objects that can be described and transmitted in a portable way.
size_type size() const
Gets the number of elements in the bottle.
bool read(ConnectionReader &reader) override
Set the bottle's value based on input from a network connection.
Value & get(size_type index) const
Reads a Value v from a certain part of the list.
void addInt32(std::int32_t x)
Places a 32-bit integer in the bottle, at the end of the list.
void addString(const char *str)
Places a string in the bottle, at the end of the list.
std::string toString() const override
Gives a human-readable textual representation of the bottle.
A mini-server for performing network communication in the background.
std::string getName() const override
Get name of port.
void close() override
Stop port activity.
BufferedPort()
Constructor.
bool open(const std::string &name) override
Start port operation, with a specific name, with automatically-chosen network parameters.
void write(bool forceStrict=false)
Write the current object being returned by BufferedPort::prepare.
A simple abstraction for a block of bytes.
A base class for connection types (tcp, mcast, shmem, ...) which are called carriers in YARP.
virtual Carrier * create() const =0
Factory method.
static bool addCarrierPrototype(Carrier *carrier)
Add a new connection type.
static Carrier * chooseCarrier(const std::string &name)
Select a carrier by name.
static OutputProtocol * connect(const Contact &address)
Initiate a connection to an address.
An interface for reading from a network connection.
The basic state of a connection - route, streams in use, etc.
The initial point-of-contact with a port.
static void setMinimumForwardLevel(LogType level)
Set current minimum forward level (it does nothing if forwarding is not enabled)
static void setMinimumPrintLevel(LogType level)
Set current minimum print level.
An abstract name space for ports.
virtual bool disconnectTopicFromPort(const Contact &src, const Contact &dest, const ContactStyle &style)=0
Stop subscribing a port to a topic.
virtual bool localOnly() const =0
Check if the NameSpace is only valid for the current process ("local").
virtual bool disconnectPortFromTopic(const Contact &src, const Contact &dest, const ContactStyle &style)=0
Stop publishing a port to a topic.
virtual bool connectPortToPortPersistently(const Contact &src, const Contact &dest, const ContactStyle &style)=0
Connect two ports with persistence.
virtual bool connectTopicToPort(const Contact &src, const Contact &dest, const ContactStyle &style)=0
Subscribe a port to a topic.
virtual bool connectPortToTopic(const Contact &src, const Contact &dest, const ContactStyle &style)=0
Publish a port to a topic.
virtual bool disconnectPortToPortPersistently(const Contact &src, const Contact &dest, const ContactStyle &style)=0
Disconnect two ports, removing any persistence.
Abstract interface for a database of port names.
virtual bool announce(const std::string &name, int activity)=0
virtual bool process(PortWriter &in, PortReader &out, const Contact &source)=0
static bool initialized()
Returns true if YARP has been fully initialized.
static std::string getNameServerName()
Get the name of the port associated with the nameserver (usually "/root", but this can be overwritten...
static bool isNetworkInitialized()
static bool getLocalMode()
Get current value of flag "localMode", see setLocalMode function.
static Contact getNameServerContact()
Get the contact information for the port associated with the nameserver (usually "/root",...
static bool sync(const std::string &port, bool quiet=true)
Wait for a port to be ready and responsive.
static bool connect(const std::string &src, const std::string &dest, const std::string &carrier="", bool quiet=true)
Request that an output port connect to an input port.
static void queryBypass(NameStore *store)
Redirect queries to another source.
static void yarpClockInit(yarp::os::yarpClockType clockType, Clock *custom=nullptr)
This function specifically initialize the clock In case clockType is one of the valid cases: YARP_CLO...
static void unlock()
Call post() on a global mutual-exclusion semaphore allocated by YARP.
static bool registerCarrier(const char *name, const char *dll)
Register a carrier to make available at runtime.
static Contact unregisterName(const std::string &name)
Removes the registration for a name from the name server.
static NameStore * getQueryBypass()
static Contact unregisterContact(const Contact &contact)
Removes the registration for a contact from the name server.
static bool waitPort(const std::string &target, bool quiet=false)
Delays the system until a specified port is open.
static bool setNameServerName(const std::string &name)
Set the name of the port associated with the nameserver (usually "/root", but this can be overwritten...
static bool getConnectionQos(const std::string &src, const std::string &dest, QosStyle &srcStyle, QosStyle &destStyle, bool quiet=true)
Gets the Qos preferences of a connection.
static Contact registerContact(const Contact &contact)
Register contact information with the name server.
static bool setNameServerContact(Contact &nameServerContact)
Set explicitly the nameserver information.
static int poll(const std::string &target, bool silent=false)
Sends a 'describe yourself' message to a specified port, in order to receive information about the po...
static Contact queryName(const std::string &name)
Find out information about a registered name.
static bool exists(const std::string &port, bool quiet=true, bool checkVer=true)
Check for a port to be ready and responsive.
static void setVerbosity(int verbosity)
Set level of verbosity of YARP messages.
static void initMinimum()
Basic system initialization, not including plugins.
static int sendMessage(const std::string &port, yarp::os::PortWriter &writable, bool silent=false)
Just a reminder to sendMessage with temporary output parameter that will be discarded.
static void autoInitMinimum()
Basic system initialization, not including plugins.
static void finiMinimum()
Deinitialization, excluding plugins.
static Contact detectNameServer(bool useDetectedServer, bool &scanNeeded, bool &serverUsed)
Scan for an available name server.
static bool setProperty(const char *name, const char *key, const Value &value)
Names registered with the nameserver can have arbitrary key->value properties associated with them.
static int getDefaultPortRange()
Under normal operation, YARP has a name server that manages a pool of (socket) ports starting at a po...
static void lock()
Call wait() on a global mutual-exclusion semaphore allocated by YARP.
static std::string getConfigFile(const char *fname)
Search for a configuration file in YARP's standard config file path.
static Contact registerName(const std::string &name)
Register a name with the name server.
static int disconnectInput(const std::string &src, const std::string &dest, bool silent=false)
Sends a disconnection command to the specified port.
static bool waitConnection(const std::string &source, const std::string &destination, bool quiet=false)
Delays the system until a specified connection is established.
static void assertion(bool shouldBeTrue)
An assertion.
static bool checkNetwork()
Check if the YARP Network is up and running.
static bool writeToNameServer(PortWriter &cmd, PortReader &reply, const ContactStyle &style)
Variant write method specialized to name server.
static bool disconnect(const std::string &src, const std::string &dest, bool quiet)
Request that an output port disconnect from an input port.
static bool localNetworkAllocation()
Check where the name server in use expects processes to allocate their own network resources.
static Value * getProperty(const char *name, const char *key)
Look up the value associated with a particular key for a named entry registered with the nameserver.
static bool isValidPortName(const std::string &portName)
Checks that the port has a valid name.
static bool setConnectionQos(const std::string &src, const std::string &dest, const QosStyle &srcStyle, const QosStyle &destStyle, bool quiet=true)
Adjust the Qos preferences of a connection.
static bool write(const Contact &contact, PortWriter &cmd, PortReader &reply, bool admin=false, bool quiet=false, double timeout=-1)
Send a single command to a port and await a single response.
static bool isConnected(const std::string &src, const std::string &dest, bool quiet)
Check if a connection with tcp carrier exists between two ports.
static bool cleanUnresponsivePorts(double timeout=-1)
Clean up unresponsive ports from the name server.
static bool setLocalMode(bool flag)
Chooses whether communication is process-local.
The output side of an active connection between two ports.
virtual Connection & getConnection()=0
Get the connection whose protocol operations we are managing.
virtual bool open(const Route &route)=0
Start negotiating a carrier, using the given route (this should generally match the name of the sendi...
virtual InputProtocol & getInput()=0
Get an interface for doing read operations on the connection.
virtual void close()=0
Negotiate an end to operations.
virtual bool setTimeout(double timeout)=0
Set the timeout to be used for network operations.
virtual bool write(SizedWriter &writer)=0
Write a message on the connection.
virtual return_getConnectionInfo getConnectionInfoOut(const std::string &portname)
Give details about the output connection going from this port to another port.
virtual return_getAdminProtocolVersion getAdminProtocolVersion()
Report the version of the administrative protocol of this port (it is distinct from the version of th...
virtual return_getConnectionQos getConnectionQosOut(const std::string &portname)
Get the quality of service of the output connection going from this port to another port.
virtual return_setConnectionQos setConnectionQosOut(const std::string &portname, const std::int32_t scheduler_priority, const std::int32_t scheduler_policy, const std::int32_t qos_tos)
Set the quality of service of the output connection going from this port to another port.
virtual return_getConnectionQos getConnectionQosIn(const std::string &portname)
Get the quality of service of the input connection coming from another port to this port.
virtual return_setConnectionQos setConnectionQosIn(const std::string &portname, const std::int32_t scheduler_priority, const std::int32_t scheduler_policy, const std::int32_t qos_tos)
Set the quality of service of the input connection coming from another port to this port.
virtual return_getConnectionInfo getConnectionInfoIn(const std::string &portname)
Give details about the input connection coming from another port to this port.
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...
virtual bool write(ConnectionWriter &writer) const =0
Write this object to a network connection.
A mini-server for network communication.
bool write(const PortWriter &writer, const PortWriter *callback=nullptr) const override
Write an object to the port.
void setAdminMode(bool adminMode=true)
Turn on/off "admin" mode.
bool addOutput(const std::string &name) override
Add an output connection to the specified port.
bool openFake(const std::string &name)
Start port without making it accessible from the network.
A class for storing options and configuration information.
Preferences for the port's Quality of Service.
int getThreadPolicy() const
returns the communication thread scheduling policy
void setThreadPriority(int priority)
sets the communication thread priority level
void setPacketPrioritybyTOS(int tos)
sets the packet priority given as TOS value
int getPacketPriorityAsTOS() const
returns the packet TOS value
int getThreadPriority() const
returns the communication thread priority level
void setThreadPolicy(int policy)
sets the communication thread scheduling policy
Information about a connection between two ports.
Minimal requirements for an efficient Writer.
static void delaySystem(double seconds)
A single value (typically within a Bottle).
virtual Bottle * asList() const
Get list value.
Pick out a set of relevant plugins.
void scan()
Find plugin configuration files, and run [plugin] sections through the select method.
static bool checkPlugin(const std::string &name, const std::string &type={})
Checks if a pluigin of the given type is available.
Collect hints for finding a particular plugin.
bool setSelector(YarpPluginSelector &selector)
Use a selector to find a plugin or plugins.
std::string getLibraryName() const
void setLibraryMethodName(const std::string &dll_name, const std::string &fn_name)
Set the name of the library to load and the method name to use as a factory.
void setPluginName(const std::string &name)
Set the name of the plugin to load.
std::string getMethodName() const
A helper for creating cached object descriptions.
Small helper class to help deal with legacy YARP configuration files.
static std::string expandFilename(const char *fname)
Simple Readable and Writable object representing a command to a YARP port.
Client side of the administrative commands defined in PortCoreMsgs.thrift and handled by PortCore::ad...
Reply of PortCoreMsgs::addConnection().
Reply of PortCoreMsgs::delConnection().
Reply of PortCoreMsgs::getConnectionInfoIn() and PortCoreMsgs::getConnectionInfoOut().
Reply of PortCoreMsgs::getConnectionQosIn() and PortCoreMsgs::getConnectionQosOut().
yarp::os::ThreadInfoData thread
Reply of PortCoreMsgs::setConnectionQosIn() and PortCoreMsgs::setConnectionQosOut().
DumpObj * factory(Bottle &obj)
#define yCInfo(component,...)
#define yCError(component,...)
#define yCAssert(component, x)
#define yCTrace(component,...)
#define yCWarning(component,...)
#define yCDebug(component,...)
#define yCFatal(component,...)
#define YARP_OS_LOG_COMPONENT(name, name_string)
std::string get_string(const std::string &key, bool *found=nullptr)
Read a string from an environment variable.
yarpClockType getClockType()
void useSystemClock()
Configure YARP to use system time (this is the default).
bool isClockInitialized()
Check if YARP clock is initialized.
void useNetworkClock(const std::string &clock, const std::string &localPortName="")
Configure YARP to read time from a specified topic.
void useCustomClock(Clock *clock)
Configure YARP clients to use a custom clock source provided by the user.
void startTurboBoost()
For OS where it makes sense sets the scheduler to be called more often.
The components from which ports and connections are built.
An interface to the operating system, including Port based communication.
@ YARP_CLOCK_UNINITIALIZED