YARP
Yet Another Robot Platform
SensorRPCData.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2020 Istituto Italiano di Tecnologia (IIT)
3  * All rights reserved.
4  *
5  * This software may be modified and distributed under the terms of the
6  * BSD-3-Clause license. See the accompanying LICENSE file for details.
7  */
8 
9 // Autogenerated by Thrift Compiler (0.12.0-yarped)
10 //
11 // This is an automatically generated file.
12 // It could get re-generated if the ALLOW_IDL_GENERATION flag is on.
13 
14 #include <SensorRPCData.h>
15 
16 // Default constructor
18  WirePortable(),
26  EncoderArrays(),
27  SkinPatches(),
29 {
30 }
31 
32 // Constructor with field values
33 SensorRPCData::SensorRPCData(const std::vector<SensorMetadata>& ThreeAxisGyroscopes,
34  const std::vector<SensorMetadata>& ThreeAxisLinearAccelerometers,
35  const std::vector<SensorMetadata>& ThreeAxisMagnetometers,
36  const std::vector<SensorMetadata>& OrientationSensors,
37  const std::vector<SensorMetadata>& TemperatureSensors,
38  const std::vector<SensorMetadata>& SixAxisForceTorqueSensors,
39  const std::vector<SensorMetadata>& ContactLoadCellArrays,
40  const std::vector<SensorMetadata>& EncoderArrays,
41  const std::vector<SensorMetadata>& SkinPatches,
42  const std::vector<SensorMetadata>& PositionSensors) :
43  WirePortable(),
54 {
55 }
56 
57 // Read structure on a Wire
59 {
60  if (!read_ThreeAxisGyroscopes(reader)) {
61  return false;
62  }
63  if (!read_ThreeAxisLinearAccelerometers(reader)) {
64  return false;
65  }
66  if (!read_ThreeAxisMagnetometers(reader)) {
67  return false;
68  }
69  if (!read_OrientationSensors(reader)) {
70  return false;
71  }
72  if (!read_TemperatureSensors(reader)) {
73  return false;
74  }
75  if (!read_SixAxisForceTorqueSensors(reader)) {
76  return false;
77  }
78  if (!read_ContactLoadCellArrays(reader)) {
79  return false;
80  }
81  if (!read_EncoderArrays(reader)) {
82  return false;
83  }
84  if (!read_SkinPatches(reader)) {
85  return false;
86  }
87  if (!read_PositionSensors(reader)) {
88  return false;
89  }
90  return !reader.isError();
91 }
92 
93 // Read structure on a Connection
95 {
96  yarp::os::idl::WireReader reader(connection);
97  if (!reader.readListHeader(10)) {
98  return false;
99  }
100  return read(reader);
101 }
102 
103 // Write structure on a Wire
105 {
106  if (!write_ThreeAxisGyroscopes(writer)) {
107  return false;
108  }
109  if (!write_ThreeAxisLinearAccelerometers(writer)) {
110  return false;
111  }
112  if (!write_ThreeAxisMagnetometers(writer)) {
113  return false;
114  }
115  if (!write_OrientationSensors(writer)) {
116  return false;
117  }
118  if (!write_TemperatureSensors(writer)) {
119  return false;
120  }
121  if (!write_SixAxisForceTorqueSensors(writer)) {
122  return false;
123  }
124  if (!write_ContactLoadCellArrays(writer)) {
125  return false;
126  }
127  if (!write_EncoderArrays(writer)) {
128  return false;
129  }
130  if (!write_SkinPatches(writer)) {
131  return false;
132  }
133  if (!write_PositionSensors(writer)) {
134  return false;
135  }
136  return !writer.isError();
137 }
138 
139 // Write structure on a Connection
141 {
142  yarp::os::idl::WireWriter writer(connection);
143  if (!writer.writeListHeader(10)) {
144  return false;
145  }
146  return write(writer);
147 }
148 
149 // Convert to a printable string
150 std::string SensorRPCData::toString() const
151 {
153  b.read(*this);
154  return b.toString();
155 }
156 
157 // Editor: default constructor
159 {
160  group = 0;
161  obj_owned = true;
162  obj = new SensorRPCData;
163  dirty_flags(false);
164  yarp().setOwner(*this);
165 }
166 
167 // Editor: constructor with base class
169 {
170  group = 0;
171  obj_owned = false;
172  edit(obj, false);
173  yarp().setOwner(*this);
174 }
175 
176 // Editor: destructor
178 {
179  if (obj_owned) {
180  delete obj;
181  }
182 }
183 
184 // Editor: edit
186 {
187  if (obj_owned) {
188  delete this->obj;
189  }
190  this->obj = &obj;
191  obj_owned = false;
192  dirty_flags(dirty);
193  return true;
194 }
195 
196 // Editor: validity check
198 {
199  return obj != nullptr;
200 }
201 
202 // Editor: state
204 {
205  return *obj;
206 }
207 
208 // Editor: grouping begin
210 {
211  group++;
212 }
213 
214 // Editor: grouping end
216 {
217  group--;
218  if (group == 0 && is_dirty) {
219  communicate();
220  }
221 }
222 // Editor: ThreeAxisGyroscopes setter
224 {
225  will_set_ThreeAxisGyroscopes();
226  obj->ThreeAxisGyroscopes = ThreeAxisGyroscopes;
227  mark_dirty_ThreeAxisGyroscopes();
228  communicate();
229  did_set_ThreeAxisGyroscopes();
230 }
231 
232 // Editor: ThreeAxisGyroscopes setter (list)
234 {
235  will_set_ThreeAxisGyroscopes();
236  obj->ThreeAxisGyroscopes[index] = elem;
237  mark_dirty_ThreeAxisGyroscopes();
238  communicate();
239  did_set_ThreeAxisGyroscopes();
240 }
241 
242 // Editor: ThreeAxisGyroscopes getter
243 const std::vector<SensorMetadata>& SensorRPCData::Editor::get_ThreeAxisGyroscopes() const
244 {
245  return obj->ThreeAxisGyroscopes;
246 }
247 
248 // Editor: ThreeAxisGyroscopes will_set
250 {
251  return true;
252 }
253 
254 // Editor: ThreeAxisGyroscopes did_set
256 {
257  return true;
258 }
259 
260 // Editor: ThreeAxisLinearAccelerometers setter
262 {
263  will_set_ThreeAxisLinearAccelerometers();
264  obj->ThreeAxisLinearAccelerometers = ThreeAxisLinearAccelerometers;
265  mark_dirty_ThreeAxisLinearAccelerometers();
266  communicate();
267  did_set_ThreeAxisLinearAccelerometers();
268 }
269 
270 // Editor: ThreeAxisLinearAccelerometers setter (list)
272 {
273  will_set_ThreeAxisLinearAccelerometers();
274  obj->ThreeAxisLinearAccelerometers[index] = elem;
275  mark_dirty_ThreeAxisLinearAccelerometers();
276  communicate();
277  did_set_ThreeAxisLinearAccelerometers();
278 }
279 
280 // Editor: ThreeAxisLinearAccelerometers getter
281 const std::vector<SensorMetadata>& SensorRPCData::Editor::get_ThreeAxisLinearAccelerometers() const
282 {
283  return obj->ThreeAxisLinearAccelerometers;
284 }
285 
286 // Editor: ThreeAxisLinearAccelerometers will_set
288 {
289  return true;
290 }
291 
292 // Editor: ThreeAxisLinearAccelerometers did_set
294 {
295  return true;
296 }
297 
298 // Editor: ThreeAxisMagnetometers setter
300 {
301  will_set_ThreeAxisMagnetometers();
302  obj->ThreeAxisMagnetometers = ThreeAxisMagnetometers;
303  mark_dirty_ThreeAxisMagnetometers();
304  communicate();
305  did_set_ThreeAxisMagnetometers();
306 }
307 
308 // Editor: ThreeAxisMagnetometers setter (list)
310 {
311  will_set_ThreeAxisMagnetometers();
312  obj->ThreeAxisMagnetometers[index] = elem;
313  mark_dirty_ThreeAxisMagnetometers();
314  communicate();
315  did_set_ThreeAxisMagnetometers();
316 }
317 
318 // Editor: ThreeAxisMagnetometers getter
319 const std::vector<SensorMetadata>& SensorRPCData::Editor::get_ThreeAxisMagnetometers() const
320 {
321  return obj->ThreeAxisMagnetometers;
322 }
323 
324 // Editor: ThreeAxisMagnetometers will_set
326 {
327  return true;
328 }
329 
330 // Editor: ThreeAxisMagnetometers did_set
332 {
333  return true;
334 }
335 
336 // Editor: OrientationSensors setter
338 {
339  will_set_OrientationSensors();
340  obj->OrientationSensors = OrientationSensors;
341  mark_dirty_OrientationSensors();
342  communicate();
343  did_set_OrientationSensors();
344 }
345 
346 // Editor: OrientationSensors setter (list)
348 {
349  will_set_OrientationSensors();
350  obj->OrientationSensors[index] = elem;
351  mark_dirty_OrientationSensors();
352  communicate();
353  did_set_OrientationSensors();
354 }
355 
356 // Editor: OrientationSensors getter
357 const std::vector<SensorMetadata>& SensorRPCData::Editor::get_OrientationSensors() const
358 {
359  return obj->OrientationSensors;
360 }
361 
362 // Editor: OrientationSensors will_set
364 {
365  return true;
366 }
367 
368 // Editor: OrientationSensors did_set
370 {
371  return true;
372 }
373 
374 // Editor: TemperatureSensors setter
376 {
377  will_set_TemperatureSensors();
378  obj->TemperatureSensors = TemperatureSensors;
379  mark_dirty_TemperatureSensors();
380  communicate();
381  did_set_TemperatureSensors();
382 }
383 
384 // Editor: TemperatureSensors setter (list)
386 {
387  will_set_TemperatureSensors();
388  obj->TemperatureSensors[index] = elem;
389  mark_dirty_TemperatureSensors();
390  communicate();
391  did_set_TemperatureSensors();
392 }
393 
394 // Editor: TemperatureSensors getter
395 const std::vector<SensorMetadata>& SensorRPCData::Editor::get_TemperatureSensors() const
396 {
397  return obj->TemperatureSensors;
398 }
399 
400 // Editor: TemperatureSensors will_set
402 {
403  return true;
404 }
405 
406 // Editor: TemperatureSensors did_set
408 {
409  return true;
410 }
411 
412 // Editor: SixAxisForceTorqueSensors setter
414 {
415  will_set_SixAxisForceTorqueSensors();
416  obj->SixAxisForceTorqueSensors = SixAxisForceTorqueSensors;
417  mark_dirty_SixAxisForceTorqueSensors();
418  communicate();
419  did_set_SixAxisForceTorqueSensors();
420 }
421 
422 // Editor: SixAxisForceTorqueSensors setter (list)
424 {
425  will_set_SixAxisForceTorqueSensors();
426  obj->SixAxisForceTorqueSensors[index] = elem;
427  mark_dirty_SixAxisForceTorqueSensors();
428  communicate();
429  did_set_SixAxisForceTorqueSensors();
430 }
431 
432 // Editor: SixAxisForceTorqueSensors getter
433 const std::vector<SensorMetadata>& SensorRPCData::Editor::get_SixAxisForceTorqueSensors() const
434 {
435  return obj->SixAxisForceTorqueSensors;
436 }
437 
438 // Editor: SixAxisForceTorqueSensors will_set
440 {
441  return true;
442 }
443 
444 // Editor: SixAxisForceTorqueSensors did_set
446 {
447  return true;
448 }
449 
450 // Editor: ContactLoadCellArrays setter
452 {
453  will_set_ContactLoadCellArrays();
454  obj->ContactLoadCellArrays = ContactLoadCellArrays;
455  mark_dirty_ContactLoadCellArrays();
456  communicate();
457  did_set_ContactLoadCellArrays();
458 }
459 
460 // Editor: ContactLoadCellArrays setter (list)
462 {
463  will_set_ContactLoadCellArrays();
464  obj->ContactLoadCellArrays[index] = elem;
465  mark_dirty_ContactLoadCellArrays();
466  communicate();
467  did_set_ContactLoadCellArrays();
468 }
469 
470 // Editor: ContactLoadCellArrays getter
471 const std::vector<SensorMetadata>& SensorRPCData::Editor::get_ContactLoadCellArrays() const
472 {
473  return obj->ContactLoadCellArrays;
474 }
475 
476 // Editor: ContactLoadCellArrays will_set
478 {
479  return true;
480 }
481 
482 // Editor: ContactLoadCellArrays did_set
484 {
485  return true;
486 }
487 
488 // Editor: EncoderArrays setter
489 void SensorRPCData::Editor::set_EncoderArrays(const std::vector<SensorMetadata>& EncoderArrays)
490 {
491  will_set_EncoderArrays();
492  obj->EncoderArrays = EncoderArrays;
493  mark_dirty_EncoderArrays();
494  communicate();
495  did_set_EncoderArrays();
496 }
497 
498 // Editor: EncoderArrays setter (list)
500 {
501  will_set_EncoderArrays();
502  obj->EncoderArrays[index] = elem;
503  mark_dirty_EncoderArrays();
504  communicate();
505  did_set_EncoderArrays();
506 }
507 
508 // Editor: EncoderArrays getter
509 const std::vector<SensorMetadata>& SensorRPCData::Editor::get_EncoderArrays() const
510 {
511  return obj->EncoderArrays;
512 }
513 
514 // Editor: EncoderArrays will_set
516 {
517  return true;
518 }
519 
520 // Editor: EncoderArrays did_set
522 {
523  return true;
524 }
525 
526 // Editor: SkinPatches setter
527 void SensorRPCData::Editor::set_SkinPatches(const std::vector<SensorMetadata>& SkinPatches)
528 {
529  will_set_SkinPatches();
530  obj->SkinPatches = SkinPatches;
531  mark_dirty_SkinPatches();
532  communicate();
533  did_set_SkinPatches();
534 }
535 
536 // Editor: SkinPatches setter (list)
538 {
539  will_set_SkinPatches();
540  obj->SkinPatches[index] = elem;
541  mark_dirty_SkinPatches();
542  communicate();
543  did_set_SkinPatches();
544 }
545 
546 // Editor: SkinPatches getter
547 const std::vector<SensorMetadata>& SensorRPCData::Editor::get_SkinPatches() const
548 {
549  return obj->SkinPatches;
550 }
551 
552 // Editor: SkinPatches will_set
554 {
555  return true;
556 }
557 
558 // Editor: SkinPatches did_set
560 {
561  return true;
562 }
563 
564 // Editor: PositionSensors setter
565 void SensorRPCData::Editor::set_PositionSensors(const std::vector<SensorMetadata>& PositionSensors)
566 {
567  will_set_PositionSensors();
568  obj->PositionSensors = PositionSensors;
569  mark_dirty_PositionSensors();
570  communicate();
571  did_set_PositionSensors();
572 }
573 
574 // Editor: PositionSensors setter (list)
576 {
577  will_set_PositionSensors();
578  obj->PositionSensors[index] = elem;
579  mark_dirty_PositionSensors();
580  communicate();
581  did_set_PositionSensors();
582 }
583 
584 // Editor: PositionSensors getter
585 const std::vector<SensorMetadata>& SensorRPCData::Editor::get_PositionSensors() const
586 {
587  return obj->PositionSensors;
588 }
589 
590 // Editor: PositionSensors will_set
592 {
593  return true;
594 }
595 
596 // Editor: PositionSensors did_set
598 {
599  return true;
600 }
601 
602 // Editor: clean
604 {
605  dirty_flags(false);
606 }
607 
608 // Editor: read
610 {
611  if (!isValid()) {
612  return false;
613  }
614  yarp::os::idl::WireReader reader(connection);
615  reader.expectAccept();
616  if (!reader.readListHeader()) {
617  return false;
618  }
619  int len = reader.getLength();
620  if (len == 0) {
621  yarp::os::idl::WireWriter writer(reader);
622  if (writer.isNull()) {
623  return true;
624  }
625  if (!writer.writeListHeader(1)) {
626  return false;
627  }
628  writer.writeString("send: 'help' or 'patch (param1 val1) (param2 val2)'");
629  return true;
630  }
631  std::string tag;
632  if (!reader.readString(tag)) {
633  return false;
634  }
635  if (tag == "help") {
636  yarp::os::idl::WireWriter writer(reader);
637  if (writer.isNull()) {
638  return true;
639  }
640  if (!writer.writeListHeader(2)) {
641  return false;
642  }
643  if (!writer.writeTag("many", 1, 0)) {
644  return false;
645  }
646  if (reader.getLength() > 0) {
647  std::string field;
648  if (!reader.readString(field)) {
649  return false;
650  }
651  if (field == "ThreeAxisGyroscopes") {
652  if (!writer.writeListHeader(1)) {
653  return false;
654  }
655  if (!writer.writeString("std::vector<SensorMetadata> ThreeAxisGyroscopes")) {
656  return false;
657  }
658  }
659  if (field == "ThreeAxisLinearAccelerometers") {
660  if (!writer.writeListHeader(1)) {
661  return false;
662  }
663  if (!writer.writeString("std::vector<SensorMetadata> ThreeAxisLinearAccelerometers")) {
664  return false;
665  }
666  }
667  if (field == "ThreeAxisMagnetometers") {
668  if (!writer.writeListHeader(1)) {
669  return false;
670  }
671  if (!writer.writeString("std::vector<SensorMetadata> ThreeAxisMagnetometers")) {
672  return false;
673  }
674  }
675  if (field == "OrientationSensors") {
676  if (!writer.writeListHeader(1)) {
677  return false;
678  }
679  if (!writer.writeString("std::vector<SensorMetadata> OrientationSensors")) {
680  return false;
681  }
682  }
683  if (field == "TemperatureSensors") {
684  if (!writer.writeListHeader(1)) {
685  return false;
686  }
687  if (!writer.writeString("std::vector<SensorMetadata> TemperatureSensors")) {
688  return false;
689  }
690  }
691  if (field == "SixAxisForceTorqueSensors") {
692  if (!writer.writeListHeader(1)) {
693  return false;
694  }
695  if (!writer.writeString("std::vector<SensorMetadata> SixAxisForceTorqueSensors")) {
696  return false;
697  }
698  }
699  if (field == "ContactLoadCellArrays") {
700  if (!writer.writeListHeader(1)) {
701  return false;
702  }
703  if (!writer.writeString("std::vector<SensorMetadata> ContactLoadCellArrays")) {
704  return false;
705  }
706  }
707  if (field == "EncoderArrays") {
708  if (!writer.writeListHeader(1)) {
709  return false;
710  }
711  if (!writer.writeString("std::vector<SensorMetadata> EncoderArrays")) {
712  return false;
713  }
714  }
715  if (field == "SkinPatches") {
716  if (!writer.writeListHeader(1)) {
717  return false;
718  }
719  if (!writer.writeString("std::vector<SensorMetadata> SkinPatches")) {
720  return false;
721  }
722  }
723  if (field == "PositionSensors") {
724  if (!writer.writeListHeader(1)) {
725  return false;
726  }
727  if (!writer.writeString("std::vector<SensorMetadata> PositionSensors")) {
728  return false;
729  }
730  }
731  }
732  if (!writer.writeListHeader(11)) {
733  return false;
734  }
735  writer.writeString("*** Available fields:");
736  writer.writeString("ThreeAxisGyroscopes");
737  writer.writeString("ThreeAxisLinearAccelerometers");
738  writer.writeString("ThreeAxisMagnetometers");
739  writer.writeString("OrientationSensors");
740  writer.writeString("TemperatureSensors");
741  writer.writeString("SixAxisForceTorqueSensors");
742  writer.writeString("ContactLoadCellArrays");
743  writer.writeString("EncoderArrays");
744  writer.writeString("SkinPatches");
745  writer.writeString("PositionSensors");
746  return true;
747  }
748  bool nested = true;
749  bool have_act = false;
750  if (tag != "patch") {
751  if (((len - 1) % 2) != 0) {
752  return false;
753  }
754  len = 1 + ((len - 1) / 2);
755  nested = false;
756  have_act = true;
757  }
758  for (int i = 1; i < len; ++i) {
759  if (nested && !reader.readListHeader(3)) {
760  return false;
761  }
762  std::string act;
763  std::string key;
764  if (have_act) {
765  act = tag;
766  } else if (!reader.readString(act)) {
767  return false;
768  }
769  if (!reader.readString(key)) {
770  return false;
771  }
772  if (key == "ThreeAxisGyroscopes") {
773  will_set_ThreeAxisGyroscopes();
774  if (!obj->nested_read_ThreeAxisGyroscopes(reader)) {
775  return false;
776  }
777  did_set_ThreeAxisGyroscopes();
778  } else if (key == "ThreeAxisLinearAccelerometers") {
779  will_set_ThreeAxisLinearAccelerometers();
780  if (!obj->nested_read_ThreeAxisLinearAccelerometers(reader)) {
781  return false;
782  }
783  did_set_ThreeAxisLinearAccelerometers();
784  } else if (key == "ThreeAxisMagnetometers") {
785  will_set_ThreeAxisMagnetometers();
786  if (!obj->nested_read_ThreeAxisMagnetometers(reader)) {
787  return false;
788  }
789  did_set_ThreeAxisMagnetometers();
790  } else if (key == "OrientationSensors") {
791  will_set_OrientationSensors();
792  if (!obj->nested_read_OrientationSensors(reader)) {
793  return false;
794  }
795  did_set_OrientationSensors();
796  } else if (key == "TemperatureSensors") {
797  will_set_TemperatureSensors();
798  if (!obj->nested_read_TemperatureSensors(reader)) {
799  return false;
800  }
801  did_set_TemperatureSensors();
802  } else if (key == "SixAxisForceTorqueSensors") {
803  will_set_SixAxisForceTorqueSensors();
804  if (!obj->nested_read_SixAxisForceTorqueSensors(reader)) {
805  return false;
806  }
807  did_set_SixAxisForceTorqueSensors();
808  } else if (key == "ContactLoadCellArrays") {
809  will_set_ContactLoadCellArrays();
810  if (!obj->nested_read_ContactLoadCellArrays(reader)) {
811  return false;
812  }
813  did_set_ContactLoadCellArrays();
814  } else if (key == "EncoderArrays") {
815  will_set_EncoderArrays();
816  if (!obj->nested_read_EncoderArrays(reader)) {
817  return false;
818  }
819  did_set_EncoderArrays();
820  } else if (key == "SkinPatches") {
821  will_set_SkinPatches();
822  if (!obj->nested_read_SkinPatches(reader)) {
823  return false;
824  }
825  did_set_SkinPatches();
826  } else if (key == "PositionSensors") {
827  will_set_PositionSensors();
828  if (!obj->nested_read_PositionSensors(reader)) {
829  return false;
830  }
831  did_set_PositionSensors();
832  } else {
833  // would be useful to have a fallback here
834  }
835  }
836  reader.accept();
837  yarp::os::idl::WireWriter writer(reader);
838  if (writer.isNull()) {
839  return true;
840  }
841  writer.writeListHeader(1);
842  writer.writeVocab(yarp::os::createVocab('o', 'k'));
843  return true;
844 }
845 
846 // Editor: write
848 {
849  if (!isValid()) {
850  return false;
851  }
852  yarp::os::idl::WireWriter writer(connection);
853  if (!writer.writeListHeader(dirty_count + 1)) {
854  return false;
855  }
856  if (!writer.writeString("patch")) {
857  return false;
858  }
859  if (is_dirty_ThreeAxisGyroscopes) {
860  if (!writer.writeListHeader(3)) {
861  return false;
862  }
863  if (!writer.writeString("set")) {
864  return false;
865  }
866  if (!writer.writeString("ThreeAxisGyroscopes")) {
867  return false;
868  }
869  if (!obj->nested_write_ThreeAxisGyroscopes(writer)) {
870  return false;
871  }
872  }
873  if (is_dirty_ThreeAxisLinearAccelerometers) {
874  if (!writer.writeListHeader(3)) {
875  return false;
876  }
877  if (!writer.writeString("set")) {
878  return false;
879  }
880  if (!writer.writeString("ThreeAxisLinearAccelerometers")) {
881  return false;
882  }
883  if (!obj->nested_write_ThreeAxisLinearAccelerometers(writer)) {
884  return false;
885  }
886  }
887  if (is_dirty_ThreeAxisMagnetometers) {
888  if (!writer.writeListHeader(3)) {
889  return false;
890  }
891  if (!writer.writeString("set")) {
892  return false;
893  }
894  if (!writer.writeString("ThreeAxisMagnetometers")) {
895  return false;
896  }
897  if (!obj->nested_write_ThreeAxisMagnetometers(writer)) {
898  return false;
899  }
900  }
901  if (is_dirty_OrientationSensors) {
902  if (!writer.writeListHeader(3)) {
903  return false;
904  }
905  if (!writer.writeString("set")) {
906  return false;
907  }
908  if (!writer.writeString("OrientationSensors")) {
909  return false;
910  }
911  if (!obj->nested_write_OrientationSensors(writer)) {
912  return false;
913  }
914  }
915  if (is_dirty_TemperatureSensors) {
916  if (!writer.writeListHeader(3)) {
917  return false;
918  }
919  if (!writer.writeString("set")) {
920  return false;
921  }
922  if (!writer.writeString("TemperatureSensors")) {
923  return false;
924  }
925  if (!obj->nested_write_TemperatureSensors(writer)) {
926  return false;
927  }
928  }
929  if (is_dirty_SixAxisForceTorqueSensors) {
930  if (!writer.writeListHeader(3)) {
931  return false;
932  }
933  if (!writer.writeString("set")) {
934  return false;
935  }
936  if (!writer.writeString("SixAxisForceTorqueSensors")) {
937  return false;
938  }
939  if (!obj->nested_write_SixAxisForceTorqueSensors(writer)) {
940  return false;
941  }
942  }
943  if (is_dirty_ContactLoadCellArrays) {
944  if (!writer.writeListHeader(3)) {
945  return false;
946  }
947  if (!writer.writeString("set")) {
948  return false;
949  }
950  if (!writer.writeString("ContactLoadCellArrays")) {
951  return false;
952  }
953  if (!obj->nested_write_ContactLoadCellArrays(writer)) {
954  return false;
955  }
956  }
957  if (is_dirty_EncoderArrays) {
958  if (!writer.writeListHeader(3)) {
959  return false;
960  }
961  if (!writer.writeString("set")) {
962  return false;
963  }
964  if (!writer.writeString("EncoderArrays")) {
965  return false;
966  }
967  if (!obj->nested_write_EncoderArrays(writer)) {
968  return false;
969  }
970  }
971  if (is_dirty_SkinPatches) {
972  if (!writer.writeListHeader(3)) {
973  return false;
974  }
975  if (!writer.writeString("set")) {
976  return false;
977  }
978  if (!writer.writeString("SkinPatches")) {
979  return false;
980  }
981  if (!obj->nested_write_SkinPatches(writer)) {
982  return false;
983  }
984  }
985  if (is_dirty_PositionSensors) {
986  if (!writer.writeListHeader(3)) {
987  return false;
988  }
989  if (!writer.writeString("set")) {
990  return false;
991  }
992  if (!writer.writeString("PositionSensors")) {
993  return false;
994  }
995  if (!obj->nested_write_PositionSensors(writer)) {
996  return false;
997  }
998  }
999  return !writer.isError();
1000 }
1001 
1002 // Editor: send if possible
1003 void SensorRPCData::Editor::communicate()
1004 {
1005  if (group != 0) {
1006  return;
1007  }
1008  if (yarp().canWrite()) {
1009  yarp().write(*this);
1010  clean();
1011  }
1012 }
1013 
1014 // Editor: mark dirty overall
1015 void SensorRPCData::Editor::mark_dirty()
1016 {
1017  is_dirty = true;
1018 }
1019 
1020 // Editor: ThreeAxisGyroscopes mark_dirty
1021 void SensorRPCData::Editor::mark_dirty_ThreeAxisGyroscopes()
1022 {
1023  if (is_dirty_ThreeAxisGyroscopes) {
1024  return;
1025  }
1026  dirty_count++;
1027  is_dirty_ThreeAxisGyroscopes = true;
1028  mark_dirty();
1029 }
1030 
1031 // Editor: ThreeAxisLinearAccelerometers mark_dirty
1032 void SensorRPCData::Editor::mark_dirty_ThreeAxisLinearAccelerometers()
1033 {
1034  if (is_dirty_ThreeAxisLinearAccelerometers) {
1035  return;
1036  }
1037  dirty_count++;
1038  is_dirty_ThreeAxisLinearAccelerometers = true;
1039  mark_dirty();
1040 }
1041 
1042 // Editor: ThreeAxisMagnetometers mark_dirty
1043 void SensorRPCData::Editor::mark_dirty_ThreeAxisMagnetometers()
1044 {
1045  if (is_dirty_ThreeAxisMagnetometers) {
1046  return;
1047  }
1048  dirty_count++;
1049  is_dirty_ThreeAxisMagnetometers = true;
1050  mark_dirty();
1051 }
1052 
1053 // Editor: OrientationSensors mark_dirty
1054 void SensorRPCData::Editor::mark_dirty_OrientationSensors()
1055 {
1056  if (is_dirty_OrientationSensors) {
1057  return;
1058  }
1059  dirty_count++;
1060  is_dirty_OrientationSensors = true;
1061  mark_dirty();
1062 }
1063 
1064 // Editor: TemperatureSensors mark_dirty
1065 void SensorRPCData::Editor::mark_dirty_TemperatureSensors()
1066 {
1067  if (is_dirty_TemperatureSensors) {
1068  return;
1069  }
1070  dirty_count++;
1071  is_dirty_TemperatureSensors = true;
1072  mark_dirty();
1073 }
1074 
1075 // Editor: SixAxisForceTorqueSensors mark_dirty
1076 void SensorRPCData::Editor::mark_dirty_SixAxisForceTorqueSensors()
1077 {
1078  if (is_dirty_SixAxisForceTorqueSensors) {
1079  return;
1080  }
1081  dirty_count++;
1082  is_dirty_SixAxisForceTorqueSensors = true;
1083  mark_dirty();
1084 }
1085 
1086 // Editor: ContactLoadCellArrays mark_dirty
1087 void SensorRPCData::Editor::mark_dirty_ContactLoadCellArrays()
1088 {
1089  if (is_dirty_ContactLoadCellArrays) {
1090  return;
1091  }
1092  dirty_count++;
1093  is_dirty_ContactLoadCellArrays = true;
1094  mark_dirty();
1095 }
1096 
1097 // Editor: EncoderArrays mark_dirty
1098 void SensorRPCData::Editor::mark_dirty_EncoderArrays()
1099 {
1100  if (is_dirty_EncoderArrays) {
1101  return;
1102  }
1103  dirty_count++;
1104  is_dirty_EncoderArrays = true;
1105  mark_dirty();
1106 }
1107 
1108 // Editor: SkinPatches mark_dirty
1109 void SensorRPCData::Editor::mark_dirty_SkinPatches()
1110 {
1111  if (is_dirty_SkinPatches) {
1112  return;
1113  }
1114  dirty_count++;
1115  is_dirty_SkinPatches = true;
1116  mark_dirty();
1117 }
1118 
1119 // Editor: PositionSensors mark_dirty
1120 void SensorRPCData::Editor::mark_dirty_PositionSensors()
1121 {
1122  if (is_dirty_PositionSensors) {
1123  return;
1124  }
1125  dirty_count++;
1126  is_dirty_PositionSensors = true;
1127  mark_dirty();
1128 }
1129 
1130 // Editor: dirty_flags
1131 void SensorRPCData::Editor::dirty_flags(bool flag)
1132 {
1133  is_dirty = flag;
1134  is_dirty_ThreeAxisGyroscopes = flag;
1135  is_dirty_ThreeAxisLinearAccelerometers = flag;
1136  is_dirty_ThreeAxisMagnetometers = flag;
1137  is_dirty_OrientationSensors = flag;
1138  is_dirty_TemperatureSensors = flag;
1139  is_dirty_SixAxisForceTorqueSensors = flag;
1140  is_dirty_ContactLoadCellArrays = flag;
1141  is_dirty_EncoderArrays = flag;
1142  is_dirty_SkinPatches = flag;
1143  is_dirty_PositionSensors = flag;
1144  dirty_count = flag ? 10 : 0;
1145 }
1146 
1147 // read ThreeAxisGyroscopes field
1148 bool SensorRPCData::read_ThreeAxisGyroscopes(yarp::os::idl::WireReader& reader)
1149 {
1150  ThreeAxisGyroscopes.clear();
1151  uint32_t _size12;
1152  yarp::os::idl::WireState _etype15;
1153  reader.readListBegin(_etype15, _size12);
1154  ThreeAxisGyroscopes.resize(_size12);
1155  for (size_t _i16 = 0; _i16 < _size12; ++_i16) {
1156  if (!reader.readNested(ThreeAxisGyroscopes[_i16])) {
1157  reader.fail();
1158  return false;
1159  }
1160  }
1161  reader.readListEnd();
1162  return true;
1163 }
1164 
1165 // write ThreeAxisGyroscopes field
1166 bool SensorRPCData::write_ThreeAxisGyroscopes(const yarp::os::idl::WireWriter& writer) const
1167 {
1168  if (!writer.writeListBegin(BOTTLE_TAG_LIST, static_cast<uint32_t>(ThreeAxisGyroscopes.size()))) {
1169  return false;
1170  }
1171  for (const auto& _item17 : ThreeAxisGyroscopes) {
1172  if (!writer.writeNested(_item17)) {
1173  return false;
1174  }
1175  }
1176  if (!writer.writeListEnd()) {
1177  return false;
1178  }
1179  return true;
1180 }
1181 
1182 // read (nested) ThreeAxisGyroscopes field
1183 bool SensorRPCData::nested_read_ThreeAxisGyroscopes(yarp::os::idl::WireReader& reader)
1184 {
1185  ThreeAxisGyroscopes.clear();
1186  uint32_t _size18;
1187  yarp::os::idl::WireState _etype21;
1188  reader.readListBegin(_etype21, _size18);
1189  ThreeAxisGyroscopes.resize(_size18);
1190  for (size_t _i22 = 0; _i22 < _size18; ++_i22) {
1191  if (!reader.readNested(ThreeAxisGyroscopes[_i22])) {
1192  reader.fail();
1193  return false;
1194  }
1195  }
1196  reader.readListEnd();
1197  return true;
1198 }
1199 
1200 // write (nested) ThreeAxisGyroscopes field
1201 bool SensorRPCData::nested_write_ThreeAxisGyroscopes(const yarp::os::idl::WireWriter& writer) const
1202 {
1203  if (!writer.writeListBegin(BOTTLE_TAG_LIST, static_cast<uint32_t>(ThreeAxisGyroscopes.size()))) {
1204  return false;
1205  }
1206  for (const auto& _item23 : ThreeAxisGyroscopes) {
1207  if (!writer.writeNested(_item23)) {
1208  return false;
1209  }
1210  }
1211  if (!writer.writeListEnd()) {
1212  return false;
1213  }
1214  return true;
1215 }
1216 
1217 // read ThreeAxisLinearAccelerometers field
1218 bool SensorRPCData::read_ThreeAxisLinearAccelerometers(yarp::os::idl::WireReader& reader)
1219 {
1221  uint32_t _size24;
1222  yarp::os::idl::WireState _etype27;
1223  reader.readListBegin(_etype27, _size24);
1224  ThreeAxisLinearAccelerometers.resize(_size24);
1225  for (size_t _i28 = 0; _i28 < _size24; ++_i28) {
1226  if (!reader.readNested(ThreeAxisLinearAccelerometers[_i28])) {
1227  reader.fail();
1228  return false;
1229  }
1230  }
1231  reader.readListEnd();
1232  return true;
1233 }
1234 
1235 // write ThreeAxisLinearAccelerometers field
1236 bool SensorRPCData::write_ThreeAxisLinearAccelerometers(const yarp::os::idl::WireWriter& writer) const
1237 {
1238  if (!writer.writeListBegin(BOTTLE_TAG_LIST, static_cast<uint32_t>(ThreeAxisLinearAccelerometers.size()))) {
1239  return false;
1240  }
1241  for (const auto& _item29 : ThreeAxisLinearAccelerometers) {
1242  if (!writer.writeNested(_item29)) {
1243  return false;
1244  }
1245  }
1246  if (!writer.writeListEnd()) {
1247  return false;
1248  }
1249  return true;
1250 }
1251 
1252 // read (nested) ThreeAxisLinearAccelerometers field
1253 bool SensorRPCData::nested_read_ThreeAxisLinearAccelerometers(yarp::os::idl::WireReader& reader)
1254 {
1256  uint32_t _size30;
1257  yarp::os::idl::WireState _etype33;
1258  reader.readListBegin(_etype33, _size30);
1259  ThreeAxisLinearAccelerometers.resize(_size30);
1260  for (size_t _i34 = 0; _i34 < _size30; ++_i34) {
1261  if (!reader.readNested(ThreeAxisLinearAccelerometers[_i34])) {
1262  reader.fail();
1263  return false;
1264  }
1265  }
1266  reader.readListEnd();
1267  return true;
1268 }
1269 
1270 // write (nested) ThreeAxisLinearAccelerometers field
1271 bool SensorRPCData::nested_write_ThreeAxisLinearAccelerometers(const yarp::os::idl::WireWriter& writer) const
1272 {
1273  if (!writer.writeListBegin(BOTTLE_TAG_LIST, static_cast<uint32_t>(ThreeAxisLinearAccelerometers.size()))) {
1274  return false;
1275  }
1276  for (const auto& _item35 : ThreeAxisLinearAccelerometers) {
1277  if (!writer.writeNested(_item35)) {
1278  return false;
1279  }
1280  }
1281  if (!writer.writeListEnd()) {
1282  return false;
1283  }
1284  return true;
1285 }
1286 
1287 // read ThreeAxisMagnetometers field
1288 bool SensorRPCData::read_ThreeAxisMagnetometers(yarp::os::idl::WireReader& reader)
1289 {
1290  ThreeAxisMagnetometers.clear();
1291  uint32_t _size36;
1292  yarp::os::idl::WireState _etype39;
1293  reader.readListBegin(_etype39, _size36);
1294  ThreeAxisMagnetometers.resize(_size36);
1295  for (size_t _i40 = 0; _i40 < _size36; ++_i40) {
1296  if (!reader.readNested(ThreeAxisMagnetometers[_i40])) {
1297  reader.fail();
1298  return false;
1299  }
1300  }
1301  reader.readListEnd();
1302  return true;
1303 }
1304 
1305 // write ThreeAxisMagnetometers field
1306 bool SensorRPCData::write_ThreeAxisMagnetometers(const yarp::os::idl::WireWriter& writer) const
1307 {
1308  if (!writer.writeListBegin(BOTTLE_TAG_LIST, static_cast<uint32_t>(ThreeAxisMagnetometers.size()))) {
1309  return false;
1310  }
1311  for (const auto& _item41 : ThreeAxisMagnetometers) {
1312  if (!writer.writeNested(_item41)) {
1313  return false;
1314  }
1315  }
1316  if (!writer.writeListEnd()) {
1317  return false;
1318  }
1319  return true;
1320 }
1321 
1322 // read (nested) ThreeAxisMagnetometers field
1323 bool SensorRPCData::nested_read_ThreeAxisMagnetometers(yarp::os::idl::WireReader& reader)
1324 {
1325  ThreeAxisMagnetometers.clear();
1326  uint32_t _size42;
1327  yarp::os::idl::WireState _etype45;
1328  reader.readListBegin(_etype45, _size42);
1329  ThreeAxisMagnetometers.resize(_size42);
1330  for (size_t _i46 = 0; _i46 < _size42; ++_i46) {
1331  if (!reader.readNested(ThreeAxisMagnetometers[_i46])) {
1332  reader.fail();
1333  return false;
1334  }
1335  }
1336  reader.readListEnd();
1337  return true;
1338 }
1339 
1340 // write (nested) ThreeAxisMagnetometers field
1341 bool SensorRPCData::nested_write_ThreeAxisMagnetometers(const yarp::os::idl::WireWriter& writer) const
1342 {
1343  if (!writer.writeListBegin(BOTTLE_TAG_LIST, static_cast<uint32_t>(ThreeAxisMagnetometers.size()))) {
1344  return false;
1345  }
1346  for (const auto& _item47 : ThreeAxisMagnetometers) {
1347  if (!writer.writeNested(_item47)) {
1348  return false;
1349  }
1350  }
1351  if (!writer.writeListEnd()) {
1352  return false;
1353  }
1354  return true;
1355 }
1356 
1357 // read OrientationSensors field
1358 bool SensorRPCData::read_OrientationSensors(yarp::os::idl::WireReader& reader)
1359 {
1360  OrientationSensors.clear();
1361  uint32_t _size48;
1362  yarp::os::idl::WireState _etype51;
1363  reader.readListBegin(_etype51, _size48);
1364  OrientationSensors.resize(_size48);
1365  for (size_t _i52 = 0; _i52 < _size48; ++_i52) {
1366  if (!reader.readNested(OrientationSensors[_i52])) {
1367  reader.fail();
1368  return false;
1369  }
1370  }
1371  reader.readListEnd();
1372  return true;
1373 }
1374 
1375 // write OrientationSensors field
1376 bool SensorRPCData::write_OrientationSensors(const yarp::os::idl::WireWriter& writer) const
1377 {
1378  if (!writer.writeListBegin(BOTTLE_TAG_LIST, static_cast<uint32_t>(OrientationSensors.size()))) {
1379  return false;
1380  }
1381  for (const auto& _item53 : OrientationSensors) {
1382  if (!writer.writeNested(_item53)) {
1383  return false;
1384  }
1385  }
1386  if (!writer.writeListEnd()) {
1387  return false;
1388  }
1389  return true;
1390 }
1391 
1392 // read (nested) OrientationSensors field
1393 bool SensorRPCData::nested_read_OrientationSensors(yarp::os::idl::WireReader& reader)
1394 {
1395  OrientationSensors.clear();
1396  uint32_t _size54;
1397  yarp::os::idl::WireState _etype57;
1398  reader.readListBegin(_etype57, _size54);
1399  OrientationSensors.resize(_size54);
1400  for (size_t _i58 = 0; _i58 < _size54; ++_i58) {
1401  if (!reader.readNested(OrientationSensors[_i58])) {
1402  reader.fail();
1403  return false;
1404  }
1405  }
1406  reader.readListEnd();
1407  return true;
1408 }
1409 
1410 // write (nested) OrientationSensors field
1411 bool SensorRPCData::nested_write_OrientationSensors(const yarp::os::idl::WireWriter& writer) const
1412 {
1413  if (!writer.writeListBegin(BOTTLE_TAG_LIST, static_cast<uint32_t>(OrientationSensors.size()))) {
1414  return false;
1415  }
1416  for (const auto& _item59 : OrientationSensors) {
1417  if (!writer.writeNested(_item59)) {
1418  return false;
1419  }
1420  }
1421  if (!writer.writeListEnd()) {
1422  return false;
1423  }
1424  return true;
1425 }
1426 
1427 // read TemperatureSensors field
1428 bool SensorRPCData::read_TemperatureSensors(yarp::os::idl::WireReader& reader)
1429 {
1430  TemperatureSensors.clear();
1431  uint32_t _size60;
1432  yarp::os::idl::WireState _etype63;
1433  reader.readListBegin(_etype63, _size60);
1434  TemperatureSensors.resize(_size60);
1435  for (size_t _i64 = 0; _i64 < _size60; ++_i64) {
1436  if (!reader.readNested(TemperatureSensors[_i64])) {
1437  reader.fail();
1438  return false;
1439  }
1440  }
1441  reader.readListEnd();
1442  return true;
1443 }
1444 
1445 // write TemperatureSensors field
1446 bool SensorRPCData::write_TemperatureSensors(const yarp::os::idl::WireWriter& writer) const
1447 {
1448  if (!writer.writeListBegin(BOTTLE_TAG_LIST, static_cast<uint32_t>(TemperatureSensors.size()))) {
1449  return false;
1450  }
1451  for (const auto& _item65 : TemperatureSensors) {
1452  if (!writer.writeNested(_item65)) {
1453  return false;
1454  }
1455  }
1456  if (!writer.writeListEnd()) {
1457  return false;
1458  }
1459  return true;
1460 }
1461 
1462 // read (nested) TemperatureSensors field
1463 bool SensorRPCData::nested_read_TemperatureSensors(yarp::os::idl::WireReader& reader)
1464 {
1465  TemperatureSensors.clear();
1466  uint32_t _size66;
1467  yarp::os::idl::WireState _etype69;
1468  reader.readListBegin(_etype69, _size66);
1469  TemperatureSensors.resize(_size66);
1470  for (size_t _i70 = 0; _i70 < _size66; ++_i70) {
1471  if (!reader.readNested(TemperatureSensors[_i70])) {
1472  reader.fail();
1473  return false;
1474  }
1475  }
1476  reader.readListEnd();
1477  return true;
1478 }
1479 
1480 // write (nested) TemperatureSensors field
1481 bool SensorRPCData::nested_write_TemperatureSensors(const yarp::os::idl::WireWriter& writer) const
1482 {
1483  if (!writer.writeListBegin(BOTTLE_TAG_LIST, static_cast<uint32_t>(TemperatureSensors.size()))) {
1484  return false;
1485  }
1486  for (const auto& _item71 : TemperatureSensors) {
1487  if (!writer.writeNested(_item71)) {
1488  return false;
1489  }
1490  }
1491  if (!writer.writeListEnd()) {
1492  return false;
1493  }
1494  return true;
1495 }
1496 
1497 // read SixAxisForceTorqueSensors field
1498 bool SensorRPCData::read_SixAxisForceTorqueSensors(yarp::os::idl::WireReader& reader)
1499 {
1500  SixAxisForceTorqueSensors.clear();
1501  uint32_t _size72;
1502  yarp::os::idl::WireState _etype75;
1503  reader.readListBegin(_etype75, _size72);
1504  SixAxisForceTorqueSensors.resize(_size72);
1505  for (size_t _i76 = 0; _i76 < _size72; ++_i76) {
1506  if (!reader.readNested(SixAxisForceTorqueSensors[_i76])) {
1507  reader.fail();
1508  return false;
1509  }
1510  }
1511  reader.readListEnd();
1512  return true;
1513 }
1514 
1515 // write SixAxisForceTorqueSensors field
1516 bool SensorRPCData::write_SixAxisForceTorqueSensors(const yarp::os::idl::WireWriter& writer) const
1517 {
1518  if (!writer.writeListBegin(BOTTLE_TAG_LIST, static_cast<uint32_t>(SixAxisForceTorqueSensors.size()))) {
1519  return false;
1520  }
1521  for (const auto& _item77 : SixAxisForceTorqueSensors) {
1522  if (!writer.writeNested(_item77)) {
1523  return false;
1524  }
1525  }
1526  if (!writer.writeListEnd()) {
1527  return false;
1528  }
1529  return true;
1530 }
1531 
1532 // read (nested) SixAxisForceTorqueSensors field
1533 bool SensorRPCData::nested_read_SixAxisForceTorqueSensors(yarp::os::idl::WireReader& reader)
1534 {
1535  SixAxisForceTorqueSensors.clear();
1536  uint32_t _size78;
1537  yarp::os::idl::WireState _etype81;
1538  reader.readListBegin(_etype81, _size78);
1539  SixAxisForceTorqueSensors.resize(_size78);
1540  for (size_t _i82 = 0; _i82 < _size78; ++_i82) {
1541  if (!reader.readNested(SixAxisForceTorqueSensors[_i82])) {
1542  reader.fail();
1543  return false;
1544  }
1545  }
1546  reader.readListEnd();
1547  return true;
1548 }
1549 
1550 // write (nested) SixAxisForceTorqueSensors field
1551 bool SensorRPCData::nested_write_SixAxisForceTorqueSensors(const yarp::os::idl::WireWriter& writer) const
1552 {
1553  if (!writer.writeListBegin(BOTTLE_TAG_LIST, static_cast<uint32_t>(SixAxisForceTorqueSensors.size()))) {
1554  return false;
1555  }
1556  for (const auto& _item83 : SixAxisForceTorqueSensors) {
1557  if (!writer.writeNested(_item83)) {
1558  return false;
1559  }
1560  }
1561  if (!writer.writeListEnd()) {
1562  return false;
1563  }
1564  return true;
1565 }
1566 
1567 // read ContactLoadCellArrays field
1568 bool SensorRPCData::read_ContactLoadCellArrays(yarp::os::idl::WireReader& reader)
1569 {
1570  ContactLoadCellArrays.clear();
1571  uint32_t _size84;
1572  yarp::os::idl::WireState _etype87;
1573  reader.readListBegin(_etype87, _size84);
1574  ContactLoadCellArrays.resize(_size84);
1575  for (size_t _i88 = 0; _i88 < _size84; ++_i88) {
1576  if (!reader.readNested(ContactLoadCellArrays[_i88])) {
1577  reader.fail();
1578  return false;
1579  }
1580  }
1581  reader.readListEnd();
1582  return true;
1583 }
1584 
1585 // write ContactLoadCellArrays field
1586 bool SensorRPCData::write_ContactLoadCellArrays(const yarp::os::idl::WireWriter& writer) const
1587 {
1588  if (!writer.writeListBegin(BOTTLE_TAG_LIST, static_cast<uint32_t>(ContactLoadCellArrays.size()))) {
1589  return false;
1590  }
1591  for (const auto& _item89 : ContactLoadCellArrays) {
1592  if (!writer.writeNested(_item89)) {
1593  return false;
1594  }
1595  }
1596  if (!writer.writeListEnd()) {
1597  return false;
1598  }
1599  return true;
1600 }
1601 
1602 // read (nested) ContactLoadCellArrays field
1603 bool SensorRPCData::nested_read_ContactLoadCellArrays(yarp::os::idl::WireReader& reader)
1604 {
1605  ContactLoadCellArrays.clear();
1606  uint32_t _size90;
1607  yarp::os::idl::WireState _etype93;
1608  reader.readListBegin(_etype93, _size90);
1609  ContactLoadCellArrays.resize(_size90);
1610  for (size_t _i94 = 0; _i94 < _size90; ++_i94) {
1611  if (!reader.readNested(ContactLoadCellArrays[_i94])) {
1612  reader.fail();
1613  return false;
1614  }
1615  }
1616  reader.readListEnd();
1617  return true;
1618 }
1619 
1620 // write (nested) ContactLoadCellArrays field
1621 bool SensorRPCData::nested_write_ContactLoadCellArrays(const yarp::os::idl::WireWriter& writer) const
1622 {
1623  if (!writer.writeListBegin(BOTTLE_TAG_LIST, static_cast<uint32_t>(ContactLoadCellArrays.size()))) {
1624  return false;
1625  }
1626  for (const auto& _item95 : ContactLoadCellArrays) {
1627  if (!writer.writeNested(_item95)) {
1628  return false;
1629  }
1630  }
1631  if (!writer.writeListEnd()) {
1632  return false;
1633  }
1634  return true;
1635 }
1636 
1637 // read EncoderArrays field
1638 bool SensorRPCData::read_EncoderArrays(yarp::os::idl::WireReader& reader)
1639 {
1640  EncoderArrays.clear();
1641  uint32_t _size96;
1642  yarp::os::idl::WireState _etype99;
1643  reader.readListBegin(_etype99, _size96);
1644  EncoderArrays.resize(_size96);
1645  for (size_t _i100 = 0; _i100 < _size96; ++_i100) {
1646  if (!reader.readNested(EncoderArrays[_i100])) {
1647  reader.fail();
1648  return false;
1649  }
1650  }
1651  reader.readListEnd();
1652  return true;
1653 }
1654 
1655 // write EncoderArrays field
1656 bool SensorRPCData::write_EncoderArrays(const yarp::os::idl::WireWriter& writer) const
1657 {
1658  if (!writer.writeListBegin(BOTTLE_TAG_LIST, static_cast<uint32_t>(EncoderArrays.size()))) {
1659  return false;
1660  }
1661  for (const auto& _item101 : EncoderArrays) {
1662  if (!writer.writeNested(_item101)) {
1663  return false;
1664  }
1665  }
1666  if (!writer.writeListEnd()) {
1667  return false;
1668  }
1669  return true;
1670 }
1671 
1672 // read (nested) EncoderArrays field
1673 bool SensorRPCData::nested_read_EncoderArrays(yarp::os::idl::WireReader& reader)
1674 {
1675  EncoderArrays.clear();
1676  uint32_t _size102;
1677  yarp::os::idl::WireState _etype105;
1678  reader.readListBegin(_etype105, _size102);
1679  EncoderArrays.resize(_size102);
1680  for (size_t _i106 = 0; _i106 < _size102; ++_i106) {
1681  if (!reader.readNested(EncoderArrays[_i106])) {
1682  reader.fail();
1683  return false;
1684  }
1685  }
1686  reader.readListEnd();
1687  return true;
1688 }
1689 
1690 // write (nested) EncoderArrays field
1691 bool SensorRPCData::nested_write_EncoderArrays(const yarp::os::idl::WireWriter& writer) const
1692 {
1693  if (!writer.writeListBegin(BOTTLE_TAG_LIST, static_cast<uint32_t>(EncoderArrays.size()))) {
1694  return false;
1695  }
1696  for (const auto& _item107 : EncoderArrays) {
1697  if (!writer.writeNested(_item107)) {
1698  return false;
1699  }
1700  }
1701  if (!writer.writeListEnd()) {
1702  return false;
1703  }
1704  return true;
1705 }
1706 
1707 // read SkinPatches field
1708 bool SensorRPCData::read_SkinPatches(yarp::os::idl::WireReader& reader)
1709 {
1710  SkinPatches.clear();
1711  uint32_t _size108;
1712  yarp::os::idl::WireState _etype111;
1713  reader.readListBegin(_etype111, _size108);
1714  SkinPatches.resize(_size108);
1715  for (size_t _i112 = 0; _i112 < _size108; ++_i112) {
1716  if (!reader.readNested(SkinPatches[_i112])) {
1717  reader.fail();
1718  return false;
1719  }
1720  }
1721  reader.readListEnd();
1722  return true;
1723 }
1724 
1725 // write SkinPatches field
1726 bool SensorRPCData::write_SkinPatches(const yarp::os::idl::WireWriter& writer) const
1727 {
1728  if (!writer.writeListBegin(BOTTLE_TAG_LIST, static_cast<uint32_t>(SkinPatches.size()))) {
1729  return false;
1730  }
1731  for (const auto& _item113 : SkinPatches) {
1732  if (!writer.writeNested(_item113)) {
1733  return false;
1734  }
1735  }
1736  if (!writer.writeListEnd()) {
1737  return false;
1738  }
1739  return true;
1740 }
1741 
1742 // read (nested) SkinPatches field
1743 bool SensorRPCData::nested_read_SkinPatches(yarp::os::idl::WireReader& reader)
1744 {
1745  SkinPatches.clear();
1746  uint32_t _size114;
1747  yarp::os::idl::WireState _etype117;
1748  reader.readListBegin(_etype117, _size114);
1749  SkinPatches.resize(_size114);
1750  for (size_t _i118 = 0; _i118 < _size114; ++_i118) {
1751  if (!reader.readNested(SkinPatches[_i118])) {
1752  reader.fail();
1753  return false;
1754  }
1755  }
1756  reader.readListEnd();
1757  return true;
1758 }
1759 
1760 // write (nested) SkinPatches field
1761 bool SensorRPCData::nested_write_SkinPatches(const yarp::os::idl::WireWriter& writer) const
1762 {
1763  if (!writer.writeListBegin(BOTTLE_TAG_LIST, static_cast<uint32_t>(SkinPatches.size()))) {
1764  return false;
1765  }
1766  for (const auto& _item119 : SkinPatches) {
1767  if (!writer.writeNested(_item119)) {
1768  return false;
1769  }
1770  }
1771  if (!writer.writeListEnd()) {
1772  return false;
1773  }
1774  return true;
1775 }
1776 
1777 // read PositionSensors field
1778 bool SensorRPCData::read_PositionSensors(yarp::os::idl::WireReader& reader)
1779 {
1780  PositionSensors.clear();
1781  uint32_t _size120;
1782  yarp::os::idl::WireState _etype123;
1783  reader.readListBegin(_etype123, _size120);
1784  PositionSensors.resize(_size120);
1785  for (size_t _i124 = 0; _i124 < _size120; ++_i124) {
1786  if (!reader.readNested(PositionSensors[_i124])) {
1787  reader.fail();
1788  return false;
1789  }
1790  }
1791  reader.readListEnd();
1792  return true;
1793 }
1794 
1795 // write PositionSensors field
1796 bool SensorRPCData::write_PositionSensors(const yarp::os::idl::WireWriter& writer) const
1797 {
1798  if (!writer.writeListBegin(BOTTLE_TAG_LIST, static_cast<uint32_t>(PositionSensors.size()))) {
1799  return false;
1800  }
1801  for (const auto& _item125 : PositionSensors) {
1802  if (!writer.writeNested(_item125)) {
1803  return false;
1804  }
1805  }
1806  if (!writer.writeListEnd()) {
1807  return false;
1808  }
1809  return true;
1810 }
1811 
1812 // read (nested) PositionSensors field
1813 bool SensorRPCData::nested_read_PositionSensors(yarp::os::idl::WireReader& reader)
1814 {
1815  PositionSensors.clear();
1816  uint32_t _size126;
1817  yarp::os::idl::WireState _etype129;
1818  reader.readListBegin(_etype129, _size126);
1819  PositionSensors.resize(_size126);
1820  for (size_t _i130 = 0; _i130 < _size126; ++_i130) {
1821  if (!reader.readNested(PositionSensors[_i130])) {
1822  reader.fail();
1823  return false;
1824  }
1825  }
1826  reader.readListEnd();
1827  return true;
1828 }
1829 
1830 // write (nested) PositionSensors field
1831 bool SensorRPCData::nested_write_PositionSensors(const yarp::os::idl::WireWriter& writer) const
1832 {
1833  if (!writer.writeListBegin(BOTTLE_TAG_LIST, static_cast<uint32_t>(PositionSensors.size()))) {
1834  return false;
1835  }
1836  for (const auto& _item131 : PositionSensors) {
1837  if (!writer.writeNested(_item131)) {
1838  return false;
1839  }
1840  }
1841  if (!writer.writeListEnd()) {
1842  return false;
1843  }
1844  return true;
1845 }
SensorRPCData::TemperatureSensors
std::vector< SensorMetadata > TemperatureSensors
Definition: SensorRPCData.h:30
PositionSensors
@ PositionSensors
Definition: MultipleAnalogSensorsRemapper.h:34
yarp::os::Bottle
A simple collection of objects that can be described and transmitted in a portable way.
Definition: Bottle.h:73
SensorRPCData::SensorRPCData
SensorRPCData()
Definition: SensorRPCData.cpp:17
SensorRPCData::Editor::get_PositionSensors
const std::vector< SensorMetadata > & get_PositionSensors() const
Definition: SensorRPCData.cpp:585
SensorRPCData::Editor::set_SkinPatches
void set_SkinPatches(const std::vector< SensorMetadata > &SkinPatches)
Definition: SensorRPCData.cpp:527
yarp::os::Bottle::toString
std::string toString() const override
Gives a human-readable textual representation of the bottle.
Definition: Bottle.cpp:214
yarp::os::idl::WireReader::readString
bool readString(std::string &str, bool *is_vocab=nullptr)
Definition: WireReader.cpp:339
yarp::os::createVocab
constexpr yarp::conf::vocab32_t createVocab(char a, char b=0, char c=0, char d=0)
Definition: Vocab.h:22
SixAxisForceTorqueSensors
@ SixAxisForceTorqueSensors
Definition: MultipleAnalogSensorsRemapper.h:30
SensorRPCData::ThreeAxisGyroscopes
std::vector< SensorMetadata > ThreeAxisGyroscopes
Definition: SensorRPCData.h:26
SensorRPCData
Definition: SensorRPCData.h:23
BOTTLE_TAG_LIST
#define BOTTLE_TAG_LIST
Definition: Bottle.h:30
SensorRPCData::SkinPatches
std::vector< SensorMetadata > SkinPatches
Definition: SensorRPCData.h:34
SensorRPCData::Editor::set_OrientationSensors
void set_OrientationSensors(const std::vector< SensorMetadata > &OrientationSensors)
Definition: SensorRPCData.cpp:337
SensorRPCData::SixAxisForceTorqueSensors
std::vector< SensorMetadata > SixAxisForceTorqueSensors
Definition: SensorRPCData.h:31
SensorRPCData::PositionSensors
std::vector< SensorMetadata > PositionSensors
Definition: SensorRPCData.h:35
SensorRPCData::Editor::will_set_TemperatureSensors
virtual bool will_set_TemperatureSensors()
Definition: SensorRPCData.cpp:401
SensorRPCData::Editor::write
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
Definition: SensorRPCData.cpp:847
SensorRPCData::Editor::get_ThreeAxisMagnetometers
const std::vector< SensorMetadata > & get_ThreeAxisMagnetometers() const
Definition: SensorRPCData.cpp:319
yarp::os::Time::isValid
bool isValid()
Check if time is valid (non-zero).
Definition: Time.cpp:317
SensorRPCData::Editor::get_ThreeAxisLinearAccelerometers
const std::vector< SensorMetadata > & get_ThreeAxisLinearAccelerometers() const
Definition: SensorRPCData.cpp:281
SkinPatches
@ SkinPatches
Definition: MultipleAnalogSensorsRemapper.h:33
SensorRPCData::Editor::will_set_SkinPatches
virtual bool will_set_SkinPatches()
Definition: SensorRPCData.cpp:553
SensorRPCData::Editor::did_set_SixAxisForceTorqueSensors
virtual bool did_set_SixAxisForceTorqueSensors()
Definition: SensorRPCData.cpp:445
SensorRPCData::Editor::set_ThreeAxisGyroscopes
void set_ThreeAxisGyroscopes(const std::vector< SensorMetadata > &ThreeAxisGyroscopes)
Definition: SensorRPCData.cpp:223
SensorRPCData::Editor::did_set_ThreeAxisMagnetometers
virtual bool did_set_ThreeAxisMagnetometers()
Definition: SensorRPCData.cpp:331
SensorRPCData::Editor::get_SkinPatches
const std::vector< SensorMetadata > & get_SkinPatches() const
Definition: SensorRPCData.cpp:547
SensorRPCData::Editor::did_set_OrientationSensors
virtual bool did_set_OrientationSensors()
Definition: SensorRPCData.cpp:369
yarp::os::idl::WireWriter::writeString
bool writeString(const std::string &tag) const
Definition: WireWriter.cpp:166
SensorRPCData::Editor::did_set_ThreeAxisLinearAccelerometers
virtual bool did_set_ThreeAxisLinearAccelerometers()
Definition: SensorRPCData.cpp:293
SensorRPCData::ThreeAxisMagnetometers
std::vector< SensorMetadata > ThreeAxisMagnetometers
Definition: SensorRPCData.h:28
SensorRPCData::Editor::did_set_ContactLoadCellArrays
virtual bool did_set_ContactLoadCellArrays()
Definition: SensorRPCData.cpp:483
yarp::os::idl::WireWriter::isNull
bool isNull() const
Definition: WireWriter.cpp:50
SensorRPCData::Editor::will_set_EncoderArrays
virtual bool will_set_EncoderArrays()
Definition: SensorRPCData.cpp:515
yarp::os::idl::WireWriter::isError
bool isError() const
Definition: WireWriter.cpp:136
SensorRPCData::Editor::will_set_ThreeAxisGyroscopes
virtual bool will_set_ThreeAxisGyroscopes()
Definition: SensorRPCData.cpp:249
yarp::os::idl::WireWriter::writeListHeader
bool writeListHeader(int len) const
Definition: WireWriter.cpp:183
OrientationSensors
@ OrientationSensors
Definition: MultipleAnalogSensorsRemapper.h:28
SensorRPCData::Editor::did_set_ThreeAxisGyroscopes
virtual bool did_set_ThreeAxisGyroscopes()
Definition: SensorRPCData.cpp:255
SensorRPCData::Editor::set_SixAxisForceTorqueSensors
void set_SixAxisForceTorqueSensors(const std::vector< SensorMetadata > &SixAxisForceTorqueSensors)
Definition: SensorRPCData.cpp:413
yarp::os::idl::WireWriter::writeNested
bool writeNested(const WirePortable &obj) const
Definition: WireWriter.cpp:65
SensorRPCData::Editor::~Editor
~Editor() override
Definition: SensorRPCData.cpp:177
yarp::os::idl::WireWriter
IDL-friendly connection writer.
Definition: WireWriter.h:33
SensorRPCData::Editor::will_set_PositionSensors
virtual bool will_set_PositionSensors()
Definition: SensorRPCData.cpp:591
SensorRPCData::Editor::Editor
Editor()
Definition: SensorRPCData.cpp:158
SensorRPCData::Editor::get_EncoderArrays
const std::vector< SensorMetadata > & get_EncoderArrays() const
Definition: SensorRPCData.cpp:509
SensorRPCData::Editor::did_set_TemperatureSensors
virtual bool did_set_TemperatureSensors()
Definition: SensorRPCData.cpp:407
ThreeAxisLinearAccelerometers
@ ThreeAxisLinearAccelerometers
Definition: MultipleAnalogSensorsRemapper.h:26
SensorRPCData.h
SensorRPCData::Editor::did_set_SkinPatches
virtual bool did_set_SkinPatches()
Definition: SensorRPCData.cpp:559
SensorRPCData::Editor::will_set_ThreeAxisMagnetometers
virtual bool will_set_ThreeAxisMagnetometers()
Definition: SensorRPCData.cpp:325
SensorRPCData::Editor::will_set_OrientationSensors
virtual bool will_set_OrientationSensors()
Definition: SensorRPCData.cpp:363
yarp::os::ConnectionWriter
An interface for writing to a network connection.
Definition: ConnectionWriter.h:40
yarp::os::idl::WireReader::expectAccept
void expectAccept()
Definition: WireReader.cpp:43
SensorRPCData::Editor::will_set_SixAxisForceTorqueSensors
virtual bool will_set_SixAxisForceTorqueSensors()
Definition: SensorRPCData.cpp:439
TemperatureSensors
@ TemperatureSensors
Definition: MultipleAnalogSensorsRemapper.h:29
SensorRPCData::Editor::set_EncoderArrays
void set_EncoderArrays(const std::vector< SensorMetadata > &EncoderArrays)
Definition: SensorRPCData.cpp:489
SensorRPCData::Editor::get_ThreeAxisGyroscopes
const std::vector< SensorMetadata > & get_ThreeAxisGyroscopes() const
Definition: SensorRPCData.cpp:243
SensorRPCData::Editor::set_ContactLoadCellArrays
void set_ContactLoadCellArrays(const std::vector< SensorMetadata > &ContactLoadCellArrays)
Definition: SensorRPCData.cpp:451
SensorRPCData::Editor::edit
bool edit(SensorRPCData &obj, bool dirty=true)
Definition: SensorRPCData.cpp:185
SensorRPCData::Editor::set_ThreeAxisLinearAccelerometers
void set_ThreeAxisLinearAccelerometers(const std::vector< SensorMetadata > &ThreeAxisLinearAccelerometers)
Definition: SensorRPCData.cpp:261
SensorRPCData::Editor::clean
void clean()
Definition: SensorRPCData.cpp:603
yarp::os::idl::WireReader::readListEnd
void readListEnd()
Definition: WireReader.cpp:613
SensorRPCData::Editor::get_SixAxisForceTorqueSensors
const std::vector< SensorMetadata > & get_SixAxisForceTorqueSensors() const
Definition: SensorRPCData.cpp:433
SensorRPCData::Editor::did_set_PositionSensors
virtual bool did_set_PositionSensors()
Definition: SensorRPCData.cpp:597
SensorRPCData::Editor::start_editing
void start_editing()
Definition: SensorRPCData.cpp:209
ContactLoadCellArrays
@ ContactLoadCellArrays
Definition: MultipleAnalogSensorsRemapper.h:31
SensorRPCData::write
bool write(const yarp::os::idl::WireWriter &writer) const override
Definition: SensorRPCData.cpp:104
SensorRPCData::toString
std::string toString() const
Definition: SensorRPCData.cpp:150
yarp::os::idl::WireReader::readNested
bool readNested(WirePortable &obj)
Definition: WireReader.cpp:91
yarp::os::idl::WireReader::readListBegin
void readListBegin(yarp::os::idl::WireState &nstate, std::uint32_t &len)
Definition: WireReader.cpp:589
yarp::os::idl::WireState
IDL-friendly state.
Definition: WireState.h:22
SensorRPCData::read
bool read(yarp::os::idl::WireReader &reader) override
Definition: SensorRPCData.cpp:58
SensorRPCData::Editor::isValid
bool isValid() const
Definition: SensorRPCData.cpp:197
SensorRPCData::ContactLoadCellArrays
std::vector< SensorMetadata > ContactLoadCellArrays
Definition: SensorRPCData.h:32
yarp::os::idl::WireWriter::writeTag
bool writeTag(const char *tag, int split, int len) const
Definition: WireWriter.cpp:141
ThreeAxisMagnetometers
@ ThreeAxisMagnetometers
Definition: MultipleAnalogSensorsRemapper.h:27
yarp::os::idl::WireReader
IDL-friendly connection reader.
Definition: WireReader.h:33
yarp::os::ConnectionReader
An interface for reading from a network connection.
Definition: ConnectionReader.h:40
yarp::os::idl::WireReader::fail
void fail()
Definition: WireReader.cpp:74
SensorRPCData::Editor::get_OrientationSensors
const std::vector< SensorMetadata > & get_OrientationSensors() const
Definition: SensorRPCData.cpp:357
yarp::os::Wire::yarp
yarp::os::WireLink & yarp()
Get YARP state associated with this object.
Definition: Wire.h:34
SensorMetadata
Definition: SensorMetadata.h:22
SensorRPCData::Editor::set_PositionSensors
void set_PositionSensors(const std::vector< SensorMetadata > &PositionSensors)
Definition: SensorRPCData.cpp:565
SensorRPCData::OrientationSensors
std::vector< SensorMetadata > OrientationSensors
Definition: SensorRPCData.h:29
yarp::os::idl::WireWriter::writeVocab
bool writeVocab(std::int32_t x) const
Definition: WireWriter.cpp:124
yarp::os::idl::WireWriter::writeListBegin
bool writeListBegin(int tag, std::uint32_t len) const
Definition: WireWriter.cpp:204
yarp::os::idl::WireReader::accept
void accept()
Definition: WireReader.cpp:49
SensorRPCData::Editor::did_set_EncoderArrays
virtual bool did_set_EncoderArrays()
Definition: SensorRPCData.cpp:521
SensorRPCData::Editor::stop_editing
void stop_editing()
Definition: SensorRPCData.cpp:215
SensorRPCData::Editor::get_TemperatureSensors
const std::vector< SensorMetadata > & get_TemperatureSensors() const
Definition: SensorRPCData.cpp:395
SensorRPCData::Editor::will_set_ContactLoadCellArrays
virtual bool will_set_ContactLoadCellArrays()
Definition: SensorRPCData.cpp:477
yarp
The main, catch-all namespace for YARP.
Definition: environment.h:18
SensorRPCData::Editor::will_set_ThreeAxisLinearAccelerometers
virtual bool will_set_ThreeAxisLinearAccelerometers()
Definition: SensorRPCData.cpp:287
yarp::os::idl::WireWriter::writeListEnd
bool writeListEnd() const
Definition: WireWriter.cpp:227
SensorRPCData::Editor::set_TemperatureSensors
void set_TemperatureSensors(const std::vector< SensorMetadata > &TemperatureSensors)
Definition: SensorRPCData.cpp:375
yarp::os::Bottle::read
bool read(ConnectionReader &reader) override
Set the bottle's value based on input from a network connection.
Definition: Bottle.cpp:243
SensorRPCData::Editor::read
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
Definition: SensorRPCData.cpp:609
SensorRPCData::Editor::set_ThreeAxisMagnetometers
void set_ThreeAxisMagnetometers(const std::vector< SensorMetadata > &ThreeAxisMagnetometers)
Definition: SensorRPCData.cpp:299
SensorRPCData::ThreeAxisLinearAccelerometers
std::vector< SensorMetadata > ThreeAxisLinearAccelerometers
Definition: SensorRPCData.h:27
SensorRPCData::Editor::state
SensorRPCData & state()
Definition: SensorRPCData.cpp:203
yarp::os::idl::WireReader::getLength
int getLength() const
Definition: WireReader.h:153
EncoderArrays
@ EncoderArrays
Definition: MultipleAnalogSensorsRemapper.h:32
SensorRPCData::Editor::get_ContactLoadCellArrays
const std::vector< SensorMetadata > & get_ContactLoadCellArrays() const
Definition: SensorRPCData.cpp:471
SensorRPCData::EncoderArrays
std::vector< SensorMetadata > EncoderArrays
Definition: SensorRPCData.h:33
ThreeAxisGyroscopes
@ ThreeAxisGyroscopes
Definition: MultipleAnalogSensorsRemapper.h:25
yarp::os::idl::WireReader::readListHeader
bool readListHeader()
Definition: WireReader.cpp:470
yarp::os::idl::WireReader::isError
bool isError()
Definition: WireReader.cpp:547