YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
return_get_last_velocity_command.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 double x_vel,
16 const double y_vel,
17 const double theta_vel) :
18 WirePortable(),
19 ret(ret),
20 x_vel(x_vel),
21 y_vel(y_vel),
22 theta_vel(theta_vel)
23{
24}
25
26// Read structure on a Wire
28{
29 if (!read_ret(reader)) {
30 return false;
31 }
32 if (!read_x_vel(reader)) {
33 return false;
34 }
35 if (!read_y_vel(reader)) {
36 return false;
37 }
38 if (!read_theta_vel(reader)) {
39 return false;
40 }
41 if (reader.isError()) {
42 return false;
43 }
44 return true;
45}
46
47// Read structure on a Connection
49{
50 yarp::os::idl::WireReader reader(connection);
51 if (!reader.readListHeader(4)) {
52 return false;
53 }
54 if (!read(reader)) {
55 return false;
56 }
57 return true;
58}
59
60// Write structure on a Wire
62{
63 if (!write_ret(writer)) {
64 return false;
65 }
66 if (!write_x_vel(writer)) {
67 return false;
68 }
69 if (!write_y_vel(writer)) {
70 return false;
71 }
72 if (!write_theta_vel(writer)) {
73 return false;
74 }
75 if (writer.isError()) {
76 return false;
77 }
78 return true;
79}
80
81// Write structure on a Connection
83{
84 yarp::os::idl::WireWriter writer(connection);
85 if (!writer.writeListHeader(4)) {
86 return false;
87 }
88 if (!write(writer)) {
89 return false;
90 }
91 return true;
92}
93
94// Convert to a printable string
96{
98 if (!yarp::os::Portable::copyPortable(*this, b)) {
99 return {};
100 }
101 return b.toString();
102}
103
104// read ret field
105bool return_get_last_velocity_command::read_ret(yarp::os::idl::WireReader& reader)
106{
107 if (!reader.readBool(ret)) {
108 ret = false;
109 }
110 return true;
111}
112
113// write ret field
114bool return_get_last_velocity_command::write_ret(const yarp::os::idl::WireWriter& writer) const
115{
116 if (!writer.writeBool(ret)) {
117 return false;
118 }
119 return true;
120}
121
122// read (nested) ret field
123bool return_get_last_velocity_command::nested_read_ret(yarp::os::idl::WireReader& reader)
124{
125 if (!reader.readBool(ret)) {
126 ret = false;
127 }
128 return true;
129}
130
131// write (nested) ret field
132bool return_get_last_velocity_command::nested_write_ret(const yarp::os::idl::WireWriter& writer) const
133{
134 if (!writer.writeBool(ret)) {
135 return false;
136 }
137 return true;
138}
139
140// read x_vel field
141bool return_get_last_velocity_command::read_x_vel(yarp::os::idl::WireReader& reader)
142{
143 if (reader.noMore()) {
144 reader.fail();
145 return false;
146 }
147 if (!reader.readFloat64(x_vel)) {
148 reader.fail();
149 return false;
150 }
151 return true;
152}
153
154// write x_vel field
155bool return_get_last_velocity_command::write_x_vel(const yarp::os::idl::WireWriter& writer) const
156{
157 if (!writer.writeFloat64(x_vel)) {
158 return false;
159 }
160 return true;
161}
162
163// read (nested) x_vel field
164bool return_get_last_velocity_command::nested_read_x_vel(yarp::os::idl::WireReader& reader)
165{
166 if (reader.noMore()) {
167 reader.fail();
168 return false;
169 }
170 if (!reader.readFloat64(x_vel)) {
171 reader.fail();
172 return false;
173 }
174 return true;
175}
176
177// write (nested) x_vel field
178bool return_get_last_velocity_command::nested_write_x_vel(const yarp::os::idl::WireWriter& writer) const
179{
180 if (!writer.writeFloat64(x_vel)) {
181 return false;
182 }
183 return true;
184}
185
186// read y_vel field
187bool return_get_last_velocity_command::read_y_vel(yarp::os::idl::WireReader& reader)
188{
189 if (reader.noMore()) {
190 reader.fail();
191 return false;
192 }
193 if (!reader.readFloat64(y_vel)) {
194 reader.fail();
195 return false;
196 }
197 return true;
198}
199
200// write y_vel field
201bool return_get_last_velocity_command::write_y_vel(const yarp::os::idl::WireWriter& writer) const
202{
203 if (!writer.writeFloat64(y_vel)) {
204 return false;
205 }
206 return true;
207}
208
209// read (nested) y_vel field
210bool return_get_last_velocity_command::nested_read_y_vel(yarp::os::idl::WireReader& reader)
211{
212 if (reader.noMore()) {
213 reader.fail();
214 return false;
215 }
216 if (!reader.readFloat64(y_vel)) {
217 reader.fail();
218 return false;
219 }
220 return true;
221}
222
223// write (nested) y_vel field
224bool return_get_last_velocity_command::nested_write_y_vel(const yarp::os::idl::WireWriter& writer) const
225{
226 if (!writer.writeFloat64(y_vel)) {
227 return false;
228 }
229 return true;
230}
231
232// read theta_vel field
233bool return_get_last_velocity_command::read_theta_vel(yarp::os::idl::WireReader& reader)
234{
235 if (reader.noMore()) {
236 reader.fail();
237 return false;
238 }
239 if (!reader.readFloat64(theta_vel)) {
240 reader.fail();
241 return false;
242 }
243 return true;
244}
245
246// write theta_vel field
247bool return_get_last_velocity_command::write_theta_vel(const yarp::os::idl::WireWriter& writer) const
248{
249 if (!writer.writeFloat64(theta_vel)) {
250 return false;
251 }
252 return true;
253}
254
255// read (nested) theta_vel field
256bool return_get_last_velocity_command::nested_read_theta_vel(yarp::os::idl::WireReader& reader)
257{
258 if (reader.noMore()) {
259 reader.fail();
260 return false;
261 }
262 if (!reader.readFloat64(theta_vel)) {
263 reader.fail();
264 return false;
265 }
266 return true;
267}
268
269// write (nested) theta_vel field
270bool return_get_last_velocity_command::nested_write_theta_vel(const yarp::os::idl::WireWriter& writer) const
271{
272 if (!writer.writeFloat64(theta_vel)) {
273 return false;
274 }
275 return true;
276}
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 readFloat64(yarp::conf::float64_t &x)
IDL-friendly connection writer.
Definition WireWriter.h:28
bool writeBool(bool x, bool skip_tag=false) const
bool writeListHeader(int len) const
bool writeFloat64(yarp::conf::float64_t x, bool skip_tag=false) const