46 if (!writer.
writeString(
"getRemoteProtocolVersion")) {
60 if (!helper_proto.read(connection)) {
70 if(!
yarp().canWrite()) {
71 yError(
" Missing server method TerminatorMsgs::getRemoteProtocolVersion");
76 return helper.helper_proto;}
161 static constexpr const char*
s_tag{
"quit"};
165 static constexpr const char*
s_prototype{
"bool TerminatorMsgs::quit()"};
167 "Ask the process which owns the port to start a graceful quit procedure.\n"
168 "@return true if the request has been accepted"
189 return write(writer);
204 if (!writeTag(writer)) {
207 if (!writeArgs(writer)) {
228 if (!readTag(reader)) {
231 if (!readArgs(reader)) {
262 return write(writer);
293 if (!reader.
readBool(return_helper)) {
308 yarp().setOwner(*
this);
313 if (!
yarp().canWrite()) {
317 bool ok =
yarp().write(helper, helper);
318 return ok ? helper.reply.return_helper :
bool{};
327 helpString.emplace_back(
"*** Available commands:");
336 helpString.emplace_back(
"std::vector<std::string> help(const std::string& functionName = \"--all\")");
337 helpString.emplace_back(
"Return list of available commands, or help message for a specific function");
338 helpString.emplace_back(
"@param functionName name of command for which to get a detailed description. If none or '--all' is provided, print list of available commands");
339 helpString.emplace_back(
"@return list of strings (one string per line)");
361 std::string tag = reader.
readTag(1);
362 bool direct = (tag ==
"__direct__");
367 if(tag ==
"getRemoteProtocolVersion") {
374 auto proto = getLocalProtocolVersion();
413 if (!writer.
writeTag(
"many", 1, 0)) {
440 tag_len = std::count(tag.begin(), tag.end(),
'_') + 1;
A mini-server for performing network communication in the background.
An interface for reading from a network connection.
An interface for writing to a network connection.
This is a base class for objects that can be both read from and be written to the YARP network.
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
yarp::os::ApplicationNetworkProtocolVersion helper_proto
TerminatorMsgs_getRemoteProtocolVersion_helper()=default
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
~Command() override=default
bool writeArgs(const yarp::os::idl::WireWriter &writer) const
bool writeTag(const yarp::os::idl::WireWriter &writer) const
bool readArgs(yarp::os::idl::WireReader &reader)
bool readTag(yarp::os::idl::WireReader &reader)
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
~Reply() override=default
static constexpr size_t s_reply_len
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
static constexpr const char * s_tag
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
TerminatorMsgs_quit_helper()=default
static constexpr size_t s_tag_len
static constexpr const char * s_help
void call(TerminatorMsgs *ptr)
static constexpr size_t s_cmd_len
static constexpr const char * s_prototype
Commands accepted by the port opened by yarp::os::Terminee, and sent by yarp::os::Terminator::termina...
virtual bool checkProtocolVersion()
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
virtual yarp::os::ApplicationNetworkProtocolVersion getLocalProtocolVersion()
virtual std::vector< std::string > help(const std::string &functionName="--all")
virtual yarp::os::ApplicationNetworkProtocolVersion getRemoteProtocolVersion()
virtual bool quit()
Ask the process which owns the port to start a graceful quit procedure.
bool write(PortWriter &writer)
Write a message to the associated port or reader.
yarp::os::WireLink & yarp()
Get YARP state associated with this object.
A "tamed" Portable, that promises to serialize itself in an IDL-friendly way.
IDL-friendly connection reader.
bool readString(std::string &str, bool *is_vocab=nullptr)
std::string readTag(size_t len=static_cast< size_t >(-1))
IDL-friendly connection writer.
bool writeBool(bool x, bool skip_tag=false) const
bool write(const WirePortable &obj) const
bool writeListHeader(int len) const
bool writeTag(const char *tag, int split, int len) const
bool writeString(const std::string &str, bool skip_tag=false) const
bool writeListEnd() const
bool writeListBegin(int tag, size_t len) const
#define yCError(component,...)
#define YARP_LOG_COMPONENT(name,...)
An interface to the operating system, including Port based communication.
The main, catch-all namespace for YARP.
#define YARP_VERSION_PATCH
#define YARP_VERSION_MAJOR
#define YARP_VERSION_MINOR