18 vectorsMap(vectorsMap)
25 if (!read_vectorsMap(reader)) {
28 if (reader.isError()) {
37 yarp::os::idl::WireReader reader(connection);
38 if (!reader.readListHeader(1)) {
50 if (!write_vectorsMap(writer)) {
53 if (writer.isError()) {
62 yarp::os::idl::WireWriter writer(connection);
63 if (!writer.writeListHeader(1)) {
76 if (!yarp::os::Portable::copyPortable(*
this, b)) {
83 bool rawValuesDataVectorsMap::read_vectorsMap(yarp::os::idl::WireReader& reader)
85 if (reader.noMore()) {
90 yarp::os::idl::WireState _ktype;
91 yarp::os::idl::WireState _vtype;
92 reader.readMapBegin(_ktype, _vtype, _csize);
93 for (
size_t _i = 0; _i < _csize; ++_i) {
95 yarp::os::idl::WireState _lst;
96 reader.readListBegin(_lst, _msize);
98 if (reader.noMore()) {
102 if (!reader.readString(_key)) {
106 std::vector<std::int32_t>& _val =
vectorsMap[_key];
107 if (reader.noMore()) {
112 yarp::os::idl::WireState _etype;
113 reader.readListBegin(_etype, _csize);
115 constexpr
int expected_tag = ((BOTTLE_TAG_INT32) & (~BOTTLE_TAG_LIST));
116 if constexpr (expected_tag != 0) {
117 if (_csize != 0 && _etype.code != expected_tag) {
122 if (_csize != 0 && !reader.readBlock(
reinterpret_cast<char*
>(_val.data()), _val.size() *
sizeof(std::int32_t))) {
125 reader.readListEnd();
126 reader.readListEnd();
133 bool rawValuesDataVectorsMap::write_vectorsMap(
const yarp::os::idl::WireWriter& writer)
const
135 if (!writer.writeMapBegin(BOTTLE_TAG_STRING, BOTTLE_TAG_LIST | BOTTLE_TAG_INT32,
vectorsMap.size())) {
139 if (!writer.writeListBegin(0,2)) {
142 if (!writer.writeString(_item.first)) {
145 if (!writer.writeListBegin(BOTTLE_TAG_INT32, _item.second.size())) {
148 if (!writer.writeBlock(
reinterpret_cast<const char*
>(_item.second.data()), _item.second.size() *
sizeof(std::int32_t))) {
151 if (!writer.writeListEnd()) {
154 if (!writer.writeListEnd()) {
158 if (!writer.writeMapEnd()) {
165 bool rawValuesDataVectorsMap::nested_read_vectorsMap(yarp::os::idl::WireReader& reader)
167 if (reader.noMore()) {
172 yarp::os::idl::WireState _ktype;
173 yarp::os::idl::WireState _vtype;
174 reader.readMapBegin(_ktype, _vtype, _csize);
175 for (
size_t _i = 0; _i < _csize; ++_i) {
177 yarp::os::idl::WireState _lst;
178 reader.readListBegin(_lst, _msize);
180 if (reader.noMore()) {
184 if (!reader.readString(_key)) {
188 std::vector<std::int32_t>& _val =
vectorsMap[_key];
189 if (reader.noMore()) {
194 yarp::os::idl::WireState _etype;
195 reader.readListBegin(_etype, _csize);
197 constexpr
int expected_tag = ((BOTTLE_TAG_INT32) & (~BOTTLE_TAG_LIST));
198 if constexpr (expected_tag != 0) {
199 if (_csize != 0 && _etype.code != expected_tag) {
204 if (_csize != 0 && !reader.readBlock(
reinterpret_cast<char*
>(_val.data()), _val.size() *
sizeof(std::int32_t))) {
207 reader.readListEnd();
208 reader.readListEnd();
215 bool rawValuesDataVectorsMap::nested_write_vectorsMap(
const yarp::os::idl::WireWriter& writer)
const
217 if (!writer.writeMapBegin(BOTTLE_TAG_STRING, BOTTLE_TAG_LIST | BOTTLE_TAG_INT32,
vectorsMap.size())) {
221 if (!writer.writeListBegin(0,2)) {
224 if (!writer.writeString(_item.first)) {
227 if (!writer.writeListBegin(BOTTLE_TAG_INT32, _item.second.size())) {
230 if (!writer.writeBlock(
reinterpret_cast<const char*
>(_item.second.data()), _item.second.size() *
sizeof(std::int32_t))) {
233 if (!writer.writeListEnd()) {
236 if (!writer.writeListEnd()) {
240 if (!writer.writeMapEnd()) {
bool write(const yarp::os::idl::WireWriter &writer) const override
std::string toString() const
bool read(yarp::os::idl::WireReader &reader) override
rawValuesDataVectorsMap()=default
std::map< std::string, std::vector< std::int32_t > > vectorsMap
contain a map of vectors of the raw data as <string, vector> the user wanna send from low to higher l...
yarp::sig::Vector & map(yarp::sig::Vector &v, double(op)(double))
Performs a unary operator inplace on each element of a vector.
This file contains the definition of unique IDs for the body parts and the skin parts of the robot.