67 static constexpr const char*
s_tag{
"getTransformsRPC"};
71 static constexpr const char*
s_prototype{
"return_getAllTransforms FrameTransformStorageGetRPC::getTransformsRPC()"};
72 static constexpr const char*
s_help{
""};
107 if (!writeTag(writer)) {
110 if (!writeArgs(writer)) {
131 if (!readTag(reader)) {
134 if (!readArgs(reader)) {
165 return write(writer);
180 if (!writer.
write(return_helper)) {
196 if (!reader.
read(return_helper)) {
211 yarp().setOwner(*
this);
216 if (!
yarp().canWrite()) {
220 bool ok =
yarp().write(helper, helper);
227 bool showAll = (functionName ==
"--all");
228 std::vector<std::string> helpString;
230 helpString.emplace_back(
"*** Available commands:");
232 helpString.emplace_back(
"help");
237 if (functionName ==
"help") {
238 helpString.emplace_back(
"std::vector<std::string> help(const std::string& functionName = \"--all\")");
239 helpString.emplace_back(
"Return list of available commands, or help message for a specific function");
240 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");
241 helpString.emplace_back(
"@return list of strings (one string per line)");
244 if (helpString.empty()) {
245 helpString.emplace_back(
"Command not found");
253 constexpr size_t max_tag_len = 1;
263 std::string tag = reader.
readTag(1);
264 bool direct = (tag ==
"__direct__");
268 while (tag_len <= max_tag_len && !reader.
isError()) {
285 std::string functionName;
287 functionName =
"--all";
289 auto help_strings = help(functionName);
295 if (!writer.
writeTag(
"many", 1, 0)) {
301 for (
const auto& help_string : help_strings) {
317 std::string next_tag = reader.
readTag(1);
318 if (next_tag.empty()) {
321 tag.append(
"_").append(next_tag);
322 tag_len = std::count(tag.begin(), tag.end(),
'_') + 1;
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.
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
The main, catch-all namespace for YARP.