67 static constexpr const char*
s_tag{
"getMetadata"};
71 static constexpr const char*
s_prototype{
"SensorRPCData MultipleAnalogSensorsMetadata::getMetadata()"};
73 "Read the sensor metadata necessary to configure the MultipleAnalogSensorsClient device."
109 if (!writeTag(writer)) {
112 if (!writeArgs(writer)) {
133 if (!readTag(reader)) {
136 if (!readArgs(reader)) {
167 return write(writer);
182 if (!writer.
write(return_helper)) {
198 if (!reader.
read(return_helper)) {
213 yarp().setOwner(*
this);
218 if (!
yarp().canWrite()) {
222 bool ok =
yarp().write(helper, helper);
229 bool showAll = (functionName ==
"--all");
230 std::vector<std::string> helpString;
232 helpString.emplace_back(
"*** Available commands:");
234 helpString.emplace_back(
"help");
240 if (functionName ==
"help") {
241 helpString.emplace_back(
"std::vector<std::string> help(const std::string& functionName = \"--all\")");
242 helpString.emplace_back(
"Return list of available commands, or help message for a specific function");
243 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");
244 helpString.emplace_back(
"@return list of strings (one string per line)");
247 if (helpString.empty()) {
248 helpString.emplace_back(
"Command not found");
256 constexpr size_t max_tag_len = 1;
266 std::string tag = reader.
readTag(1);
267 bool direct = (tag ==
"__direct__");
271 while (tag_len <= max_tag_len && !reader.
isError()) {
288 std::string functionName;
290 functionName =
"--all";
292 auto help_strings = help(functionName);
298 if (!writer.
writeTag(
"many", 1, 0)) {
304 for (
const auto& help_string : help_strings) {
320 std::string next_tag = reader.
readTag(1);
321 if (next_tag.empty()) {
324 tag.append(
"_").append(next_tag);
325 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.