YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
SensorStreamingData.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
11#include <SensorStreamingData.h>
12
13// Constructor with field values
37
38// Read structure on a Wire
40{
41 if (!read_ThreeAxisGyroscopes(reader)) {
42 return false;
43 }
44 if (!read_ThreeAxisLinearAccelerometers(reader)) {
45 return false;
46 }
47 if (!read_ThreeAxisMagnetometers(reader)) {
48 return false;
49 }
50 if (!read_OrientationSensors(reader)) {
51 return false;
52 }
53 if (!read_TemperatureSensors(reader)) {
54 return false;
55 }
56 if (!read_SixAxisForceTorqueSensors(reader)) {
57 return false;
58 }
59 if (!read_ContactLoadCellArrays(reader)) {
60 return false;
61 }
62 if (!read_EncoderArrays(reader)) {
63 return false;
64 }
65 if (!read_SkinPatches(reader)) {
66 return false;
67 }
68 if (!read_PositionSensors(reader)) {
69 return false;
70 }
71 if (reader.isError()) {
72 return false;
73 }
74 return true;
75}
76
77// Read structure on a Connection
79{
80 yarp::os::idl::WireReader reader(connection);
81 if (!reader.readListHeader(10)) {
82 return false;
83 }
84 if (!read(reader)) {
85 return false;
86 }
87 return true;
88}
89
90// Write structure on a Wire
92{
93 if (!write_ThreeAxisGyroscopes(writer)) {
94 return false;
95 }
96 if (!write_ThreeAxisLinearAccelerometers(writer)) {
97 return false;
98 }
99 if (!write_ThreeAxisMagnetometers(writer)) {
100 return false;
101 }
102 if (!write_OrientationSensors(writer)) {
103 return false;
104 }
105 if (!write_TemperatureSensors(writer)) {
106 return false;
107 }
108 if (!write_SixAxisForceTorqueSensors(writer)) {
109 return false;
110 }
111 if (!write_ContactLoadCellArrays(writer)) {
112 return false;
113 }
114 if (!write_EncoderArrays(writer)) {
115 return false;
116 }
117 if (!write_SkinPatches(writer)) {
118 return false;
119 }
120 if (!write_PositionSensors(writer)) {
121 return false;
122 }
123 if (writer.isError()) {
124 return false;
125 }
126 return true;
127}
128
129// Write structure on a Connection
131{
132 yarp::os::idl::WireWriter writer(connection);
133 if (!writer.writeListHeader(10)) {
134 return false;
135 }
136 if (!write(writer)) {
137 return false;
138 }
139 return true;
140}
141
142// Convert to a printable string
144{
146 if (!yarp::os::Portable::copyPortable(*this, b)) {
147 return {};
148 }
149 return b.toString();
150}
151
152// read ThreeAxisGyroscopes field
153bool SensorStreamingData::read_ThreeAxisGyroscopes(yarp::os::idl::WireReader& reader)
154{
155 if (reader.noMore()) {
156 reader.fail();
157 return false;
158 }
159 if (!reader.read(ThreeAxisGyroscopes)) {
160 reader.fail();
161 return false;
162 }
163 return true;
164}
165
166// write ThreeAxisGyroscopes field
167bool SensorStreamingData::write_ThreeAxisGyroscopes(const yarp::os::idl::WireWriter& writer) const
168{
169 if (!writer.write(ThreeAxisGyroscopes)) {
170 return false;
171 }
172 return true;
173}
174
175// read (nested) ThreeAxisGyroscopes field
176bool SensorStreamingData::nested_read_ThreeAxisGyroscopes(yarp::os::idl::WireReader& reader)
177{
178 if (reader.noMore()) {
179 reader.fail();
180 return false;
181 }
182 if (!reader.readNested(ThreeAxisGyroscopes)) {
183 reader.fail();
184 return false;
185 }
186 return true;
187}
188
189// write (nested) ThreeAxisGyroscopes field
190bool SensorStreamingData::nested_write_ThreeAxisGyroscopes(const yarp::os::idl::WireWriter& writer) const
191{
192 if (!writer.writeNested(ThreeAxisGyroscopes)) {
193 return false;
194 }
195 return true;
196}
197
198// read ThreeAxisLinearAccelerometers field
199bool SensorStreamingData::read_ThreeAxisLinearAccelerometers(yarp::os::idl::WireReader& reader)
200{
201 if (reader.noMore()) {
202 reader.fail();
203 return false;
204 }
205 if (!reader.read(ThreeAxisLinearAccelerometers)) {
206 reader.fail();
207 return false;
208 }
209 return true;
210}
211
212// write ThreeAxisLinearAccelerometers field
213bool SensorStreamingData::write_ThreeAxisLinearAccelerometers(const yarp::os::idl::WireWriter& writer) const
214{
216 return false;
217 }
218 return true;
219}
220
221// read (nested) ThreeAxisLinearAccelerometers field
222bool SensorStreamingData::nested_read_ThreeAxisLinearAccelerometers(yarp::os::idl::WireReader& reader)
223{
224 if (reader.noMore()) {
225 reader.fail();
226 return false;
227 }
229 reader.fail();
230 return false;
231 }
232 return true;
233}
234
235// write (nested) ThreeAxisLinearAccelerometers field
236bool SensorStreamingData::nested_write_ThreeAxisLinearAccelerometers(const yarp::os::idl::WireWriter& writer) const
237{
239 return false;
240 }
241 return true;
242}
243
244// read ThreeAxisMagnetometers field
245bool SensorStreamingData::read_ThreeAxisMagnetometers(yarp::os::idl::WireReader& reader)
246{
247 if (reader.noMore()) {
248 reader.fail();
249 return false;
250 }
251 if (!reader.read(ThreeAxisMagnetometers)) {
252 reader.fail();
253 return false;
254 }
255 return true;
256}
257
258// write ThreeAxisMagnetometers field
259bool SensorStreamingData::write_ThreeAxisMagnetometers(const yarp::os::idl::WireWriter& writer) const
260{
261 if (!writer.write(ThreeAxisMagnetometers)) {
262 return false;
263 }
264 return true;
265}
266
267// read (nested) ThreeAxisMagnetometers field
268bool SensorStreamingData::nested_read_ThreeAxisMagnetometers(yarp::os::idl::WireReader& reader)
269{
270 if (reader.noMore()) {
271 reader.fail();
272 return false;
273 }
274 if (!reader.readNested(ThreeAxisMagnetometers)) {
275 reader.fail();
276 return false;
277 }
278 return true;
279}
280
281// write (nested) ThreeAxisMagnetometers field
282bool SensorStreamingData::nested_write_ThreeAxisMagnetometers(const yarp::os::idl::WireWriter& writer) const
283{
284 if (!writer.writeNested(ThreeAxisMagnetometers)) {
285 return false;
286 }
287 return true;
288}
289
290// read OrientationSensors field
291bool SensorStreamingData::read_OrientationSensors(yarp::os::idl::WireReader& reader)
292{
293 if (reader.noMore()) {
294 reader.fail();
295 return false;
296 }
297 if (!reader.read(OrientationSensors)) {
298 reader.fail();
299 return false;
300 }
301 return true;
302}
303
304// write OrientationSensors field
305bool SensorStreamingData::write_OrientationSensors(const yarp::os::idl::WireWriter& writer) const
306{
307 if (!writer.write(OrientationSensors)) {
308 return false;
309 }
310 return true;
311}
312
313// read (nested) OrientationSensors field
314bool SensorStreamingData::nested_read_OrientationSensors(yarp::os::idl::WireReader& reader)
315{
316 if (reader.noMore()) {
317 reader.fail();
318 return false;
319 }
320 if (!reader.readNested(OrientationSensors)) {
321 reader.fail();
322 return false;
323 }
324 return true;
325}
326
327// write (nested) OrientationSensors field
328bool SensorStreamingData::nested_write_OrientationSensors(const yarp::os::idl::WireWriter& writer) const
329{
330 if (!writer.writeNested(OrientationSensors)) {
331 return false;
332 }
333 return true;
334}
335
336// read TemperatureSensors field
337bool SensorStreamingData::read_TemperatureSensors(yarp::os::idl::WireReader& reader)
338{
339 if (reader.noMore()) {
340 reader.fail();
341 return false;
342 }
343 if (!reader.read(TemperatureSensors)) {
344 reader.fail();
345 return false;
346 }
347 return true;
348}
349
350// write TemperatureSensors field
351bool SensorStreamingData::write_TemperatureSensors(const yarp::os::idl::WireWriter& writer) const
352{
353 if (!writer.write(TemperatureSensors)) {
354 return false;
355 }
356 return true;
357}
358
359// read (nested) TemperatureSensors field
360bool SensorStreamingData::nested_read_TemperatureSensors(yarp::os::idl::WireReader& reader)
361{
362 if (reader.noMore()) {
363 reader.fail();
364 return false;
365 }
366 if (!reader.readNested(TemperatureSensors)) {
367 reader.fail();
368 return false;
369 }
370 return true;
371}
372
373// write (nested) TemperatureSensors field
374bool SensorStreamingData::nested_write_TemperatureSensors(const yarp::os::idl::WireWriter& writer) const
375{
376 if (!writer.writeNested(TemperatureSensors)) {
377 return false;
378 }
379 return true;
380}
381
382// read SixAxisForceTorqueSensors field
383bool SensorStreamingData::read_SixAxisForceTorqueSensors(yarp::os::idl::WireReader& reader)
384{
385 if (reader.noMore()) {
386 reader.fail();
387 return false;
388 }
389 if (!reader.read(SixAxisForceTorqueSensors)) {
390 reader.fail();
391 return false;
392 }
393 return true;
394}
395
396// write SixAxisForceTorqueSensors field
397bool SensorStreamingData::write_SixAxisForceTorqueSensors(const yarp::os::idl::WireWriter& writer) const
398{
399 if (!writer.write(SixAxisForceTorqueSensors)) {
400 return false;
401 }
402 return true;
403}
404
405// read (nested) SixAxisForceTorqueSensors field
406bool SensorStreamingData::nested_read_SixAxisForceTorqueSensors(yarp::os::idl::WireReader& reader)
407{
408 if (reader.noMore()) {
409 reader.fail();
410 return false;
411 }
413 reader.fail();
414 return false;
415 }
416 return true;
417}
418
419// write (nested) SixAxisForceTorqueSensors field
420bool SensorStreamingData::nested_write_SixAxisForceTorqueSensors(const yarp::os::idl::WireWriter& writer) const
421{
423 return false;
424 }
425 return true;
426}
427
428// read ContactLoadCellArrays field
429bool SensorStreamingData::read_ContactLoadCellArrays(yarp::os::idl::WireReader& reader)
430{
431 if (reader.noMore()) {
432 reader.fail();
433 return false;
434 }
435 if (!reader.read(ContactLoadCellArrays)) {
436 reader.fail();
437 return false;
438 }
439 return true;
440}
441
442// write ContactLoadCellArrays field
443bool SensorStreamingData::write_ContactLoadCellArrays(const yarp::os::idl::WireWriter& writer) const
444{
445 if (!writer.write(ContactLoadCellArrays)) {
446 return false;
447 }
448 return true;
449}
450
451// read (nested) ContactLoadCellArrays field
452bool SensorStreamingData::nested_read_ContactLoadCellArrays(yarp::os::idl::WireReader& reader)
453{
454 if (reader.noMore()) {
455 reader.fail();
456 return false;
457 }
458 if (!reader.readNested(ContactLoadCellArrays)) {
459 reader.fail();
460 return false;
461 }
462 return true;
463}
464
465// write (nested) ContactLoadCellArrays field
466bool SensorStreamingData::nested_write_ContactLoadCellArrays(const yarp::os::idl::WireWriter& writer) const
467{
468 if (!writer.writeNested(ContactLoadCellArrays)) {
469 return false;
470 }
471 return true;
472}
473
474// read EncoderArrays field
475bool SensorStreamingData::read_EncoderArrays(yarp::os::idl::WireReader& reader)
476{
477 if (reader.noMore()) {
478 reader.fail();
479 return false;
480 }
481 if (!reader.read(EncoderArrays)) {
482 reader.fail();
483 return false;
484 }
485 return true;
486}
487
488// write EncoderArrays field
489bool SensorStreamingData::write_EncoderArrays(const yarp::os::idl::WireWriter& writer) const
490{
491 if (!writer.write(EncoderArrays)) {
492 return false;
493 }
494 return true;
495}
496
497// read (nested) EncoderArrays field
498bool SensorStreamingData::nested_read_EncoderArrays(yarp::os::idl::WireReader& reader)
499{
500 if (reader.noMore()) {
501 reader.fail();
502 return false;
503 }
504 if (!reader.readNested(EncoderArrays)) {
505 reader.fail();
506 return false;
507 }
508 return true;
509}
510
511// write (nested) EncoderArrays field
512bool SensorStreamingData::nested_write_EncoderArrays(const yarp::os::idl::WireWriter& writer) const
513{
514 if (!writer.writeNested(EncoderArrays)) {
515 return false;
516 }
517 return true;
518}
519
520// read SkinPatches field
521bool SensorStreamingData::read_SkinPatches(yarp::os::idl::WireReader& reader)
522{
523 if (reader.noMore()) {
524 reader.fail();
525 return false;
526 }
527 if (!reader.read(SkinPatches)) {
528 reader.fail();
529 return false;
530 }
531 return true;
532}
533
534// write SkinPatches field
535bool SensorStreamingData::write_SkinPatches(const yarp::os::idl::WireWriter& writer) const
536{
537 if (!writer.write(SkinPatches)) {
538 return false;
539 }
540 return true;
541}
542
543// read (nested) SkinPatches field
544bool SensorStreamingData::nested_read_SkinPatches(yarp::os::idl::WireReader& reader)
545{
546 if (reader.noMore()) {
547 reader.fail();
548 return false;
549 }
550 if (!reader.readNested(SkinPatches)) {
551 reader.fail();
552 return false;
553 }
554 return true;
555}
556
557// write (nested) SkinPatches field
558bool SensorStreamingData::nested_write_SkinPatches(const yarp::os::idl::WireWriter& writer) const
559{
560 if (!writer.writeNested(SkinPatches)) {
561 return false;
562 }
563 return true;
564}
565
566// read PositionSensors field
567bool SensorStreamingData::read_PositionSensors(yarp::os::idl::WireReader& reader)
568{
569 if (reader.noMore()) {
570 reader.fail();
571 return false;
572 }
573 if (!reader.read(PositionSensors)) {
574 reader.fail();
575 return false;
576 }
577 return true;
578}
579
580// write PositionSensors field
581bool SensorStreamingData::write_PositionSensors(const yarp::os::idl::WireWriter& writer) const
582{
583 if (!writer.write(PositionSensors)) {
584 return false;
585 }
586 return true;
587}
588
589// read (nested) PositionSensors field
590bool SensorStreamingData::nested_read_PositionSensors(yarp::os::idl::WireReader& reader)
591{
592 if (reader.noMore()) {
593 reader.fail();
594 return false;
595 }
596 if (!reader.readNested(PositionSensors)) {
597 reader.fail();
598 return false;
599 }
600 return true;
601}
602
603// write (nested) PositionSensors field
604bool SensorStreamingData::nested_write_PositionSensors(const yarp::os::idl::WireWriter& writer) const
605{
606 if (!writer.writeNested(PositionSensors)) {
607 return false;
608 }
609 return true;
610}
@ ThreeAxisLinearAccelerometers
std::string toString() const
SensorMeasurements EncoderArrays
SensorMeasurements ThreeAxisLinearAccelerometers
SensorMeasurements PositionSensors
SensorMeasurements OrientationSensors
bool write(const yarp::os::idl::WireWriter &writer) const override
SensorMeasurements ThreeAxisMagnetometers
SensorMeasurements ThreeAxisGyroscopes
SensorMeasurements SixAxisForceTorqueSensors
SensorMeasurements SkinPatches
SensorStreamingData()=default
bool read(yarp::os::idl::WireReader &reader) override
SensorMeasurements ContactLoadCellArrays
SensorMeasurements TemperatureSensors
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)
bool read(WirePortable &obj)
IDL-friendly connection writer.
Definition WireWriter.h:28
bool write(const WirePortable &obj) const
bool writeListHeader(int len) const
bool writeNested(const WirePortable &obj) const