43 if (!writer.
writeString(
"getRemoteProtocolVersion")) {
57 if (!helper_proto.read(connection)) {
67 if(!
yarp().canWrite()) {
68 yError(
" Missing server method FrameTransformStorageGetRPC::getRemoteProtocolVersion");
73 return helper.helper_proto;}
84 if (remproto.protocol_version != locproto.protocol_version)
86 yCError(SERVICE_LOG_COMPONENT) <<
"Invalid communication protocol.";
87 yCError(SERVICE_LOG_COMPONENT) <<
"Local Protocol Version: " << locproto.toString();
88 yCError(SERVICE_LOG_COMPONENT) <<
"Remote Protocol Version: " << remproto.toString();
158 static constexpr const char*
s_tag{
"getTransformsRPC"};
162 static constexpr const char*
s_prototype{
"return_getAllTransforms FrameTransformStorageGetRPC::getTransformsRPC()"};
183 return write(writer);
198 if (!writeTag(writer)) {
201 if (!writeArgs(writer)) {
222 if (!readTag(reader)) {
225 if (!readArgs(reader)) {
256 return write(writer);
271 if (!writer.
write(return_helper)) {
287 if (!reader.
read(return_helper)) {
302 yarp().setOwner(*
this);
307 if (!
yarp().canWrite()) {
311 bool ok =
yarp().write(helper, helper);
318 bool showAll = (functionName ==
"--all");
319 std::vector<std::string> helpString;
321 helpString.emplace_back(
"*** Available commands:");
323 helpString.emplace_back(
"help");
328 if (functionName ==
"help") {
329 helpString.emplace_back(
"std::vector<std::string> help(const std::string& functionName = \"--all\")");
330 helpString.emplace_back(
"Return list of available commands, or help message for a specific function");
331 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");
332 helpString.emplace_back(
"@return list of strings (one string per line)");
335 if (helpString.empty()) {
336 helpString.emplace_back(
"Command not found");
344 constexpr size_t max_tag_len = 1;
354 std::string tag = reader.
readTag(1);
355 bool direct = (tag ==
"__direct__");
359 while (tag_len <= max_tag_len && !reader.
isError()) {
360 if(tag ==
"getRemoteProtocolVersion") {
367 auto proto = getLocalProtocolVersion();
373 if (!writer.
write(proto)) {
396 std::string functionName;
398 functionName =
"--all";
400 auto help_strings = help(functionName);
406 if (!writer.
writeTag(
"many", 1, 0)) {
412 for (
const auto& help_string : help_strings) {
428 std::string next_tag = reader.
readTag(1);
429 if (next_tag.empty()) {
432 tag.append(
"_").append(next_tag);
433 tag_len = std::count(tag.begin(), tag.end(),
'_') + 1;
short int protocol_version
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(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))
bool read(WirePortable &obj)
IDL-friendly connection writer.
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,...)
The main, catch-all namespace for YARP.
#define YARP_VERSION_PATCH
#define YARP_VERSION_MAJOR
#define YARP_VERSION_MINOR