YARP
Yet Another Robot Platform
return_get_estimated_odometry.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5
6// Autogenerated by Thrift Compiler (0.14.1-yarped)
7//
8// This is an automatically generated file.
9// It could get re-generated if the ALLOW_IDL_GENERATION flag is on.
10
12
13// Constructor with field values
15 const yarp::dev::OdometryData& odom) :
16 WirePortable(),
17 ret(ret),
18 odom(odom)
19{
20}
21
22// Read structure on a Wire
24{
25 if (!read_ret(reader)) {
26 return false;
27 }
28 if (!nested_read_odom(reader)) {
29 return false;
30 }
31 if (reader.isError()) {
32 return false;
33 }
34 return true;
35}
36
37// Read structure on a Connection
39{
40 yarp::os::idl::WireReader reader(connection);
41 if (!reader.readListHeader(2)) {
42 return false;
43 }
44 if (!read(reader)) {
45 return false;
46 }
47 return true;
48}
49
50// Write structure on a Wire
52{
53 if (!write_ret(writer)) {
54 return false;
55 }
56 if (!nested_write_odom(writer)) {
57 return false;
58 }
59 if (writer.isError()) {
60 return false;
61 }
62 return true;
63}
64
65// Write structure on a Connection
67{
68 yarp::os::idl::WireWriter writer(connection);
69 if (!writer.writeListHeader(2)) {
70 return false;
71 }
72 if (!write(writer)) {
73 return false;
74 }
75 return true;
76}
77
78// Convert to a printable string
80{
82 if (!yarp::os::Portable::copyPortable(*this, b)) {
83 return {};
84 }
85 return b.toString();
86}
87
88// read ret field
89bool return_get_estimated_odometry::read_ret(yarp::os::idl::WireReader& reader)
90{
91 if (!reader.readBool(ret)) {
92 ret = false;
93 }
94 return true;
95}
96
97// write ret field
98bool return_get_estimated_odometry::write_ret(const yarp::os::idl::WireWriter& writer) const
99{
100 if (!writer.writeBool(ret)) {
101 return false;
102 }
103 return true;
104}
105
106// read (nested) ret field
107bool return_get_estimated_odometry::nested_read_ret(yarp::os::idl::WireReader& reader)
108{
109 if (!reader.readBool(ret)) {
110 ret = false;
111 }
112 return true;
113}
114
115// write (nested) ret field
116bool return_get_estimated_odometry::nested_write_ret(const yarp::os::idl::WireWriter& writer) const
117{
118 if (!writer.writeBool(ret)) {
119 return false;
120 }
121 return true;
122}
123
124// read odom field
125bool return_get_estimated_odometry::read_odom(yarp::os::idl::WireReader& reader)
126{
127 if (reader.noMore()) {
128 reader.fail();
129 return false;
130 }
131 if (!reader.read(odom)) {
132 reader.fail();
133 return false;
134 }
135 return true;
136}
137
138// write odom field
139bool return_get_estimated_odometry::write_odom(const yarp::os::idl::WireWriter& writer) const
140{
141 if (!writer.write(odom)) {
142 return false;
143 }
144 return true;
145}
146
147// read (nested) odom field
148bool return_get_estimated_odometry::nested_read_odom(yarp::os::idl::WireReader& reader)
149{
150 if (reader.noMore()) {
151 reader.fail();
152 return false;
153 }
154 if (!reader.readNested(odom)) {
155 reader.fail();
156 return false;
157 }
158 return true;
159}
160
161// write (nested) odom field
162bool return_get_estimated_odometry::nested_write_odom(const yarp::os::idl::WireWriter& writer) const
163{
164 if (!writer.writeNested(odom)) {
165 return false;
166 }
167 return true;
168}
bool ret
bool read(yarp::os::idl::WireReader &reader) override
bool write(const yarp::os::idl::WireWriter &writer) const override
A simple collection of objects that can be described and transmitted in a portable way.
Definition: Bottle.h:64
std::string toString() const override
Gives a human-readable textual representation of the bottle.
Definition: Bottle.cpp:211
An interface for reading from a network connection.
An interface for writing to a network connection.
static bool copyPortable(const PortWriter &writer, PortReader &reader)
Copy one portable to another, via writing and reading.
Definition: Portable.cpp:16
IDL-friendly connection reader.
Definition: WireReader.h:27
bool readNested(WirePortable &obj)
Definition: WireReader.cpp:82
bool read(WirePortable &obj)
Definition: WireReader.cpp:72
IDL-friendly connection writer.
Definition: WireWriter.h:28
bool writeBool(bool x, bool skip_tag=false) const
Definition: WireWriter.cpp:70
bool write(const WirePortable &obj) const
Definition: WireWriter.cpp:50
bool writeListHeader(int len) const
Definition: WireWriter.cpp:231
bool writeNested(const WirePortable &obj) const
Definition: WireWriter.cpp:60