13 #include <yarp/os/idl/WireTypes.h>
21 public yarp::os::Portable
25 bool write(yarp::os::ConnectionWriter& connection)
const override;
26 bool read(yarp::os::ConnectionReader& connection)
override;
29 public yarp::os::idl::WirePortable
35 bool write(yarp::os::ConnectionWriter& connection)
const override;
36 bool read(yarp::os::ConnectionReader& connection)
override;
38 bool write(
const yarp::os::idl::WireWriter& writer)
const override;
39 bool writeTag(
const yarp::os::idl::WireWriter& writer)
const;
40 bool writeArgs(
const yarp::os::idl::WireWriter& writer)
const;
42 bool read(yarp::os::idl::WireReader& reader)
override;
43 bool readTag(yarp::os::idl::WireReader& reader);
44 bool readArgs(yarp::os::idl::WireReader& reader);
48 public yarp::os::idl::WirePortable
54 bool write(yarp::os::ConnectionWriter& connection)
const override;
55 bool read(yarp::os::ConnectionReader& connection)
override;
57 bool write(
const yarp::os::idl::WireWriter& writer)
const override;
58 bool read(yarp::os::idl::WireReader& reader)
override;
69 static constexpr
const char*
s_tag{
"getMetadata"};
73 static constexpr
const char*
s_prototype{
"rawValuesKeyMetadataMap RawValuesPublisherMetadata::getMetadata()"};
75 "Read the rawvalues metadata necessary to configure the RawValuesPublisherClient device."
82 return cmd.write(connection);
92 yarp::os::idl::WireWriter writer(connection);
101 yarp::os::idl::WireReader reader(connection);
102 if (!reader.readListHeader()) {
111 if (!writeTag(writer)) {
114 if (!writeArgs(writer)) {
135 if (!readTag(reader)) {
138 if (!readArgs(reader)) {
146 std::string tag = reader.readTag(
s_tag_len);
147 if (reader.isError()) {
159 if (!reader.noMore()) {
168 yarp::os::idl::WireWriter writer(connection);
169 return write(writer);
174 yarp::os::idl::WireReader reader(connection);
180 if (!writer.isNull()) {
184 if (!writer.write(return_helper)) {
193 if (!reader.readListReturn()) {
196 if (reader.noMore()) {
200 if (!reader.read(return_helper)) {
215 yarp().setOwner(*
this);
220 if (!
yarp().canWrite()) {
224 bool ok =
yarp().write(helper, helper);
231 bool showAll = (functionName ==
"--all");
232 std::vector<std::string> helpString;
234 helpString.emplace_back(
"*** Available commands:");
236 helpString.emplace_back(
"help");
242 if (functionName ==
"help") {
243 helpString.emplace_back(
"std::vector<std::string> help(const std::string& functionName = \"--all\")");
244 helpString.emplace_back(
"Return list of available commands, or help message for a specific function");
245 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");
246 helpString.emplace_back(
"@return list of strings (one string per line)");
249 if (helpString.empty()) {
250 helpString.emplace_back(
"Command not found");
258 constexpr
size_t max_tag_len = 1;
261 yarp::os::idl::WireReader reader(connection);
262 reader.expectAccept();
263 if (!reader.readListHeader()) {
268 std::string tag = reader.readTag(1);
269 bool direct = (tag ==
"__direct__");
271 tag = reader.readTag(1);
273 while (tag_len <= max_tag_len && !reader.isError()) {
282 yarp::os::idl::WireWriter writer(reader);
290 std::string functionName;
291 if (!reader.readString(functionName)) {
292 functionName =
"--all";
294 auto help_strings =
help(functionName);
295 yarp::os::idl::WireWriter writer(reader);
296 if (!writer.isNull()) {
297 if (!writer.writeListHeader(2)) {
300 if (!writer.writeTag(
"many", 1, 0)) {
303 if (!writer.writeListBegin(0, help_strings.size())) {
306 for (
const auto& help_string : help_strings) {
307 if (!writer.writeString(help_string)) {
311 if (!writer.writeListEnd()) {
318 if (reader.noMore()) {
322 std::string next_tag = reader.readTag(1);
323 if (next_tag.empty()) {
326 tag.append(
"_").append(next_tag);
327 tag_len = std::count(tag.begin(), tag.end(),
'_') + 1;
This file contains the definition of unique IDs for the body parts and the skin parts of the robot.
Copyright (C) 2008 RobotCub Consortium.