43 if (!writer.
writeString(
"getRemoteProtocolVersion")) {
57 if (!helper_proto.read(connection)) {
67 if(!
yarp().canWrite()) {
68 yError(
" Missing server method FrameTransformStorageSetRPC::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();
163 static constexpr const char*
s_tag{
"setTransformsRPC"};
167 static constexpr const char*
s_prototype{
"yarp::dev::ReturnValue FrameTransformStorageSetRPC::setTransformsRPC(const std::vector<yarp::math::FrameTransform>& transforms)"};
226 static constexpr const char*
s_tag{
"setTransformRPC"};
230 static constexpr const char*
s_prototype{
"yarp::dev::ReturnValue FrameTransformStorageSetRPC::setTransformRPC(const yarp::math::FrameTransform& transform)"};
290 static constexpr const char*
s_tag{
"deleteTransformRPC"};
294 static constexpr const char*
s_prototype{
"yarp::dev::ReturnValue FrameTransformStorageSetRPC::deleteTransformRPC(const std::string& src, const std::string& dst)"};
348 static constexpr const char*
s_tag{
"clearAllRPC"};
352 static constexpr const char*
s_prototype{
"yarp::dev::ReturnValue FrameTransformStorageSetRPC::clearAllRPC()"};
373 transforms{transforms}
383 return write(writer);
398 if (!writeTag(writer)) {
401 if (!writeArgs(writer)) {
420 for (
const auto& _item : transforms) {
433 if (!readTag(reader)) {
436 if (!readArgs(reader)) {
467 if constexpr (expected_tag != 0) {
468 if (_csize != 0 && _etype.
code != expected_tag) {
472 transforms.resize(_csize);
473 for (
size_t _i = 0; _i < _csize; ++_i) {
495 return write(writer);
507 if (!writer.
write(return_helper)) {
520 if (!reader.
read(return_helper)) {
559 return write(writer);
574 if (!writeTag(writer)) {
577 if (!writeArgs(writer)) {
601 if (!readTag(reader)) {
604 if (!readArgs(reader)) {
643 return write(writer);
655 if (!writer.
write(return_helper)) {
668 if (!reader.
read(return_helper)) {
708 return write(writer);
723 if (!writeTag(writer)) {
726 if (!writeArgs(writer)) {
753 if (!readTag(reader)) {
756 if (!readArgs(reader)) {
803 return write(writer);
815 if (!writer.
write(return_helper)) {
828 if (!reader.
read(return_helper)) {
857 return write(writer);
872 if (!writeTag(writer)) {
875 if (!writeArgs(writer)) {
896 if (!readTag(reader)) {
899 if (!readArgs(reader)) {
930 return write(writer);
942 if (!writer.
write(return_helper)) {
955 if (!reader.
read(return_helper)) {
970 yarp().setOwner(*
this);
975 if (!
yarp().canWrite()) {
979 bool ok =
yarp().write(helper, helper);
985 if (!
yarp().canWrite()) {
989 bool ok =
yarp().write(helper, helper);
995 if (!
yarp().canWrite()) {
999 bool ok =
yarp().write(helper, helper);
1005 if (!
yarp().canWrite()) {
1009 bool ok =
yarp().write(helper, helper);
1016 bool showAll = (functionName ==
"--all");
1017 std::vector<std::string> helpString;
1019 helpString.emplace_back(
"*** Available commands:");
1024 helpString.emplace_back(
"help");
1038 if (functionName ==
"help") {
1039 helpString.emplace_back(
"std::vector<std::string> help(const std::string& functionName = \"--all\")");
1040 helpString.emplace_back(
"Return list of available commands, or help message for a specific function");
1041 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");
1042 helpString.emplace_back(
"@return list of strings (one string per line)");
1045 if (helpString.empty()) {
1046 helpString.emplace_back(
"Command not found");
1054 constexpr size_t max_tag_len = 1;
1064 std::string tag = reader.
readTag(1);
1065 bool direct = (tag ==
"__direct__");
1069 while (tag_len <= max_tag_len && !reader.
isError()) {
1070 if(tag ==
"getRemoteProtocolVersion") {
1077 auto proto = getLocalProtocolVersion();
1083 if (!writer.
write(proto)) {
1150 if (tag ==
"help") {
1151 std::string functionName;
1153 functionName =
"--all";
1155 auto help_strings = help(functionName);
1161 if (!writer.
writeTag(
"many", 1, 0)) {
1167 for (
const auto& help_string : help_strings) {
1183 std::string next_tag = reader.
readTag(1);
1184 if (next_tag.empty()) {
1187 tag.append(
"_").append(next_tag);
1188 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 readNested(WirePortable &obj)
bool readString(std::string &str, bool *is_vocab=nullptr)
void readListBegin(yarp::os::idl::WireState &nstate, size_t &len)
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 writeNested(const WirePortable &obj) 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