20 "yarp.portmonitor.rpcMonitor",
34 const std::string source_port = (sender ? source : destination) +
"/monitor";
36 const std::string monitor_port = options.
check(
"monitor_name",
yarp::os::Value(
"/monitor")).asString();
39 yCError(RPCMONITOR,
"Attaching on receiver side is not supported yet.");
42 if (!port.
open(source_port)) {
43 yCError(RPCMONITOR,
"Could not open port %s.", source_port.c_str());
48 yCError(RPCMONITOR,
"Could not connect to port %s.", monitor_port.c_str());
62 msg.
addString(sender ?
"client" :
"server");
65 auto& bargs [[maybe_unused]] = msg.
addList();
66 auto& breply [[maybe_unused]] = msg.
addList();
69 bcmd.
addString(reply->cmd.get(0).toString());
72 bcmd.addString(cmd->get(0).toString());
75 yCWarning(RPCMONITOR) <<
"Sending unknown command";
76 bcmd.addString(
"[unknown]");
93 msg.
addString(sender ?
"rpc client" :
"rpc server");
96 auto& bargs [[maybe_unused]] = msg.
addList();
97 auto& breply [[maybe_unused]] = msg.
addList();
100 bcmd.
addString(reply->cmd.get(0).toString());
106 yCWarning(RPCMONITOR) <<
"Received unknown reply";
107 bcmd.addString(
"[unknown]");
yarp::os::Things & updateReply(yarp::os::Things &thing) override
The updateReply makes it possible to modify a reply from a port when the portmonitor object is attach...
bool create(const yarp::os::Property &options) override
This will be called when the dll is properly loaded by the portmonitor carrier.
yarp::os::Things & update(yarp::os::Things &thing) override
After data get accpeted in the accept() callback, an instance of that is given to the update function...
A simple collection of objects that can be described and transmitted in a portable way.
Bottle & addList()
Places an empty nested list in the bottle, at the end of the list.
void addFloat64(yarp::conf::float64_t x)
Places a 64-bit floating point number 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.
static LogCallback printCallback()
Get current print callback.
static LogType minimumPrintLevel()
Get current minimum print level.
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.
int getOutputCount() override
Determine how many output connections this port has.
bool write(const PortWriter &writer, const PortWriter *callback=nullptr) const override
Write an object to the port.
bool open(const std::string &name) override
Start port operation, with a specific name, with automatically-chosen network parameters.
static bool copyPortable(const PortWriter &writer, PortReader &reader)
Copy one portable to another, via writing and reading.
A class for storing options and configuration information.
Value & find(const std::string &key) const override
Gets a value corresponding to a given keyword.
bool check(const std::string &key) const override
Check if there exists a property of the given name.
static double nowSystem()
Base class for generic things.
A single value (typically within a Bottle).
virtual bool asBool() const
Get boolean value.
virtual std::string asString() const
Get string value.
#define yCError(component,...)
#define yCWarning(component,...)
#define yCDebug(component,...)
#define YARP_LOG_COMPONENT(name,...)