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