YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
TestMultipleContainers.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 <yarp/conf/version.h>
14#include <yarp/os/LogStream.h>
15
17
18#include <algorithm>
19
20namespace
21{
22 YARP_LOG_COMPONENT(SERVICE_LOG_COMPONENT, "TestMultipleContainers")
23}
24
25//TestMultipleContainers_getRemoteProtocolVersion_helper declaration
36
38{
39 yarp::os::idl::WireWriter writer(connection);
40 if (!writer.writeListHeader(1)) {
41 return false;
42 }
43 if (!writer.writeString("getRemoteProtocolVersion")) {
44 return false;
45 }
46 return true;
47}
48
49bool TestMultipleContainers_getRemoteProtocolVersion_helper ::read(yarp::os::ConnectionReader & connection)
50 {
51 yarp::os::idl::WireReader reader(connection);
52 if (!reader.readListHeader()) {
53 reader.fail();
54 return false;
55 }
56
57 if (!helper_proto.read(connection)) {
58 reader.fail();
59 return false;
60 }
61 return true;
62}
63
64//ProtocolVersion, client side
66 {
67 if(!yarp().canWrite()) {
68 yError(" Missing server method TestMultipleContainers::getRemoteProtocolVersion");
69 }
71 bool ok = yarp().write(helper, helper);
72 if (ok) {
73 return helper.helper_proto;}
74 else {
76 return failureproto;}
77}
78
79//ProtocolVersion, client side
81 {
82 auto locproto = this->getLocalProtocolVersion();
83 auto remproto = this->getRemoteProtocolVersion();
84 if (remproto.protocol_version != locproto.protocol_version)
85 {
86 yCError(SERVICE_LOG_COMPONENT) << "Invalid communication protocol.";
87 yCError(SERVICE_LOG_COMPONENT) << "Local Protocol Version: " << locproto.toString();
88 yCError(SERVICE_LOG_COMPONENT) << "Remote Protocol Version: " << remproto.toString();
89 return false;
90 }
91 return true;
92}
93
94//ProtocolVersion, server side
96{
98 //myproto.protocol_version using default value = 0
99 //to change this value add the following line to the .thrift file:
100 //const i16 protocol_version = <your_number_here>
101 myproto.protocol_version = 0;
105 return myproto;
106}
107
108// testList1 helper class declaration
110 public yarp::os::Portable
111{
112public:
114 explicit TestMultipleContainers_testList1_helper(const std::vector<std::int32_t>& a);
115 bool write(yarp::os::ConnectionWriter& connection) const override;
116 bool read(yarp::os::ConnectionReader& connection) override;
117
118 class Command :
120 {
121 public:
122 Command() = default;
123 explicit Command(const std::vector<std::int32_t>& a);
124
125 ~Command() override = default;
126
127 bool write(yarp::os::ConnectionWriter& connection) const override;
128 bool read(yarp::os::ConnectionReader& connection) override;
129
130 bool write(const yarp::os::idl::WireWriter& writer) const override;
131 bool writeTag(const yarp::os::idl::WireWriter& writer) const;
132 bool writeArgs(const yarp::os::idl::WireWriter& writer) const;
133
134 bool read(yarp::os::idl::WireReader& reader) override;
137
138 std::vector<std::int32_t> a{};
139 };
140
141 class Reply :
143 {
144 public:
145 Reply() = default;
146 ~Reply() override = default;
147
148 bool write(yarp::os::ConnectionWriter& connection) const override;
149 bool read(yarp::os::ConnectionReader& connection) override;
150
151 bool write(const yarp::os::idl::WireWriter& writer) const override;
152 bool read(yarp::os::idl::WireReader& reader) override;
153
154 bool return_helper{false};
155 };
156
157 using funcptr_t = bool (*)(const std::vector<std::int32_t>&);
158 void call(TestMultipleContainers* ptr);
159
162
163 static constexpr const char* s_tag{"testList1"};
164 static constexpr size_t s_tag_len{1};
165 static constexpr size_t s_cmd_len{2};
166 static constexpr size_t s_reply_len{1};
167 static constexpr const char* s_prototype{"bool TestMultipleContainers::testList1(const std::vector<std::int32_t>& a)"};
168 static constexpr const char* s_help{""};
169};
170
171// testList2 helper class declaration
173 public yarp::os::Portable
174{
175public:
177 TestMultipleContainers_testList2_helper(const std::vector<std::int32_t>& a, const std::vector<std::int32_t>& b);
178 bool write(yarp::os::ConnectionWriter& connection) const override;
179 bool read(yarp::os::ConnectionReader& connection) override;
180
181 class Command :
183 {
184 public:
185 Command() = default;
186 Command(const std::vector<std::int32_t>& a, const std::vector<std::int32_t>& b);
187
188 ~Command() override = default;
189
190 bool write(yarp::os::ConnectionWriter& connection) const override;
191 bool read(yarp::os::ConnectionReader& connection) override;
192
193 bool write(const yarp::os::idl::WireWriter& writer) const override;
194 bool writeTag(const yarp::os::idl::WireWriter& writer) const;
195 bool writeArgs(const yarp::os::idl::WireWriter& writer) const;
196
197 bool read(yarp::os::idl::WireReader& reader) override;
200
201 std::vector<std::int32_t> a{};
202 std::vector<std::int32_t> b{};
203 };
204
205 class Reply :
207 {
208 public:
209 Reply() = default;
210 ~Reply() override = default;
211
212 bool write(yarp::os::ConnectionWriter& connection) const override;
213 bool read(yarp::os::ConnectionReader& connection) override;
214
215 bool write(const yarp::os::idl::WireWriter& writer) const override;
216 bool read(yarp::os::idl::WireReader& reader) override;
217
218 bool return_helper{false};
219 };
220
221 using funcptr_t = bool (*)(const std::vector<std::int32_t>&, const std::vector<std::int32_t>&);
222 void call(TestMultipleContainers* ptr);
223
226
227 static constexpr const char* s_tag{"testList2"};
228 static constexpr size_t s_tag_len{1};
229 static constexpr size_t s_cmd_len{3};
230 static constexpr size_t s_reply_len{1};
231 static constexpr const char* s_prototype{"bool TestMultipleContainers::testList2(const std::vector<std::int32_t>& a, const std::vector<std::int32_t>& b)"};
232 static constexpr const char* s_help{""};
233};
234
235// testMap1 helper class declaration
237 public yarp::os::Portable
238{
239public:
241 explicit TestMultipleContainers_testMap1_helper(const std::map<std::int32_t, std::string>& a);
242 bool write(yarp::os::ConnectionWriter& connection) const override;
243 bool read(yarp::os::ConnectionReader& connection) override;
244
245 class Command :
247 {
248 public:
249 Command() = default;
250 explicit Command(const std::map<std::int32_t, std::string>& a);
251
252 ~Command() override = default;
253
254 bool write(yarp::os::ConnectionWriter& connection) const override;
255 bool read(yarp::os::ConnectionReader& connection) override;
256
257 bool write(const yarp::os::idl::WireWriter& writer) const override;
258 bool writeTag(const yarp::os::idl::WireWriter& writer) const;
259 bool writeArgs(const yarp::os::idl::WireWriter& writer) const;
260
261 bool read(yarp::os::idl::WireReader& reader) override;
264
265 std::map<std::int32_t, std::string> a{};
266 };
267
268 class Reply :
270 {
271 public:
272 Reply() = default;
273 ~Reply() override = default;
274
275 bool write(yarp::os::ConnectionWriter& connection) const override;
276 bool read(yarp::os::ConnectionReader& connection) override;
277
278 bool write(const yarp::os::idl::WireWriter& writer) const override;
279 bool read(yarp::os::idl::WireReader& reader) override;
280
281 bool return_helper{false};
282 };
283
284 using funcptr_t = bool (*)(const std::map<std::int32_t, std::string>&);
285 void call(TestMultipleContainers* ptr);
286
289
290 static constexpr const char* s_tag{"testMap1"};
291 static constexpr size_t s_tag_len{1};
292 static constexpr size_t s_cmd_len{2};
293 static constexpr size_t s_reply_len{1};
294 static constexpr const char* s_prototype{"bool TestMultipleContainers::testMap1(const std::map<std::int32_t, std::string>& a)"};
295 static constexpr const char* s_help{""};
296};
297
298// testMap2 helper class declaration
300 public yarp::os::Portable
301{
302public:
304 TestMultipleContainers_testMap2_helper(const std::map<std::int32_t, std::string>& a, const std::map<std::int32_t, std::string>& b);
305 bool write(yarp::os::ConnectionWriter& connection) const override;
306 bool read(yarp::os::ConnectionReader& connection) override;
307
308 class Command :
310 {
311 public:
312 Command() = default;
313 Command(const std::map<std::int32_t, std::string>& a, const std::map<std::int32_t, std::string>& b);
314
315 ~Command() override = default;
316
317 bool write(yarp::os::ConnectionWriter& connection) const override;
318 bool read(yarp::os::ConnectionReader& connection) override;
319
320 bool write(const yarp::os::idl::WireWriter& writer) const override;
321 bool writeTag(const yarp::os::idl::WireWriter& writer) const;
322 bool writeArgs(const yarp::os::idl::WireWriter& writer) const;
323
324 bool read(yarp::os::idl::WireReader& reader) override;
327
328 std::map<std::int32_t, std::string> a{};
329 std::map<std::int32_t, std::string> b{};
330 };
331
332 class Reply :
334 {
335 public:
336 Reply() = default;
337 ~Reply() override = default;
338
339 bool write(yarp::os::ConnectionWriter& connection) const override;
340 bool read(yarp::os::ConnectionReader& connection) override;
341
342 bool write(const yarp::os::idl::WireWriter& writer) const override;
343 bool read(yarp::os::idl::WireReader& reader) override;
344
345 bool return_helper{false};
346 };
347
348 using funcptr_t = bool (*)(const std::map<std::int32_t, std::string>&, const std::map<std::int32_t, std::string>&);
349 void call(TestMultipleContainers* ptr);
350
353
354 static constexpr const char* s_tag{"testMap2"};
355 static constexpr size_t s_tag_len{1};
356 static constexpr size_t s_cmd_len{3};
357 static constexpr size_t s_reply_len{1};
358 static constexpr const char* s_prototype{"bool TestMultipleContainers::testMap2(const std::map<std::int32_t, std::string>& a, const std::map<std::int32_t, std::string>& b)"};
359 static constexpr const char* s_help{""};
360};
361
362// testSet1 helper class declaration
364 public yarp::os::Portable
365{
366public:
368 explicit TestMultipleContainers_testSet1_helper(const std::set<std::int32_t>& a);
369 bool write(yarp::os::ConnectionWriter& connection) const override;
370 bool read(yarp::os::ConnectionReader& connection) override;
371
372 class Command :
374 {
375 public:
376 Command() = default;
377 explicit Command(const std::set<std::int32_t>& a);
378
379 ~Command() override = default;
380
381 bool write(yarp::os::ConnectionWriter& connection) const override;
382 bool read(yarp::os::ConnectionReader& connection) override;
383
384 bool write(const yarp::os::idl::WireWriter& writer) const override;
385 bool writeTag(const yarp::os::idl::WireWriter& writer) const;
386 bool writeArgs(const yarp::os::idl::WireWriter& writer) const;
387
388 bool read(yarp::os::idl::WireReader& reader) override;
391
392 std::set<std::int32_t> a{};
393 };
394
395 class Reply :
397 {
398 public:
399 Reply() = default;
400 ~Reply() override = default;
401
402 bool write(yarp::os::ConnectionWriter& connection) const override;
403 bool read(yarp::os::ConnectionReader& connection) override;
404
405 bool write(const yarp::os::idl::WireWriter& writer) const override;
406 bool read(yarp::os::idl::WireReader& reader) override;
407
408 bool return_helper{false};
409 };
410
411 using funcptr_t = bool (*)(const std::set<std::int32_t>&);
412 void call(TestMultipleContainers* ptr);
413
416
417 static constexpr const char* s_tag{"testSet1"};
418 static constexpr size_t s_tag_len{1};
419 static constexpr size_t s_cmd_len{2};
420 static constexpr size_t s_reply_len{1};
421 static constexpr const char* s_prototype{"bool TestMultipleContainers::testSet1(const std::set<std::int32_t>& a)"};
422 static constexpr const char* s_help{""};
423};
424
425// testSet2 helper class declaration
427 public yarp::os::Portable
428{
429public:
431 TestMultipleContainers_testSet2_helper(const std::set<std::int32_t>& a, const std::set<std::int32_t>& b);
432 bool write(yarp::os::ConnectionWriter& connection) const override;
433 bool read(yarp::os::ConnectionReader& connection) override;
434
435 class Command :
437 {
438 public:
439 Command() = default;
440 Command(const std::set<std::int32_t>& a, const std::set<std::int32_t>& b);
441
442 ~Command() override = default;
443
444 bool write(yarp::os::ConnectionWriter& connection) const override;
445 bool read(yarp::os::ConnectionReader& connection) override;
446
447 bool write(const yarp::os::idl::WireWriter& writer) const override;
448 bool writeTag(const yarp::os::idl::WireWriter& writer) const;
449 bool writeArgs(const yarp::os::idl::WireWriter& writer) const;
450
451 bool read(yarp::os::idl::WireReader& reader) override;
454
455 std::set<std::int32_t> a{};
456 std::set<std::int32_t> b{};
457 };
458
459 class Reply :
461 {
462 public:
463 Reply() = default;
464 ~Reply() override = default;
465
466 bool write(yarp::os::ConnectionWriter& connection) const override;
467 bool read(yarp::os::ConnectionReader& connection) override;
468
469 bool write(const yarp::os::idl::WireWriter& writer) const override;
470 bool read(yarp::os::idl::WireReader& reader) override;
471
472 bool return_helper{false};
473 };
474
475 using funcptr_t = bool (*)(const std::set<std::int32_t>&, const std::set<std::int32_t>&);
476 void call(TestMultipleContainers* ptr);
477
480
481 static constexpr const char* s_tag{"testSet2"};
482 static constexpr size_t s_tag_len{1};
483 static constexpr size_t s_cmd_len{3};
484 static constexpr size_t s_reply_len{1};
485 static constexpr const char* s_prototype{"bool TestMultipleContainers::testSet2(const std::set<std::int32_t>& a, const std::set<std::int32_t>& b)"};
486 static constexpr const char* s_help{""};
487};
488
489// testList1 helper class implementation
491 cmd{a}
492{
493}
494
496{
497 return cmd.write(connection);
498}
499
501{
502 return reply.read(connection);
503}
504
506 a{a}
507{
508}
509
511{
512 yarp::os::idl::WireWriter writer(connection);
513 if (!writer.writeListHeader(s_cmd_len)) {
514 return false;
515 }
516 return write(writer);
517}
518
520{
521 yarp::os::idl::WireReader reader(connection);
522 if (!reader.readListHeader()) {
523 reader.fail();
524 return false;
525 }
526 return read(reader);
527}
528
530{
531 if (!writeTag(writer)) {
532 return false;
533 }
534 if (!writeArgs(writer)) {
535 return false;
536 }
537 return true;
538}
539
541{
542 if (!writer.writeTag(s_tag, 1, s_tag_len)) {
543 return false;
544 }
545 return true;
546}
547
549{
550 if (!writer.writeListBegin(BOTTLE_TAG_INT32, a.size())) {
551 return false;
552 }
553 if (!writer.writeBlock(reinterpret_cast<const char*>(a.data()), a.size() * sizeof(std::int32_t))) {
554 return false;
555 }
556 if (!writer.writeListEnd()) {
557 return false;
558 }
559 return true;
560}
561
563{
564 if (!readTag(reader)) {
565 return false;
566 }
567 if (!readArgs(reader)) {
568 return false;
569 }
570 return true;
571}
572
574{
575 std::string tag = reader.readTag(s_tag_len);
576 if (reader.isError()) {
577 return false;
578 }
579 if (tag != s_tag) {
580 reader.fail();
581 return false;
582 }
583 return true;
584}
585
587{
588 if (reader.noMore()) {
589 reader.fail();
590 return false;
591 }
592 {
593 size_t _csize;
595 reader.readListBegin(_etype, _csize);
596 // WireReader removes BOTTLE_TAG_LIST from the tag
597 constexpr int expected_tag = ((BOTTLE_TAG_INT32) & (~BOTTLE_TAG_LIST));
598 if constexpr (expected_tag != 0) {
599 if (_csize != 0 && _etype.code != expected_tag) {
600 return false;
601 }
602 }
603 a.resize(_csize);
604 if (_csize != 0 && !reader.readBlock(reinterpret_cast<char*>(a.data()), a.size() * sizeof(std::int32_t))) {
605 return false;
606 }
607 reader.readListEnd();
608 }
609 if (!reader.noMore()) {
610 reader.fail();
611 return false;
612 }
613 return true;
614}
615
617{
618 yarp::os::idl::WireWriter writer(connection);
619 return write(writer);
620}
621
623{
624 yarp::os::idl::WireReader reader(connection);
625 return read(reader);
626}
627
629{
630 if (!writer.isNull()) {
631 if (!writer.writeListHeader(s_reply_len)) {
632 return false;
633 }
634 if (!writer.writeBool(return_helper)) {
635 return false;
636 }
637 }
638 return true;
639}
640
642{
643 if (!reader.readListReturn()) {
644 return false;
645 }
646 if (reader.noMore()) {
647 reader.fail();
648 return false;
649 }
650 if (!reader.readBool(return_helper)) {
651 reader.fail();
652 return false;
653 }
654 return true;
655}
656
661
662// testList2 helper class implementation
663TestMultipleContainers_testList2_helper::TestMultipleContainers_testList2_helper(const std::vector<std::int32_t>& a, const std::vector<std::int32_t>& b) :
664 cmd{a, b}
665{
666}
667
669{
670 return cmd.write(connection);
671}
672
674{
675 return reply.read(connection);
676}
677
678TestMultipleContainers_testList2_helper::Command::Command(const std::vector<std::int32_t>& a, const std::vector<std::int32_t>& b) :
679 a{a},
680 b{b}
681{
682}
683
685{
686 yarp::os::idl::WireWriter writer(connection);
687 if (!writer.writeListHeader(s_cmd_len)) {
688 return false;
689 }
690 return write(writer);
691}
692
694{
695 yarp::os::idl::WireReader reader(connection);
696 if (!reader.readListHeader()) {
697 reader.fail();
698 return false;
699 }
700 return read(reader);
701}
702
704{
705 if (!writeTag(writer)) {
706 return false;
707 }
708 if (!writeArgs(writer)) {
709 return false;
710 }
711 return true;
712}
713
715{
716 if (!writer.writeTag(s_tag, 1, s_tag_len)) {
717 return false;
718 }
719 return true;
720}
721
723{
724 if (!writer.writeListBegin(BOTTLE_TAG_INT32, a.size())) {
725 return false;
726 }
727 if (!writer.writeBlock(reinterpret_cast<const char*>(a.data()), a.size() * sizeof(std::int32_t))) {
728 return false;
729 }
730 if (!writer.writeListEnd()) {
731 return false;
732 }
733 if (!writer.writeListBegin(BOTTLE_TAG_INT32, b.size())) {
734 return false;
735 }
736 if (!writer.writeBlock(reinterpret_cast<const char*>(b.data()), b.size() * sizeof(std::int32_t))) {
737 return false;
738 }
739 if (!writer.writeListEnd()) {
740 return false;
741 }
742 return true;
743}
744
746{
747 if (!readTag(reader)) {
748 return false;
749 }
750 if (!readArgs(reader)) {
751 return false;
752 }
753 return true;
754}
755
757{
758 std::string tag = reader.readTag(s_tag_len);
759 if (reader.isError()) {
760 return false;
761 }
762 if (tag != s_tag) {
763 reader.fail();
764 return false;
765 }
766 return true;
767}
768
770{
771 if (reader.noMore()) {
772 reader.fail();
773 return false;
774 }
775 {
776 size_t _csize;
778 reader.readListBegin(_etype, _csize);
779 // WireReader removes BOTTLE_TAG_LIST from the tag
780 constexpr int expected_tag = ((BOTTLE_TAG_INT32) & (~BOTTLE_TAG_LIST));
781 if constexpr (expected_tag != 0) {
782 if (_csize != 0 && _etype.code != expected_tag) {
783 return false;
784 }
785 }
786 a.resize(_csize);
787 if (_csize != 0 && !reader.readBlock(reinterpret_cast<char*>(a.data()), a.size() * sizeof(std::int32_t))) {
788 return false;
789 }
790 reader.readListEnd();
791 }
792 if (reader.noMore()) {
793 reader.fail();
794 return false;
795 }
796 {
797 size_t _csize;
799 reader.readListBegin(_etype, _csize);
800 // WireReader removes BOTTLE_TAG_LIST from the tag
801 constexpr int expected_tag = ((BOTTLE_TAG_INT32) & (~BOTTLE_TAG_LIST));
802 if constexpr (expected_tag != 0) {
803 if (_csize != 0 && _etype.code != expected_tag) {
804 return false;
805 }
806 }
807 b.resize(_csize);
808 if (_csize != 0 && !reader.readBlock(reinterpret_cast<char*>(b.data()), b.size() * sizeof(std::int32_t))) {
809 return false;
810 }
811 reader.readListEnd();
812 }
813 if (!reader.noMore()) {
814 reader.fail();
815 return false;
816 }
817 return true;
818}
819
821{
822 yarp::os::idl::WireWriter writer(connection);
823 return write(writer);
824}
825
827{
828 yarp::os::idl::WireReader reader(connection);
829 return read(reader);
830}
831
833{
834 if (!writer.isNull()) {
835 if (!writer.writeListHeader(s_reply_len)) {
836 return false;
837 }
838 if (!writer.writeBool(return_helper)) {
839 return false;
840 }
841 }
842 return true;
843}
844
846{
847 if (!reader.readListReturn()) {
848 return false;
849 }
850 if (reader.noMore()) {
851 reader.fail();
852 return false;
853 }
854 if (!reader.readBool(return_helper)) {
855 reader.fail();
856 return false;
857 }
858 return true;
859}
860
865
866// testMap1 helper class implementation
868 cmd{a}
869{
870}
871
873{
874 return cmd.write(connection);
875}
876
878{
879 return reply.read(connection);
880}
881
882TestMultipleContainers_testMap1_helper::Command::Command(const std::map<std::int32_t, std::string>& a) :
883 a{a}
884{
885}
886
888{
889 yarp::os::idl::WireWriter writer(connection);
890 if (!writer.writeListHeader(s_cmd_len)) {
891 return false;
892 }
893 return write(writer);
894}
895
897{
898 yarp::os::idl::WireReader reader(connection);
899 if (!reader.readListHeader()) {
900 reader.fail();
901 return false;
902 }
903 return read(reader);
904}
905
907{
908 if (!writeTag(writer)) {
909 return false;
910 }
911 if (!writeArgs(writer)) {
912 return false;
913 }
914 return true;
915}
916
918{
919 if (!writer.writeTag(s_tag, 1, s_tag_len)) {
920 return false;
921 }
922 return true;
923}
924
926{
927 if (!writer.writeMapBegin(BOTTLE_TAG_INT32, BOTTLE_TAG_STRING, a.size())) {
928 return false;
929 }
930 for (const auto& _item : a) {
931 if (!writer.writeListBegin(0,2)) {
932 return false;
933 }
934 if (!writer.writeI32(_item.first)) {
935 return false;
936 }
937 if (!writer.writeString(_item.second)) {
938 return false;
939 }
940 if (!writer.writeListEnd()) {
941 return false;
942 }
943 }
944 if (!writer.writeMapEnd()) {
945 return false;
946 }
947 return true;
948}
949
951{
952 if (!readTag(reader)) {
953 return false;
954 }
955 if (!readArgs(reader)) {
956 return false;
957 }
958 return true;
959}
960
962{
963 std::string tag = reader.readTag(s_tag_len);
964 if (reader.isError()) {
965 return false;
966 }
967 if (tag != s_tag) {
968 reader.fail();
969 return false;
970 }
971 return true;
972}
973
975{
976 if (reader.noMore()) {
977 reader.fail();
978 return false;
979 }
980 {
981 size_t _csize;
984 reader.readMapBegin(_ktype, _vtype, _csize);
985 for (size_t _i = 0; _i < _csize; ++_i) {
986 size_t _msize;
988 reader.readListBegin(_lst, _msize);
989 std::int32_t _key;
990 if (reader.noMore()) {
991 reader.fail();
992 return false;
993 }
994 if (!reader.readI32(_key)) {
995 reader.fail();
996 return false;
997 }
998 std::string& _val = a[_key];
999 if (reader.noMore()) {
1000 reader.fail();
1001 return false;
1002 }
1003 if (!reader.readString(_val)) {
1004 reader.fail();
1005 return false;
1006 }
1007 reader.readListEnd();
1008 }
1009 reader.readMapEnd();
1010 }
1011 if (!reader.noMore()) {
1012 reader.fail();
1013 return false;
1014 }
1015 return true;
1016}
1017
1019{
1020 yarp::os::idl::WireWriter writer(connection);
1021 return write(writer);
1022}
1023
1025{
1026 yarp::os::idl::WireReader reader(connection);
1027 return read(reader);
1028}
1029
1031{
1032 if (!writer.isNull()) {
1033 if (!writer.writeListHeader(s_reply_len)) {
1034 return false;
1035 }
1036 if (!writer.writeBool(return_helper)) {
1037 return false;
1038 }
1039 }
1040 return true;
1041}
1042
1044{
1045 if (!reader.readListReturn()) {
1046 return false;
1047 }
1048 if (reader.noMore()) {
1049 reader.fail();
1050 return false;
1051 }
1052 if (!reader.readBool(return_helper)) {
1053 reader.fail();
1054 return false;
1055 }
1056 return true;
1057}
1058
1063
1064// testMap2 helper class implementation
1065TestMultipleContainers_testMap2_helper::TestMultipleContainers_testMap2_helper(const std::map<std::int32_t, std::string>& a, const std::map<std::int32_t, std::string>& b) :
1066 cmd{a, b}
1067{
1068}
1069
1071{
1072 return cmd.write(connection);
1073}
1074
1076{
1077 return reply.read(connection);
1078}
1079
1080TestMultipleContainers_testMap2_helper::Command::Command(const std::map<std::int32_t, std::string>& a, const std::map<std::int32_t, std::string>& b) :
1081 a{a},
1082 b{b}
1083{
1084}
1085
1087{
1088 yarp::os::idl::WireWriter writer(connection);
1089 if (!writer.writeListHeader(s_cmd_len)) {
1090 return false;
1091 }
1092 return write(writer);
1093}
1094
1096{
1097 yarp::os::idl::WireReader reader(connection);
1098 if (!reader.readListHeader()) {
1099 reader.fail();
1100 return false;
1101 }
1102 return read(reader);
1103}
1104
1106{
1107 if (!writeTag(writer)) {
1108 return false;
1109 }
1110 if (!writeArgs(writer)) {
1111 return false;
1112 }
1113 return true;
1114}
1115
1117{
1118 if (!writer.writeTag(s_tag, 1, s_tag_len)) {
1119 return false;
1120 }
1121 return true;
1122}
1123
1125{
1126 if (!writer.writeMapBegin(BOTTLE_TAG_INT32, BOTTLE_TAG_STRING, a.size())) {
1127 return false;
1128 }
1129 for (const auto& _item : a) {
1130 if (!writer.writeListBegin(0,2)) {
1131 return false;
1132 }
1133 if (!writer.writeI32(_item.first)) {
1134 return false;
1135 }
1136 if (!writer.writeString(_item.second)) {
1137 return false;
1138 }
1139 if (!writer.writeListEnd()) {
1140 return false;
1141 }
1142 }
1143 if (!writer.writeMapEnd()) {
1144 return false;
1145 }
1146 if (!writer.writeMapBegin(BOTTLE_TAG_INT32, BOTTLE_TAG_STRING, b.size())) {
1147 return false;
1148 }
1149 for (const auto& _item : b) {
1150 if (!writer.writeListBegin(0,2)) {
1151 return false;
1152 }
1153 if (!writer.writeI32(_item.first)) {
1154 return false;
1155 }
1156 if (!writer.writeString(_item.second)) {
1157 return false;
1158 }
1159 if (!writer.writeListEnd()) {
1160 return false;
1161 }
1162 }
1163 if (!writer.writeMapEnd()) {
1164 return false;
1165 }
1166 return true;
1167}
1168
1170{
1171 if (!readTag(reader)) {
1172 return false;
1173 }
1174 if (!readArgs(reader)) {
1175 return false;
1176 }
1177 return true;
1178}
1179
1181{
1182 std::string tag = reader.readTag(s_tag_len);
1183 if (reader.isError()) {
1184 return false;
1185 }
1186 if (tag != s_tag) {
1187 reader.fail();
1188 return false;
1189 }
1190 return true;
1191}
1192
1194{
1195 if (reader.noMore()) {
1196 reader.fail();
1197 return false;
1198 }
1199 {
1200 size_t _csize;
1203 reader.readMapBegin(_ktype, _vtype, _csize);
1204 for (size_t _i = 0; _i < _csize; ++_i) {
1205 size_t _msize;
1207 reader.readListBegin(_lst, _msize);
1208 std::int32_t _key;
1209 if (reader.noMore()) {
1210 reader.fail();
1211 return false;
1212 }
1213 if (!reader.readI32(_key)) {
1214 reader.fail();
1215 return false;
1216 }
1217 std::string& _val = a[_key];
1218 if (reader.noMore()) {
1219 reader.fail();
1220 return false;
1221 }
1222 if (!reader.readString(_val)) {
1223 reader.fail();
1224 return false;
1225 }
1226 reader.readListEnd();
1227 }
1228 reader.readMapEnd();
1229 }
1230 if (reader.noMore()) {
1231 reader.fail();
1232 return false;
1233 }
1234 {
1235 size_t _csize;
1238 reader.readMapBegin(_ktype, _vtype, _csize);
1239 for (size_t _i = 0; _i < _csize; ++_i) {
1240 size_t _msize;
1242 reader.readListBegin(_lst, _msize);
1243 std::int32_t _key;
1244 if (reader.noMore()) {
1245 reader.fail();
1246 return false;
1247 }
1248 if (!reader.readI32(_key)) {
1249 reader.fail();
1250 return false;
1251 }
1252 std::string& _val = b[_key];
1253 if (reader.noMore()) {
1254 reader.fail();
1255 return false;
1256 }
1257 if (!reader.readString(_val)) {
1258 reader.fail();
1259 return false;
1260 }
1261 reader.readListEnd();
1262 }
1263 reader.readMapEnd();
1264 }
1265 if (!reader.noMore()) {
1266 reader.fail();
1267 return false;
1268 }
1269 return true;
1270}
1271
1273{
1274 yarp::os::idl::WireWriter writer(connection);
1275 return write(writer);
1276}
1277
1279{
1280 yarp::os::idl::WireReader reader(connection);
1281 return read(reader);
1282}
1283
1285{
1286 if (!writer.isNull()) {
1287 if (!writer.writeListHeader(s_reply_len)) {
1288 return false;
1289 }
1290 if (!writer.writeBool(return_helper)) {
1291 return false;
1292 }
1293 }
1294 return true;
1295}
1296
1298{
1299 if (!reader.readListReturn()) {
1300 return false;
1301 }
1302 if (reader.noMore()) {
1303 reader.fail();
1304 return false;
1305 }
1306 if (!reader.readBool(return_helper)) {
1307 reader.fail();
1308 return false;
1309 }
1310 return true;
1311}
1312
1317
1318// testSet1 helper class implementation
1323
1325{
1326 return cmd.write(connection);
1327}
1328
1330{
1331 return reply.read(connection);
1332}
1333
1335 a{a}
1336{
1337}
1338
1340{
1341 yarp::os::idl::WireWriter writer(connection);
1342 if (!writer.writeListHeader(s_cmd_len)) {
1343 return false;
1344 }
1345 return write(writer);
1346}
1347
1349{
1350 yarp::os::idl::WireReader reader(connection);
1351 if (!reader.readListHeader()) {
1352 reader.fail();
1353 return false;
1354 }
1355 return read(reader);
1356}
1357
1359{
1360 if (!writeTag(writer)) {
1361 return false;
1362 }
1363 if (!writeArgs(writer)) {
1364 return false;
1365 }
1366 return true;
1367}
1368
1370{
1371 if (!writer.writeTag(s_tag, 1, s_tag_len)) {
1372 return false;
1373 }
1374 return true;
1375}
1376
1378{
1379 if (!writer.writeSetBegin(BOTTLE_TAG_INT32, a.size())) {
1380 return false;
1381 }
1382 for (const auto& _item : a) {
1383 if (!writer.writeI32(_item)) {
1384 return false;
1385 }
1386 }
1387 if (!writer.writeSetEnd()) {
1388 return false;
1389 }
1390 return true;
1391}
1392
1394{
1395 if (!readTag(reader)) {
1396 return false;
1397 }
1398 if (!readArgs(reader)) {
1399 return false;
1400 }
1401 return true;
1402}
1403
1405{
1406 std::string tag = reader.readTag(s_tag_len);
1407 if (reader.isError()) {
1408 return false;
1409 }
1410 if (tag != s_tag) {
1411 reader.fail();
1412 return false;
1413 }
1414 return true;
1415}
1416
1418{
1419 if (reader.noMore()) {
1420 reader.fail();
1421 return false;
1422 }
1423 {
1424 size_t _csize;
1426 reader.readSetBegin(_etype, _csize);
1427 for (size_t _i = 0; _i < _csize; ++_i) {
1428 std::int32_t _elem;
1429 if (reader.noMore()) {
1430 reader.fail();
1431 return false;
1432 }
1433 if (!reader.readI32(_elem)) {
1434 reader.fail();
1435 return false;
1436 }
1437 a.insert(_elem);
1438 }
1439 reader.readSetEnd();
1440 }
1441 if (!reader.noMore()) {
1442 reader.fail();
1443 return false;
1444 }
1445 return true;
1446}
1447
1449{
1450 yarp::os::idl::WireWriter writer(connection);
1451 return write(writer);
1452}
1453
1455{
1456 yarp::os::idl::WireReader reader(connection);
1457 return read(reader);
1458}
1459
1461{
1462 if (!writer.isNull()) {
1463 if (!writer.writeListHeader(s_reply_len)) {
1464 return false;
1465 }
1466 if (!writer.writeBool(return_helper)) {
1467 return false;
1468 }
1469 }
1470 return true;
1471}
1472
1474{
1475 if (!reader.readListReturn()) {
1476 return false;
1477 }
1478 if (reader.noMore()) {
1479 reader.fail();
1480 return false;
1481 }
1482 if (!reader.readBool(return_helper)) {
1483 reader.fail();
1484 return false;
1485 }
1486 return true;
1487}
1488
1493
1494// testSet2 helper class implementation
1495TestMultipleContainers_testSet2_helper::TestMultipleContainers_testSet2_helper(const std::set<std::int32_t>& a, const std::set<std::int32_t>& b) :
1496 cmd{a, b}
1497{
1498}
1499
1501{
1502 return cmd.write(connection);
1503}
1504
1506{
1507 return reply.read(connection);
1508}
1509
1510TestMultipleContainers_testSet2_helper::Command::Command(const std::set<std::int32_t>& a, const std::set<std::int32_t>& b) :
1511 a{a},
1512 b{b}
1513{
1514}
1515
1517{
1518 yarp::os::idl::WireWriter writer(connection);
1519 if (!writer.writeListHeader(s_cmd_len)) {
1520 return false;
1521 }
1522 return write(writer);
1523}
1524
1526{
1527 yarp::os::idl::WireReader reader(connection);
1528 if (!reader.readListHeader()) {
1529 reader.fail();
1530 return false;
1531 }
1532 return read(reader);
1533}
1534
1536{
1537 if (!writeTag(writer)) {
1538 return false;
1539 }
1540 if (!writeArgs(writer)) {
1541 return false;
1542 }
1543 return true;
1544}
1545
1547{
1548 if (!writer.writeTag(s_tag, 1, s_tag_len)) {
1549 return false;
1550 }
1551 return true;
1552}
1553
1555{
1556 if (!writer.writeSetBegin(BOTTLE_TAG_INT32, a.size())) {
1557 return false;
1558 }
1559 for (const auto& _item : a) {
1560 if (!writer.writeI32(_item)) {
1561 return false;
1562 }
1563 }
1564 if (!writer.writeSetEnd()) {
1565 return false;
1566 }
1567 if (!writer.writeSetBegin(BOTTLE_TAG_INT32, b.size())) {
1568 return false;
1569 }
1570 for (const auto& _item : b) {
1571 if (!writer.writeI32(_item)) {
1572 return false;
1573 }
1574 }
1575 if (!writer.writeSetEnd()) {
1576 return false;
1577 }
1578 return true;
1579}
1580
1582{
1583 if (!readTag(reader)) {
1584 return false;
1585 }
1586 if (!readArgs(reader)) {
1587 return false;
1588 }
1589 return true;
1590}
1591
1593{
1594 std::string tag = reader.readTag(s_tag_len);
1595 if (reader.isError()) {
1596 return false;
1597 }
1598 if (tag != s_tag) {
1599 reader.fail();
1600 return false;
1601 }
1602 return true;
1603}
1604
1606{
1607 if (reader.noMore()) {
1608 reader.fail();
1609 return false;
1610 }
1611 {
1612 size_t _csize;
1614 reader.readSetBegin(_etype, _csize);
1615 for (size_t _i = 0; _i < _csize; ++_i) {
1616 std::int32_t _elem;
1617 if (reader.noMore()) {
1618 reader.fail();
1619 return false;
1620 }
1621 if (!reader.readI32(_elem)) {
1622 reader.fail();
1623 return false;
1624 }
1625 a.insert(_elem);
1626 }
1627 reader.readSetEnd();
1628 }
1629 if (reader.noMore()) {
1630 reader.fail();
1631 return false;
1632 }
1633 {
1634 size_t _csize;
1636 reader.readSetBegin(_etype, _csize);
1637 for (size_t _i = 0; _i < _csize; ++_i) {
1638 std::int32_t _elem;
1639 if (reader.noMore()) {
1640 reader.fail();
1641 return false;
1642 }
1643 if (!reader.readI32(_elem)) {
1644 reader.fail();
1645 return false;
1646 }
1647 b.insert(_elem);
1648 }
1649 reader.readSetEnd();
1650 }
1651 if (!reader.noMore()) {
1652 reader.fail();
1653 return false;
1654 }
1655 return true;
1656}
1657
1659{
1660 yarp::os::idl::WireWriter writer(connection);
1661 return write(writer);
1662}
1663
1665{
1666 yarp::os::idl::WireReader reader(connection);
1667 return read(reader);
1668}
1669
1671{
1672 if (!writer.isNull()) {
1673 if (!writer.writeListHeader(s_reply_len)) {
1674 return false;
1675 }
1676 if (!writer.writeBool(return_helper)) {
1677 return false;
1678 }
1679 }
1680 return true;
1681}
1682
1684{
1685 if (!reader.readListReturn()) {
1686 return false;
1687 }
1688 if (reader.noMore()) {
1689 reader.fail();
1690 return false;
1691 }
1692 if (!reader.readBool(return_helper)) {
1693 reader.fail();
1694 return false;
1695 }
1696 return true;
1697}
1698
1703
1704// Constructor
1706{
1707 yarp().setOwner(*this);
1708}
1709
1710bool TestMultipleContainers::testList1(const std::vector<std::int32_t>& a)
1711{
1712 if (!yarp().canWrite()) {
1713 yError("Missing server method '%s'?", TestMultipleContainers_testList1_helper::s_prototype);
1714 }
1716 bool ok = yarp().write(helper, helper);
1717 return ok ? helper.reply.return_helper : bool{};
1718}
1719
1720bool TestMultipleContainers::testList2(const std::vector<std::int32_t>& a, const std::vector<std::int32_t>& b)
1721{
1722 if (!yarp().canWrite()) {
1723 yError("Missing server method '%s'?", TestMultipleContainers_testList2_helper::s_prototype);
1724 }
1726 bool ok = yarp().write(helper, helper);
1727 return ok ? helper.reply.return_helper : bool{};
1728}
1729
1730bool TestMultipleContainers::testMap1(const std::map<std::int32_t, std::string>& a)
1731{
1732 if (!yarp().canWrite()) {
1733 yError("Missing server method '%s'?", TestMultipleContainers_testMap1_helper::s_prototype);
1734 }
1736 bool ok = yarp().write(helper, helper);
1737 return ok ? helper.reply.return_helper : bool{};
1738}
1739
1740bool TestMultipleContainers::testMap2(const std::map<std::int32_t, std::string>& a, const std::map<std::int32_t, std::string>& b)
1741{
1742 if (!yarp().canWrite()) {
1743 yError("Missing server method '%s'?", TestMultipleContainers_testMap2_helper::s_prototype);
1744 }
1746 bool ok = yarp().write(helper, helper);
1747 return ok ? helper.reply.return_helper : bool{};
1748}
1749
1750bool TestMultipleContainers::testSet1(const std::set<std::int32_t>& a)
1751{
1752 if (!yarp().canWrite()) {
1753 yError("Missing server method '%s'?", TestMultipleContainers_testSet1_helper::s_prototype);
1754 }
1756 bool ok = yarp().write(helper, helper);
1757 return ok ? helper.reply.return_helper : bool{};
1758}
1759
1760bool TestMultipleContainers::testSet2(const std::set<std::int32_t>& a, const std::set<std::int32_t>& b)
1761{
1762 if (!yarp().canWrite()) {
1763 yError("Missing server method '%s'?", TestMultipleContainers_testSet2_helper::s_prototype);
1764 }
1766 bool ok = yarp().write(helper, helper);
1767 return ok ? helper.reply.return_helper : bool{};
1768}
1769
1770// help method
1771std::vector<std::string> TestMultipleContainers::help(const std::string& functionName)
1772{
1773 bool showAll = (functionName == "--all");
1774 std::vector<std::string> helpString;
1775 if (showAll) {
1776 helpString.emplace_back("*** Available commands:");
1777 helpString.emplace_back(TestMultipleContainers_testList1_helper::s_tag);
1778 helpString.emplace_back(TestMultipleContainers_testList2_helper::s_tag);
1779 helpString.emplace_back(TestMultipleContainers_testMap1_helper::s_tag);
1780 helpString.emplace_back(TestMultipleContainers_testMap2_helper::s_tag);
1781 helpString.emplace_back(TestMultipleContainers_testSet1_helper::s_tag);
1782 helpString.emplace_back(TestMultipleContainers_testSet2_helper::s_tag);
1783 helpString.emplace_back("help");
1784 } else {
1787 }
1790 }
1793 }
1796 }
1799 }
1802 }
1803 if (functionName == "help") {
1804 helpString.emplace_back("std::vector<std::string> help(const std::string& functionName = \"--all\")");
1805 helpString.emplace_back("Return list of available commands, or help message for a specific function");
1806 helpString.emplace_back("@param functionName name of command for which to get a detailed description. If none or '--all' is provided, print list of available commands");
1807 helpString.emplace_back("@return list of strings (one string per line)");
1808 }
1809 }
1810 if (helpString.empty()) {
1811 helpString.emplace_back("Command not found");
1812 }
1813 return helpString;
1814}
1815
1816// read from ConnectionReader
1818{
1819 constexpr size_t max_tag_len = 1;
1820 size_t tag_len = 1;
1821
1822 yarp::os::idl::WireReader reader(connection);
1823 reader.expectAccept();
1824 if (!reader.readListHeader()) {
1825 reader.fail();
1826 return false;
1827 }
1828
1829 std::string tag = reader.readTag(1);
1830 bool direct = (tag == "__direct__");
1831 if (direct) {
1832 tag = reader.readTag(1);
1833 }
1834 while (tag_len <= max_tag_len && !reader.isError()) {
1835 if(tag == "getRemoteProtocolVersion") {
1836 if (!reader.noMore()) {
1837 yError("Reader invalid protocol?! %s:%d - %s", __FILE__, __LINE__, __YFUNCTION__);
1838 reader.fail();
1839 return false;
1840 }
1841
1842 auto proto = getLocalProtocolVersion();
1843
1844 yarp::os::idl::WireWriter writer(reader);
1845 if (!writer.writeListHeader(1)) {
1846 yWarning("Writer invalid protocol?! %s:%d - %s", __FILE__, __LINE__, __YFUNCTION__);
1847 return false;}
1848 if (!writer.write(proto)) {
1849 yWarning("Writer invalid protocol?! %s:%d - %s", __FILE__, __LINE__, __YFUNCTION__);
1850 return false;
1851 }
1852 reader.accept();
1853 return true;
1854 }
1857 if (!helper.cmd.readArgs(reader)) {
1858 return false;
1859 }
1860
1861 helper.call(this);
1862
1863 yarp::os::idl::WireWriter writer(reader);
1864 if (!helper.reply.write(writer)) {
1865 return false;
1866 }
1867 reader.accept();
1868 return true;
1869 }
1872 if (!helper.cmd.readArgs(reader)) {
1873 return false;
1874 }
1875
1876 helper.call(this);
1877
1878 yarp::os::idl::WireWriter writer(reader);
1879 if (!helper.reply.write(writer)) {
1880 return false;
1881 }
1882 reader.accept();
1883 return true;
1884 }
1887 if (!helper.cmd.readArgs(reader)) {
1888 return false;
1889 }
1890
1891 helper.call(this);
1892
1893 yarp::os::idl::WireWriter writer(reader);
1894 if (!helper.reply.write(writer)) {
1895 return false;
1896 }
1897 reader.accept();
1898 return true;
1899 }
1902 if (!helper.cmd.readArgs(reader)) {
1903 return false;
1904 }
1905
1906 helper.call(this);
1907
1908 yarp::os::idl::WireWriter writer(reader);
1909 if (!helper.reply.write(writer)) {
1910 return false;
1911 }
1912 reader.accept();
1913 return true;
1914 }
1917 if (!helper.cmd.readArgs(reader)) {
1918 return false;
1919 }
1920
1921 helper.call(this);
1922
1923 yarp::os::idl::WireWriter writer(reader);
1924 if (!helper.reply.write(writer)) {
1925 return false;
1926 }
1927 reader.accept();
1928 return true;
1929 }
1932 if (!helper.cmd.readArgs(reader)) {
1933 return false;
1934 }
1935
1936 helper.call(this);
1937
1938 yarp::os::idl::WireWriter writer(reader);
1939 if (!helper.reply.write(writer)) {
1940 return false;
1941 }
1942 reader.accept();
1943 return true;
1944 }
1945 if (tag == "help") {
1946 std::string functionName;
1947 if (!reader.readString(functionName)) {
1948 functionName = "--all";
1949 }
1950 auto help_strings = help(functionName);
1951 yarp::os::idl::WireWriter writer(reader);
1952 if (!writer.isNull()) {
1953 if (!writer.writeListHeader(2)) {
1954 return false;
1955 }
1956 if (!writer.writeTag("many", 1, 0)) {
1957 return false;
1958 }
1959 if (!writer.writeListBegin(0, help_strings.size())) {
1960 return false;
1961 }
1962 for (const auto& help_string : help_strings) {
1963 if (!writer.writeString(help_string)) {
1964 return false;
1965 }
1966 }
1967 if (!writer.writeListEnd()) {
1968 return false;
1969 }
1970 }
1971 reader.accept();
1972 return true;
1973 }
1974 if (reader.noMore()) {
1975 reader.fail();
1976 return false;
1977 }
1978 std::string next_tag = reader.readTag(1);
1979 if (next_tag.empty()) {
1980 break;
1981 }
1982 tag.append("_").append(next_tag);
1983 tag_len = std::count(tag.begin(), tag.end(), '_') + 1;
1984 }
1985 return false;
1986}
#define BOTTLE_TAG_INT32
Definition Bottle.h:21
#define BOTTLE_TAG_STRING
Definition Bottle.h:27
#define BOTTLE_TAG_LIST
Definition Bottle.h:29
#define yError(...)
Definition Log.h:361
#define __YFUNCTION__
Definition Log.h:24
#define yWarning(...)
Definition Log.h:340
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
yarp::os::ApplicationNetworkProtocolVersion helper_proto
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
bool writeArgs(const yarp::os::idl::WireWriter &writer) const
bool readArgs(yarp::os::idl::WireReader &reader)
bool writeTag(const yarp::os::idl::WireWriter &writer) const
bool readTag(yarp::os::idl::WireReader &reader)
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
bool(*)(const std::vector< std::int32_t > &) funcptr_t
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
bool readArgs(yarp::os::idl::WireReader &reader)
bool writeTag(const yarp::os::idl::WireWriter &writer) const
bool readTag(yarp::os::idl::WireReader &reader)
bool writeArgs(const yarp::os::idl::WireWriter &writer) const
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
bool(*)(const std::vector< std::int32_t > &, const std::vector< std::int32_t > &) funcptr_t
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
bool readArgs(yarp::os::idl::WireReader &reader)
bool writeTag(const yarp::os::idl::WireWriter &writer) const
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
bool readTag(yarp::os::idl::WireReader &reader)
bool writeArgs(const yarp::os::idl::WireWriter &writer) const
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
bool(*)(const std::map< std::int32_t, std::string > &) funcptr_t
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
bool writeArgs(const yarp::os::idl::WireWriter &writer) const
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
bool readTag(yarp::os::idl::WireReader &reader)
bool writeTag(const yarp::os::idl::WireWriter &writer) const
bool readArgs(yarp::os::idl::WireReader &reader)
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
bool(*)(const std::map< std::int32_t, std::string > &, const std::map< std::int32_t, std::string > &) funcptr_t
bool readTag(yarp::os::idl::WireReader &reader)
bool writeArgs(const yarp::os::idl::WireWriter &writer) const
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
bool readArgs(yarp::os::idl::WireReader &reader)
bool writeTag(const yarp::os::idl::WireWriter &writer) const
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
bool(*)(const std::set< std::int32_t > &) funcptr_t
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
bool writeArgs(const yarp::os::idl::WireWriter &writer) const
bool readTag(yarp::os::idl::WireReader &reader)
bool writeTag(const yarp::os::idl::WireWriter &writer) const
bool readArgs(yarp::os::idl::WireReader &reader)
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
bool(*)(const std::set< std::int32_t > &, const std::set< std::int32_t > &) funcptr_t
virtual yarp::os::ApplicationNetworkProtocolVersion getLocalProtocolVersion()
virtual bool testList1(const std::vector< std::int32_t > &a)
virtual bool testSet1(const std::set< std::int32_t > &a)
virtual bool testList2(const std::vector< std::int32_t > &a, const std::vector< std::int32_t > &b)
virtual bool testMap1(const std::map< std::int32_t, std::string > &a)
virtual std::vector< std::string > help(const std::string &functionName="--all")
virtual bool testMap2(const std::map< std::int32_t, std::string > &a, const std::map< std::int32_t, std::string > &b)
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
virtual bool testSet2(const std::set< std::int32_t > &a, const std::set< std::int32_t > &b)
virtual yarp::os::ApplicationNetworkProtocolVersion getRemoteProtocolVersion()
An interface for reading from a network connection.
An interface for writing to a network connection.
This is a base class for objects that can be both read from and be written to the YARP network.
Definition Portable.h:25
yarp::os::WireLink & yarp()
Get YARP state associated with this object.
Definition Wire.h:28
A "tamed" Portable, that promises to serialize itself in an IDL-friendly way.
IDL-friendly connection reader.
Definition WireReader.h:27
bool readString(std::string &str, bool *is_vocab=nullptr)
void readListBegin(yarp::os::idl::WireState &nstate, size_t &len)
bool readI32(std::int32_t &x)
std::string readTag(size_t len=static_cast< size_t >(-1))
void readMapBegin(yarp::os::idl::WireState &nstate, yarp::os::idl::WireState &nstate2, size_t &len)
bool readBlock(char *const data, size_t len)
void readSetBegin(yarp::os::idl::WireState &nstate, size_t &len)
IDL-friendly state.
Definition WireState.h:17
IDL-friendly connection writer.
Definition WireWriter.h:28
bool writeBool(bool x, bool skip_tag=false) const
bool write(const WirePortable &obj) const
bool writeI32(std::int32_t x, bool skip_tag=false) const
bool writeListHeader(int len) const
bool writeTag(const char *tag, int split, int len) const
bool writeBlock(const char *data, size_t len) const
bool writeString(const std::string &str, bool skip_tag=false) const
bool writeSetBegin(int tag, size_t len) const
bool writeListBegin(int tag, size_t len) const
bool writeMapBegin(int tag, int tag2, size_t len) const
#define yCError(component,...)
#define YARP_LOG_COMPONENT(name,...)
The main, catch-all namespace for YARP.
Definition dirs.h:16
#define YARP_VERSION_PATCH
Definition version.h:12
#define YARP_VERSION_MAJOR
Definition version.h:10
#define YARP_VERSION_MINOR
Definition version.h:11