YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
ISpeechSynthesizerMsgs.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, "ISpeechSynthesizerMsgs")
24}
25
26//ISpeechSynthesizerMsgs_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 ISpeechSynthesizerMsgs_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 ISpeechSynthesizerMsgs::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// set_language helper class declaration
111 public yarp::os::Portable
112{
113public:
115 explicit ISpeechSynthesizerMsgs_set_language_helper(const std::string& language);
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::string& language);
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::string language{};
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
156 };
157
158 using funcptr_t = return_set_language (*)(const std::string&);
159 void call(ISpeechSynthesizerMsgs* ptr);
160
163
164 static constexpr const char* s_tag{"set_language"};
165 static constexpr size_t s_tag_len{2};
166 static constexpr size_t s_cmd_len{3};
167 static constexpr size_t s_reply_len{1};
168 static constexpr const char* s_prototype{"return_set_language ISpeechSynthesizerMsgs::set_language(const std::string& language)"};
169 static constexpr const char* s_help{""};
170};
171
172// get_language helper class declaration
174 public yarp::os::Portable
175{
176public:
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() override = default;
187
188 bool write(yarp::os::ConnectionWriter& connection) const override;
189 bool read(yarp::os::ConnectionReader& connection) override;
190
191 bool write(const yarp::os::idl::WireWriter& writer) const override;
192 bool writeTag(const yarp::os::idl::WireWriter& writer) const;
193 bool writeArgs(const yarp::os::idl::WireWriter& writer) const;
194
195 bool read(yarp::os::idl::WireReader& reader) override;
198 };
199
200 class Reply :
202 {
203 public:
204 Reply() = default;
205 ~Reply() override = default;
206
207 bool write(yarp::os::ConnectionWriter& connection) const override;
208 bool read(yarp::os::ConnectionReader& connection) override;
209
210 bool write(const yarp::os::idl::WireWriter& writer) const override;
211 bool read(yarp::os::idl::WireReader& reader) override;
212
214 };
215
217 void call(ISpeechSynthesizerMsgs* ptr);
218
221
222 static constexpr const char* s_tag{"get_language"};
223 static constexpr size_t s_tag_len{2};
224 static constexpr size_t s_cmd_len{2};
225 static constexpr size_t s_reply_len{2};
226 static constexpr const char* s_prototype{"return_get_language ISpeechSynthesizerMsgs::get_language()"};
227 static constexpr const char* s_help{""};
228};
229
230// set_voice helper class declaration
232 public yarp::os::Portable
233{
234public:
236 explicit ISpeechSynthesizerMsgs_set_voice_helper(const std::string& voice);
237 bool write(yarp::os::ConnectionWriter& connection) const override;
238 bool read(yarp::os::ConnectionReader& connection) override;
239
240 class Command :
242 {
243 public:
244 Command() = default;
245 explicit Command(const std::string& voice);
246
247 ~Command() override = default;
248
249 bool write(yarp::os::ConnectionWriter& connection) const override;
250 bool read(yarp::os::ConnectionReader& connection) override;
251
252 bool write(const yarp::os::idl::WireWriter& writer) const override;
253 bool writeTag(const yarp::os::idl::WireWriter& writer) const;
254 bool writeArgs(const yarp::os::idl::WireWriter& writer) const;
255
256 bool read(yarp::os::idl::WireReader& reader) override;
259
260 std::string voice{};
261 };
262
263 class Reply :
265 {
266 public:
267 Reply() = default;
268 ~Reply() override = default;
269
270 bool write(yarp::os::ConnectionWriter& connection) const override;
271 bool read(yarp::os::ConnectionReader& connection) override;
272
273 bool write(const yarp::os::idl::WireWriter& writer) const override;
274 bool read(yarp::os::idl::WireReader& reader) override;
275
277 };
278
279 using funcptr_t = return_set_voice (*)(const std::string&);
280 void call(ISpeechSynthesizerMsgs* ptr);
281
284
285 static constexpr const char* s_tag{"set_voice"};
286 static constexpr size_t s_tag_len{2};
287 static constexpr size_t s_cmd_len{3};
288 static constexpr size_t s_reply_len{1};
289 static constexpr const char* s_prototype{"return_set_voice ISpeechSynthesizerMsgs::set_voice(const std::string& voice)"};
290 static constexpr const char* s_help{""};
291};
292
293// get_voice helper class declaration
295 public yarp::os::Portable
296{
297public:
299 bool write(yarp::os::ConnectionWriter& connection) const override;
300 bool read(yarp::os::ConnectionReader& connection) override;
301
302 class Command :
304 {
305 public:
306 Command() = default;
307 ~Command() override = default;
308
309 bool write(yarp::os::ConnectionWriter& connection) const override;
310 bool read(yarp::os::ConnectionReader& connection) override;
311
312 bool write(const yarp::os::idl::WireWriter& writer) const override;
313 bool writeTag(const yarp::os::idl::WireWriter& writer) const;
314 bool writeArgs(const yarp::os::idl::WireWriter& writer) const;
315
316 bool read(yarp::os::idl::WireReader& reader) override;
319 };
320
321 class Reply :
323 {
324 public:
325 Reply() = default;
326 ~Reply() override = default;
327
328 bool write(yarp::os::ConnectionWriter& connection) const override;
329 bool read(yarp::os::ConnectionReader& connection) override;
330
331 bool write(const yarp::os::idl::WireWriter& writer) const override;
332 bool read(yarp::os::idl::WireReader& reader) override;
333
335 };
336
338 void call(ISpeechSynthesizerMsgs* ptr);
339
342
343 static constexpr const char* s_tag{"get_voice"};
344 static constexpr size_t s_tag_len{2};
345 static constexpr size_t s_cmd_len{2};
346 static constexpr size_t s_reply_len{2};
347 static constexpr const char* s_prototype{"return_get_voice ISpeechSynthesizerMsgs::get_voice()"};
348 static constexpr const char* s_help{""};
349};
350
351// get_available_voices helper class declaration
353 public yarp::os::Portable
354{
355public:
357 bool write(yarp::os::ConnectionWriter& connection) const override;
358 bool read(yarp::os::ConnectionReader& connection) override;
359
360 class Command :
362 {
363 public:
364 Command() = default;
365 ~Command() override = default;
366
367 bool write(yarp::os::ConnectionWriter& connection) const override;
368 bool read(yarp::os::ConnectionReader& connection) override;
369
370 bool write(const yarp::os::idl::WireWriter& writer) const override;
371 bool writeTag(const yarp::os::idl::WireWriter& writer) const;
372 bool writeArgs(const yarp::os::idl::WireWriter& writer) const;
373
374 bool read(yarp::os::idl::WireReader& reader) override;
377 };
378
379 class Reply :
381 {
382 public:
383 Reply() = default;
384 ~Reply() override = default;
385
386 bool write(yarp::os::ConnectionWriter& connection) const override;
387 bool read(yarp::os::ConnectionReader& connection) override;
388
389 bool write(const yarp::os::idl::WireWriter& writer) const override;
390 bool read(yarp::os::idl::WireReader& reader) override;
391
393 };
394
396 void call(ISpeechSynthesizerMsgs* ptr);
397
400
401 static constexpr const char* s_tag{"get_available_voices"};
402 static constexpr size_t s_tag_len{3};
403 static constexpr size_t s_cmd_len{3};
404 static constexpr size_t s_reply_len{2};
405 static constexpr const char* s_prototype{"return_get_available_voices ISpeechSynthesizerMsgs::get_available_voices()"};
406 static constexpr const char* s_help{""};
407};
408
409// set_speed helper class declaration
411 public yarp::os::Portable
412{
413public:
415 explicit ISpeechSynthesizerMsgs_set_speed_helper(const double speed);
416 bool write(yarp::os::ConnectionWriter& connection) const override;
417 bool read(yarp::os::ConnectionReader& connection) override;
418
419 class Command :
421 {
422 public:
423 Command() = default;
424 explicit Command(const double speed);
425
426 ~Command() override = default;
427
428 bool write(yarp::os::ConnectionWriter& connection) const override;
429 bool read(yarp::os::ConnectionReader& connection) override;
430
431 bool write(const yarp::os::idl::WireWriter& writer) const override;
432 bool writeTag(const yarp::os::idl::WireWriter& writer) const;
433 bool writeArgs(const yarp::os::idl::WireWriter& writer) const;
434
435 bool read(yarp::os::idl::WireReader& reader) override;
438
439 double speed{0.0};
440 };
441
442 class Reply :
444 {
445 public:
446 Reply() = default;
447 ~Reply() override = default;
448
449 bool write(yarp::os::ConnectionWriter& connection) const override;
450 bool read(yarp::os::ConnectionReader& connection) override;
451
452 bool write(const yarp::os::idl::WireWriter& writer) const override;
453 bool read(yarp::os::idl::WireReader& reader) override;
454
456 };
457
458 using funcptr_t = return_set_speed (*)(const double);
459 void call(ISpeechSynthesizerMsgs* ptr);
460
463
464 static constexpr const char* s_tag{"set_speed"};
465 static constexpr size_t s_tag_len{2};
466 static constexpr size_t s_cmd_len{3};
467 static constexpr size_t s_reply_len{1};
468 static constexpr const char* s_prototype{"return_set_speed ISpeechSynthesizerMsgs::set_speed(const double speed)"};
469 static constexpr const char* s_help{""};
470};
471
472// get_speed helper class declaration
474 public yarp::os::Portable
475{
476public:
478 bool write(yarp::os::ConnectionWriter& connection) const override;
479 bool read(yarp::os::ConnectionReader& connection) override;
480
481 class Command :
483 {
484 public:
485 Command() = default;
486 ~Command() override = default;
487
488 bool write(yarp::os::ConnectionWriter& connection) const override;
489 bool read(yarp::os::ConnectionReader& connection) override;
490
491 bool write(const yarp::os::idl::WireWriter& writer) const override;
492 bool writeTag(const yarp::os::idl::WireWriter& writer) const;
493 bool writeArgs(const yarp::os::idl::WireWriter& writer) const;
494
495 bool read(yarp::os::idl::WireReader& reader) override;
498 };
499
500 class Reply :
502 {
503 public:
504 Reply() = default;
505 ~Reply() override = default;
506
507 bool write(yarp::os::ConnectionWriter& connection) const override;
508 bool read(yarp::os::ConnectionReader& connection) override;
509
510 bool write(const yarp::os::idl::WireWriter& writer) const override;
511 bool read(yarp::os::idl::WireReader& reader) override;
512
514 };
515
517 void call(ISpeechSynthesizerMsgs* ptr);
518
521
522 static constexpr const char* s_tag{"get_speed"};
523 static constexpr size_t s_tag_len{2};
524 static constexpr size_t s_cmd_len{2};
525 static constexpr size_t s_reply_len{2};
526 static constexpr const char* s_prototype{"return_get_speed ISpeechSynthesizerMsgs::get_speed()"};
527 static constexpr const char* s_help{""};
528};
529
530// set_pitch helper class declaration
532 public yarp::os::Portable
533{
534public:
536 explicit ISpeechSynthesizerMsgs_set_pitch_helper(const double pitch);
537 bool write(yarp::os::ConnectionWriter& connection) const override;
538 bool read(yarp::os::ConnectionReader& connection) override;
539
540 class Command :
542 {
543 public:
544 Command() = default;
545 explicit Command(const double pitch);
546
547 ~Command() override = default;
548
549 bool write(yarp::os::ConnectionWriter& connection) const override;
550 bool read(yarp::os::ConnectionReader& connection) override;
551
552 bool write(const yarp::os::idl::WireWriter& writer) const override;
553 bool writeTag(const yarp::os::idl::WireWriter& writer) const;
554 bool writeArgs(const yarp::os::idl::WireWriter& writer) const;
555
556 bool read(yarp::os::idl::WireReader& reader) override;
559
560 double pitch{0.0};
561 };
562
563 class Reply :
565 {
566 public:
567 Reply() = default;
568 ~Reply() override = default;
569
570 bool write(yarp::os::ConnectionWriter& connection) const override;
571 bool read(yarp::os::ConnectionReader& connection) override;
572
573 bool write(const yarp::os::idl::WireWriter& writer) const override;
574 bool read(yarp::os::idl::WireReader& reader) override;
575
577 };
578
579 using funcptr_t = return_set_pitch (*)(const double);
580 void call(ISpeechSynthesizerMsgs* ptr);
581
584
585 static constexpr const char* s_tag{"set_pitch"};
586 static constexpr size_t s_tag_len{2};
587 static constexpr size_t s_cmd_len{3};
588 static constexpr size_t s_reply_len{1};
589 static constexpr const char* s_prototype{"return_set_pitch ISpeechSynthesizerMsgs::set_pitch(const double pitch)"};
590 static constexpr const char* s_help{""};
591};
592
593// get_pitch helper class declaration
595 public yarp::os::Portable
596{
597public:
599 bool write(yarp::os::ConnectionWriter& connection) const override;
600 bool read(yarp::os::ConnectionReader& connection) override;
601
602 class Command :
604 {
605 public:
606 Command() = default;
607 ~Command() override = default;
608
609 bool write(yarp::os::ConnectionWriter& connection) const override;
610 bool read(yarp::os::ConnectionReader& connection) override;
611
612 bool write(const yarp::os::idl::WireWriter& writer) const override;
613 bool writeTag(const yarp::os::idl::WireWriter& writer) const;
614 bool writeArgs(const yarp::os::idl::WireWriter& writer) const;
615
616 bool read(yarp::os::idl::WireReader& reader) override;
619 };
620
621 class Reply :
623 {
624 public:
625 Reply() = default;
626 ~Reply() override = default;
627
628 bool write(yarp::os::ConnectionWriter& connection) const override;
629 bool read(yarp::os::ConnectionReader& connection) override;
630
631 bool write(const yarp::os::idl::WireWriter& writer) const override;
632 bool read(yarp::os::idl::WireReader& reader) override;
633
635 };
636
638 void call(ISpeechSynthesizerMsgs* ptr);
639
642
643 static constexpr const char* s_tag{"get_pitch"};
644 static constexpr size_t s_tag_len{2};
645 static constexpr size_t s_cmd_len{2};
646 static constexpr size_t s_reply_len{2};
647 static constexpr const char* s_prototype{"return_get_pitch ISpeechSynthesizerMsgs::get_pitch()"};
648 static constexpr const char* s_help{""};
649};
650
651// synthesize helper class declaration
653 public yarp::os::Portable
654{
655public:
657 explicit ISpeechSynthesizerMsgs_synthesize_helper(const std::string& text);
658 bool write(yarp::os::ConnectionWriter& connection) const override;
659 bool read(yarp::os::ConnectionReader& connection) override;
660
661 class Command :
663 {
664 public:
665 Command() = default;
666 explicit Command(const std::string& text);
667
668 ~Command() override = default;
669
670 bool write(yarp::os::ConnectionWriter& connection) const override;
671 bool read(yarp::os::ConnectionReader& connection) override;
672
673 bool write(const yarp::os::idl::WireWriter& writer) const override;
674 bool writeTag(const yarp::os::idl::WireWriter& writer) const;
675 bool writeArgs(const yarp::os::idl::WireWriter& writer) const;
676
677 bool read(yarp::os::idl::WireReader& reader) override;
680
681 std::string text{};
682 };
683
684 class Reply :
686 {
687 public:
688 Reply() = default;
689 ~Reply() override = default;
690
691 bool write(yarp::os::ConnectionWriter& connection) const override;
692 bool read(yarp::os::ConnectionReader& connection) override;
693
694 bool write(const yarp::os::idl::WireWriter& writer) const override;
695 bool read(yarp::os::idl::WireReader& reader) override;
696
698 };
699
700 using funcptr_t = return_synthesize (*)(const std::string&);
701 void call(ISpeechSynthesizerMsgs* ptr);
702
705
706 static constexpr const char* s_tag{"synthesize"};
707 static constexpr size_t s_tag_len{1};
708 static constexpr size_t s_cmd_len{2};
709 static constexpr size_t s_reply_len{2};
710 static constexpr const char* s_prototype{"return_synthesize ISpeechSynthesizerMsgs::synthesize(const std::string& text)"};
711 static constexpr const char* s_help{""};
712};
713
714// set_language helper class implementation
716 cmd{language}
717{
718}
719
721{
722 return cmd.write(connection);
723}
724
729
731 language{language}
732{
733}
734
736{
737 yarp::os::idl::WireWriter writer(connection);
738 if (!writer.writeListHeader(s_cmd_len)) {
739 return false;
740 }
741 return write(writer);
742}
743
745{
746 yarp::os::idl::WireReader reader(connection);
747 if (!reader.readListHeader()) {
748 reader.fail();
749 return false;
750 }
751 return read(reader);
752}
753
755{
756 if (!writeTag(writer)) {
757 return false;
758 }
759 if (!writeArgs(writer)) {
760 return false;
761 }
762 return true;
763}
764
766{
767 if (!writer.writeTag(s_tag, 1, s_tag_len)) {
768 return false;
769 }
770 return true;
771}
772
774{
775 if (!writer.writeString(language)) {
776 return false;
777 }
778 return true;
779}
780
782{
783 if (!readTag(reader)) {
784 return false;
785 }
786 if (!readArgs(reader)) {
787 return false;
788 }
789 return true;
790}
791
793{
794 std::string tag = reader.readTag(s_tag_len);
795 if (reader.isError()) {
796 return false;
797 }
798 if (tag != s_tag) {
799 reader.fail();
800 return false;
801 }
802 return true;
803}
804
806{
807 if (reader.noMore()) {
808 reader.fail();
809 return false;
810 }
811 if (!reader.readString(language)) {
812 reader.fail();
813 return false;
814 }
815 if (!reader.noMore()) {
816 reader.fail();
817 return false;
818 }
819 return true;
820}
821
823{
824 yarp::os::idl::WireWriter writer(connection);
825 return write(writer);
826}
827
829{
830 yarp::os::idl::WireReader reader(connection);
831 return read(reader);
832}
833
835{
836 if (!writer.isNull()) {
837 if (!writer.writeListHeader(s_reply_len)) {
838 return false;
839 }
840 if (!writer.write(return_helper)) {
841 return false;
842 }
843 }
844 return true;
845}
846
848{
849 if (!reader.readListReturn()) {
850 return false;
851 }
852 if (reader.noMore()) {
853 reader.fail();
854 return false;
855 }
856 if (!reader.read(return_helper)) {
857 reader.fail();
858 return false;
859 }
860 return true;
861}
862
867
868// get_language helper class implementation
870{
871 return cmd.write(connection);
872}
873
878
880{
881 yarp::os::idl::WireWriter writer(connection);
882 if (!writer.writeListHeader(s_cmd_len)) {
883 return false;
884 }
885 return write(writer);
886}
887
889{
890 yarp::os::idl::WireReader reader(connection);
891 if (!reader.readListHeader()) {
892 reader.fail();
893 return false;
894 }
895 return read(reader);
896}
897
899{
900 if (!writeTag(writer)) {
901 return false;
902 }
903 if (!writeArgs(writer)) {
904 return false;
905 }
906 return true;
907}
908
910{
911 if (!writer.writeTag(s_tag, 1, s_tag_len)) {
912 return false;
913 }
914 return true;
915}
916
918{
919 return true;
920}
921
923{
924 if (!readTag(reader)) {
925 return false;
926 }
927 if (!readArgs(reader)) {
928 return false;
929 }
930 return true;
931}
932
934{
935 std::string tag = reader.readTag(s_tag_len);
936 if (reader.isError()) {
937 return false;
938 }
939 if (tag != s_tag) {
940 reader.fail();
941 return false;
942 }
943 return true;
944}
945
947{
948 if (!reader.noMore()) {
949 reader.fail();
950 return false;
951 }
952 return true;
953}
954
956{
957 yarp::os::idl::WireWriter writer(connection);
958 return write(writer);
959}
960
962{
963 yarp::os::idl::WireReader reader(connection);
964 return read(reader);
965}
966
968{
969 if (!writer.isNull()) {
970 if (!writer.writeListHeader(s_reply_len)) {
971 return false;
972 }
973 if (!writer.write(return_helper)) {
974 return false;
975 }
976 }
977 return true;
978}
979
981{
982 if (!reader.readListReturn()) {
983 return false;
984 }
985 if (reader.noMore()) {
986 reader.fail();
987 return false;
988 }
989 if (!reader.read(return_helper)) {
990 reader.fail();
991 return false;
992 }
993 return true;
994}
995
1000
1001// set_voice helper class implementation
1006
1008{
1009 return cmd.write(connection);
1010}
1011
1013{
1014 return reply.read(connection);
1015}
1016
1018 voice{voice}
1019{
1020}
1021
1023{
1024 yarp::os::idl::WireWriter writer(connection);
1025 if (!writer.writeListHeader(s_cmd_len)) {
1026 return false;
1027 }
1028 return write(writer);
1029}
1030
1032{
1033 yarp::os::idl::WireReader reader(connection);
1034 if (!reader.readListHeader()) {
1035 reader.fail();
1036 return false;
1037 }
1038 return read(reader);
1039}
1040
1042{
1043 if (!writeTag(writer)) {
1044 return false;
1045 }
1046 if (!writeArgs(writer)) {
1047 return false;
1048 }
1049 return true;
1050}
1051
1053{
1054 if (!writer.writeTag(s_tag, 1, s_tag_len)) {
1055 return false;
1056 }
1057 return true;
1058}
1059
1061{
1062 if (!writer.writeString(voice)) {
1063 return false;
1064 }
1065 return true;
1066}
1067
1069{
1070 if (!readTag(reader)) {
1071 return false;
1072 }
1073 if (!readArgs(reader)) {
1074 return false;
1075 }
1076 return true;
1077}
1078
1080{
1081 std::string tag = reader.readTag(s_tag_len);
1082 if (reader.isError()) {
1083 return false;
1084 }
1085 if (tag != s_tag) {
1086 reader.fail();
1087 return false;
1088 }
1089 return true;
1090}
1091
1093{
1094 if (reader.noMore()) {
1095 reader.fail();
1096 return false;
1097 }
1098 if (!reader.readString(voice)) {
1099 reader.fail();
1100 return false;
1101 }
1102 if (!reader.noMore()) {
1103 reader.fail();
1104 return false;
1105 }
1106 return true;
1107}
1108
1110{
1111 yarp::os::idl::WireWriter writer(connection);
1112 return write(writer);
1113}
1114
1116{
1117 yarp::os::idl::WireReader reader(connection);
1118 return read(reader);
1119}
1120
1122{
1123 if (!writer.isNull()) {
1124 if (!writer.writeListHeader(s_reply_len)) {
1125 return false;
1126 }
1127 if (!writer.write(return_helper)) {
1128 return false;
1129 }
1130 }
1131 return true;
1132}
1133
1135{
1136 if (!reader.readListReturn()) {
1137 return false;
1138 }
1139 if (reader.noMore()) {
1140 reader.fail();
1141 return false;
1142 }
1143 if (!reader.read(return_helper)) {
1144 reader.fail();
1145 return false;
1146 }
1147 return true;
1148}
1149
1154
1155// get_voice helper class implementation
1157{
1158 return cmd.write(connection);
1159}
1160
1162{
1163 return reply.read(connection);
1164}
1165
1167{
1168 yarp::os::idl::WireWriter writer(connection);
1169 if (!writer.writeListHeader(s_cmd_len)) {
1170 return false;
1171 }
1172 return write(writer);
1173}
1174
1176{
1177 yarp::os::idl::WireReader reader(connection);
1178 if (!reader.readListHeader()) {
1179 reader.fail();
1180 return false;
1181 }
1182 return read(reader);
1183}
1184
1186{
1187 if (!writeTag(writer)) {
1188 return false;
1189 }
1190 if (!writeArgs(writer)) {
1191 return false;
1192 }
1193 return true;
1194}
1195
1197{
1198 if (!writer.writeTag(s_tag, 1, s_tag_len)) {
1199 return false;
1200 }
1201 return true;
1202}
1203
1205{
1206 return true;
1207}
1208
1210{
1211 if (!readTag(reader)) {
1212 return false;
1213 }
1214 if (!readArgs(reader)) {
1215 return false;
1216 }
1217 return true;
1218}
1219
1221{
1222 std::string tag = reader.readTag(s_tag_len);
1223 if (reader.isError()) {
1224 return false;
1225 }
1226 if (tag != s_tag) {
1227 reader.fail();
1228 return false;
1229 }
1230 return true;
1231}
1232
1234{
1235 if (!reader.noMore()) {
1236 reader.fail();
1237 return false;
1238 }
1239 return true;
1240}
1241
1243{
1244 yarp::os::idl::WireWriter writer(connection);
1245 return write(writer);
1246}
1247
1249{
1250 yarp::os::idl::WireReader reader(connection);
1251 return read(reader);
1252}
1253
1255{
1256 if (!writer.isNull()) {
1257 if (!writer.writeListHeader(s_reply_len)) {
1258 return false;
1259 }
1260 if (!writer.write(return_helper)) {
1261 return false;
1262 }
1263 }
1264 return true;
1265}
1266
1268{
1269 if (!reader.readListReturn()) {
1270 return false;
1271 }
1272 if (reader.noMore()) {
1273 reader.fail();
1274 return false;
1275 }
1276 if (!reader.read(return_helper)) {
1277 reader.fail();
1278 return false;
1279 }
1280 return true;
1281}
1282
1287
1288// get_available_voices helper class implementation
1290{
1291 return cmd.write(connection);
1292}
1293
1298
1300{
1301 yarp::os::idl::WireWriter writer(connection);
1302 if (!writer.writeListHeader(s_cmd_len)) {
1303 return false;
1304 }
1305 return write(writer);
1306}
1307
1309{
1310 yarp::os::idl::WireReader reader(connection);
1311 if (!reader.readListHeader()) {
1312 reader.fail();
1313 return false;
1314 }
1315 return read(reader);
1316}
1317
1319{
1320 if (!writeTag(writer)) {
1321 return false;
1322 }
1323 if (!writeArgs(writer)) {
1324 return false;
1325 }
1326 return true;
1327}
1328
1330{
1331 if (!writer.writeTag(s_tag, 1, s_tag_len)) {
1332 return false;
1333 }
1334 return true;
1335}
1336
1338{
1339 return true;
1340}
1341
1343{
1344 if (!readTag(reader)) {
1345 return false;
1346 }
1347 if (!readArgs(reader)) {
1348 return false;
1349 }
1350 return true;
1351}
1352
1354{
1355 std::string tag = reader.readTag(s_tag_len);
1356 if (reader.isError()) {
1357 return false;
1358 }
1359 if (tag != s_tag) {
1360 reader.fail();
1361 return false;
1362 }
1363 return true;
1364}
1365
1367{
1368 if (!reader.noMore()) {
1369 reader.fail();
1370 return false;
1371 }
1372 return true;
1373}
1374
1376{
1377 yarp::os::idl::WireWriter writer(connection);
1378 return write(writer);
1379}
1380
1386
1388{
1389 if (!writer.isNull()) {
1390 if (!writer.writeListHeader(s_reply_len)) {
1391 return false;
1392 }
1393 if (!writer.write(return_helper)) {
1394 return false;
1395 }
1396 }
1397 return true;
1398}
1399
1401{
1402 if (!reader.readListReturn()) {
1403 return false;
1404 }
1405 if (reader.noMore()) {
1406 reader.fail();
1407 return false;
1408 }
1409 if (!reader.read(return_helper)) {
1410 reader.fail();
1411 return false;
1412 }
1413 return true;
1414}
1415
1420
1421// set_speed helper class implementation
1426
1428{
1429 return cmd.write(connection);
1430}
1431
1433{
1434 return reply.read(connection);
1435}
1436
1438 speed{speed}
1439{
1440}
1441
1443{
1444 yarp::os::idl::WireWriter writer(connection);
1445 if (!writer.writeListHeader(s_cmd_len)) {
1446 return false;
1447 }
1448 return write(writer);
1449}
1450
1452{
1453 yarp::os::idl::WireReader reader(connection);
1454 if (!reader.readListHeader()) {
1455 reader.fail();
1456 return false;
1457 }
1458 return read(reader);
1459}
1460
1462{
1463 if (!writeTag(writer)) {
1464 return false;
1465 }
1466 if (!writeArgs(writer)) {
1467 return false;
1468 }
1469 return true;
1470}
1471
1473{
1474 if (!writer.writeTag(s_tag, 1, s_tag_len)) {
1475 return false;
1476 }
1477 return true;
1478}
1479
1481{
1482 if (!writer.writeFloat64(speed)) {
1483 return false;
1484 }
1485 return true;
1486}
1487
1489{
1490 if (!readTag(reader)) {
1491 return false;
1492 }
1493 if (!readArgs(reader)) {
1494 return false;
1495 }
1496 return true;
1497}
1498
1500{
1501 std::string tag = reader.readTag(s_tag_len);
1502 if (reader.isError()) {
1503 return false;
1504 }
1505 if (tag != s_tag) {
1506 reader.fail();
1507 return false;
1508 }
1509 return true;
1510}
1511
1513{
1514 if (reader.noMore()) {
1515 reader.fail();
1516 return false;
1517 }
1518 if (!reader.readFloat64(speed)) {
1519 reader.fail();
1520 return false;
1521 }
1522 if (!reader.noMore()) {
1523 reader.fail();
1524 return false;
1525 }
1526 return true;
1527}
1528
1530{
1531 yarp::os::idl::WireWriter writer(connection);
1532 return write(writer);
1533}
1534
1536{
1537 yarp::os::idl::WireReader reader(connection);
1538 return read(reader);
1539}
1540
1542{
1543 if (!writer.isNull()) {
1544 if (!writer.writeListHeader(s_reply_len)) {
1545 return false;
1546 }
1547 if (!writer.write(return_helper)) {
1548 return false;
1549 }
1550 }
1551 return true;
1552}
1553
1555{
1556 if (!reader.readListReturn()) {
1557 return false;
1558 }
1559 if (reader.noMore()) {
1560 reader.fail();
1561 return false;
1562 }
1563 if (!reader.read(return_helper)) {
1564 reader.fail();
1565 return false;
1566 }
1567 return true;
1568}
1569
1574
1575// get_speed helper class implementation
1577{
1578 return cmd.write(connection);
1579}
1580
1582{
1583 return reply.read(connection);
1584}
1585
1587{
1588 yarp::os::idl::WireWriter writer(connection);
1589 if (!writer.writeListHeader(s_cmd_len)) {
1590 return false;
1591 }
1592 return write(writer);
1593}
1594
1596{
1597 yarp::os::idl::WireReader reader(connection);
1598 if (!reader.readListHeader()) {
1599 reader.fail();
1600 return false;
1601 }
1602 return read(reader);
1603}
1604
1606{
1607 if (!writeTag(writer)) {
1608 return false;
1609 }
1610 if (!writeArgs(writer)) {
1611 return false;
1612 }
1613 return true;
1614}
1615
1617{
1618 if (!writer.writeTag(s_tag, 1, s_tag_len)) {
1619 return false;
1620 }
1621 return true;
1622}
1623
1625{
1626 return true;
1627}
1628
1630{
1631 if (!readTag(reader)) {
1632 return false;
1633 }
1634 if (!readArgs(reader)) {
1635 return false;
1636 }
1637 return true;
1638}
1639
1641{
1642 std::string tag = reader.readTag(s_tag_len);
1643 if (reader.isError()) {
1644 return false;
1645 }
1646 if (tag != s_tag) {
1647 reader.fail();
1648 return false;
1649 }
1650 return true;
1651}
1652
1654{
1655 if (!reader.noMore()) {
1656 reader.fail();
1657 return false;
1658 }
1659 return true;
1660}
1661
1663{
1664 yarp::os::idl::WireWriter writer(connection);
1665 return write(writer);
1666}
1667
1669{
1670 yarp::os::idl::WireReader reader(connection);
1671 return read(reader);
1672}
1673
1675{
1676 if (!writer.isNull()) {
1677 if (!writer.writeListHeader(s_reply_len)) {
1678 return false;
1679 }
1680 if (!writer.write(return_helper)) {
1681 return false;
1682 }
1683 }
1684 return true;
1685}
1686
1688{
1689 if (!reader.readListReturn()) {
1690 return false;
1691 }
1692 if (reader.noMore()) {
1693 reader.fail();
1694 return false;
1695 }
1696 if (!reader.read(return_helper)) {
1697 reader.fail();
1698 return false;
1699 }
1700 return true;
1701}
1702
1707
1708// set_pitch helper class implementation
1713
1715{
1716 return cmd.write(connection);
1717}
1718
1720{
1721 return reply.read(connection);
1722}
1723
1725 pitch{pitch}
1726{
1727}
1728
1730{
1731 yarp::os::idl::WireWriter writer(connection);
1732 if (!writer.writeListHeader(s_cmd_len)) {
1733 return false;
1734 }
1735 return write(writer);
1736}
1737
1739{
1740 yarp::os::idl::WireReader reader(connection);
1741 if (!reader.readListHeader()) {
1742 reader.fail();
1743 return false;
1744 }
1745 return read(reader);
1746}
1747
1749{
1750 if (!writeTag(writer)) {
1751 return false;
1752 }
1753 if (!writeArgs(writer)) {
1754 return false;
1755 }
1756 return true;
1757}
1758
1760{
1761 if (!writer.writeTag(s_tag, 1, s_tag_len)) {
1762 return false;
1763 }
1764 return true;
1765}
1766
1768{
1769 if (!writer.writeFloat64(pitch)) {
1770 return false;
1771 }
1772 return true;
1773}
1774
1776{
1777 if (!readTag(reader)) {
1778 return false;
1779 }
1780 if (!readArgs(reader)) {
1781 return false;
1782 }
1783 return true;
1784}
1785
1787{
1788 std::string tag = reader.readTag(s_tag_len);
1789 if (reader.isError()) {
1790 return false;
1791 }
1792 if (tag != s_tag) {
1793 reader.fail();
1794 return false;
1795 }
1796 return true;
1797}
1798
1800{
1801 if (reader.noMore()) {
1802 reader.fail();
1803 return false;
1804 }
1805 if (!reader.readFloat64(pitch)) {
1806 reader.fail();
1807 return false;
1808 }
1809 if (!reader.noMore()) {
1810 reader.fail();
1811 return false;
1812 }
1813 return true;
1814}
1815
1817{
1818 yarp::os::idl::WireWriter writer(connection);
1819 return write(writer);
1820}
1821
1823{
1824 yarp::os::idl::WireReader reader(connection);
1825 return read(reader);
1826}
1827
1829{
1830 if (!writer.isNull()) {
1831 if (!writer.writeListHeader(s_reply_len)) {
1832 return false;
1833 }
1834 if (!writer.write(return_helper)) {
1835 return false;
1836 }
1837 }
1838 return true;
1839}
1840
1842{
1843 if (!reader.readListReturn()) {
1844 return false;
1845 }
1846 if (reader.noMore()) {
1847 reader.fail();
1848 return false;
1849 }
1850 if (!reader.read(return_helper)) {
1851 reader.fail();
1852 return false;
1853 }
1854 return true;
1855}
1856
1861
1862// get_pitch helper class implementation
1864{
1865 return cmd.write(connection);
1866}
1867
1869{
1870 return reply.read(connection);
1871}
1872
1874{
1875 yarp::os::idl::WireWriter writer(connection);
1876 if (!writer.writeListHeader(s_cmd_len)) {
1877 return false;
1878 }
1879 return write(writer);
1880}
1881
1883{
1884 yarp::os::idl::WireReader reader(connection);
1885 if (!reader.readListHeader()) {
1886 reader.fail();
1887 return false;
1888 }
1889 return read(reader);
1890}
1891
1893{
1894 if (!writeTag(writer)) {
1895 return false;
1896 }
1897 if (!writeArgs(writer)) {
1898 return false;
1899 }
1900 return true;
1901}
1902
1904{
1905 if (!writer.writeTag(s_tag, 1, s_tag_len)) {
1906 return false;
1907 }
1908 return true;
1909}
1910
1912{
1913 return true;
1914}
1915
1917{
1918 if (!readTag(reader)) {
1919 return false;
1920 }
1921 if (!readArgs(reader)) {
1922 return false;
1923 }
1924 return true;
1925}
1926
1928{
1929 std::string tag = reader.readTag(s_tag_len);
1930 if (reader.isError()) {
1931 return false;
1932 }
1933 if (tag != s_tag) {
1934 reader.fail();
1935 return false;
1936 }
1937 return true;
1938}
1939
1941{
1942 if (!reader.noMore()) {
1943 reader.fail();
1944 return false;
1945 }
1946 return true;
1947}
1948
1950{
1951 yarp::os::idl::WireWriter writer(connection);
1952 return write(writer);
1953}
1954
1956{
1957 yarp::os::idl::WireReader reader(connection);
1958 return read(reader);
1959}
1960
1962{
1963 if (!writer.isNull()) {
1964 if (!writer.writeListHeader(s_reply_len)) {
1965 return false;
1966 }
1967 if (!writer.write(return_helper)) {
1968 return false;
1969 }
1970 }
1971 return true;
1972}
1973
1975{
1976 if (!reader.readListReturn()) {
1977 return false;
1978 }
1979 if (reader.noMore()) {
1980 reader.fail();
1981 return false;
1982 }
1983 if (!reader.read(return_helper)) {
1984 reader.fail();
1985 return false;
1986 }
1987 return true;
1988}
1989
1994
1995// synthesize helper class implementation
2000
2002{
2003 return cmd.write(connection);
2004}
2005
2007{
2008 return reply.read(connection);
2009}
2010
2012 text{text}
2013{
2014}
2015
2017{
2018 yarp::os::idl::WireWriter writer(connection);
2019 if (!writer.writeListHeader(s_cmd_len)) {
2020 return false;
2021 }
2022 return write(writer);
2023}
2024
2026{
2027 yarp::os::idl::WireReader reader(connection);
2028 if (!reader.readListHeader()) {
2029 reader.fail();
2030 return false;
2031 }
2032 return read(reader);
2033}
2034
2036{
2037 if (!writeTag(writer)) {
2038 return false;
2039 }
2040 if (!writeArgs(writer)) {
2041 return false;
2042 }
2043 return true;
2044}
2045
2047{
2048 if (!writer.writeTag(s_tag, 1, s_tag_len)) {
2049 return false;
2050 }
2051 return true;
2052}
2053
2055{
2056 if (!writer.writeString(text)) {
2057 return false;
2058 }
2059 return true;
2060}
2061
2063{
2064 if (!readTag(reader)) {
2065 return false;
2066 }
2067 if (!readArgs(reader)) {
2068 return false;
2069 }
2070 return true;
2071}
2072
2074{
2075 std::string tag = reader.readTag(s_tag_len);
2076 if (reader.isError()) {
2077 return false;
2078 }
2079 if (tag != s_tag) {
2080 reader.fail();
2081 return false;
2082 }
2083 return true;
2084}
2085
2087{
2088 if (reader.noMore()) {
2089 reader.fail();
2090 return false;
2091 }
2092 if (!reader.readString(text)) {
2093 reader.fail();
2094 return false;
2095 }
2096 if (!reader.noMore()) {
2097 reader.fail();
2098 return false;
2099 }
2100 return true;
2101}
2102
2104{
2105 yarp::os::idl::WireWriter writer(connection);
2106 return write(writer);
2107}
2108
2110{
2111 yarp::os::idl::WireReader reader(connection);
2112 return read(reader);
2113}
2114
2116{
2117 if (!writer.isNull()) {
2118 if (!writer.writeListHeader(s_reply_len)) {
2119 return false;
2120 }
2121 if (!writer.write(return_helper)) {
2122 return false;
2123 }
2124 }
2125 return true;
2126}
2127
2129{
2130 if (!reader.readListReturn()) {
2131 return false;
2132 }
2133 if (reader.noMore()) {
2134 reader.fail();
2135 return false;
2136 }
2137 if (!reader.read(return_helper)) {
2138 reader.fail();
2139 return false;
2140 }
2141 return true;
2142}
2143
2148
2149// Constructor
2151{
2152 yarp().setOwner(*this);
2153}
2154
2156{
2157 if (!yarp().canWrite()) {
2159 }
2161 bool ok = yarp().write(helper, helper);
2162 if (!ok) {
2163 return_set_language failed_reply{};
2165 return failed_reply;
2166 }
2167 return helper.reply.return_helper;
2168}
2169
2171{
2172 if (!yarp().canWrite()) {
2174 }
2176 bool ok = yarp().write(helper, helper);
2177 if (!ok) {
2178 return_get_language failed_reply{};
2180 return failed_reply;
2181 }
2182 return helper.reply.return_helper;
2183}
2184
2186{
2187 if (!yarp().canWrite()) {
2188 yError("Missing server method '%s'?", ISpeechSynthesizerMsgs_set_voice_helper::s_prototype);
2189 }
2191 bool ok = yarp().write(helper, helper);
2192 if (!ok) {
2193 return_set_voice failed_reply{};
2195 return failed_reply;
2196 }
2197 return helper.reply.return_helper;
2198}
2199
2201{
2202 if (!yarp().canWrite()) {
2203 yError("Missing server method '%s'?", ISpeechSynthesizerMsgs_get_voice_helper::s_prototype);
2204 }
2206 bool ok = yarp().write(helper, helper);
2207 if (!ok) {
2208 return_get_voice failed_reply{};
2210 return failed_reply;
2211 }
2212 return helper.reply.return_helper;
2213}
2214
2216{
2217 if (!yarp().canWrite()) {
2219 }
2221 bool ok = yarp().write(helper, helper);
2222 if (!ok) {
2223 return_get_available_voices failed_reply{};
2225 return failed_reply;
2226 }
2227 return helper.reply.return_helper;
2228}
2229
2231{
2232 if (!yarp().canWrite()) {
2233 yError("Missing server method '%s'?", ISpeechSynthesizerMsgs_set_speed_helper::s_prototype);
2234 }
2236 bool ok = yarp().write(helper, helper);
2237 if (!ok) {
2238 return_set_speed failed_reply{};
2240 return failed_reply;
2241 }
2242 return helper.reply.return_helper;
2243}
2244
2246{
2247 if (!yarp().canWrite()) {
2248 yError("Missing server method '%s'?", ISpeechSynthesizerMsgs_get_speed_helper::s_prototype);
2249 }
2251 bool ok = yarp().write(helper, helper);
2252 if (!ok) {
2253 return_get_speed failed_reply{};
2255 return failed_reply;
2256 }
2257 return helper.reply.return_helper;
2258}
2259
2261{
2262 if (!yarp().canWrite()) {
2263 yError("Missing server method '%s'?", ISpeechSynthesizerMsgs_set_pitch_helper::s_prototype);
2264 }
2266 bool ok = yarp().write(helper, helper);
2267 if (!ok) {
2268 return_set_pitch failed_reply{};
2270 return failed_reply;
2271 }
2272 return helper.reply.return_helper;
2273}
2274
2276{
2277 if (!yarp().canWrite()) {
2278 yError("Missing server method '%s'?", ISpeechSynthesizerMsgs_get_pitch_helper::s_prototype);
2279 }
2281 bool ok = yarp().write(helper, helper);
2282 if (!ok) {
2283 return_get_pitch failed_reply{};
2285 return failed_reply;
2286 }
2287 return helper.reply.return_helper;
2288}
2289
2291{
2292 if (!yarp().canWrite()) {
2293 yError("Missing server method '%s'?", ISpeechSynthesizerMsgs_synthesize_helper::s_prototype);
2294 }
2296 bool ok = yarp().write(helper, helper);
2297 if (!ok) {
2298 return_synthesize failed_reply{};
2300 return failed_reply;
2301 }
2302 return helper.reply.return_helper;
2303}
2304
2305// help method
2306std::vector<std::string> ISpeechSynthesizerMsgs::help(const std::string& functionName)
2307{
2308 bool showAll = (functionName == "--all");
2309 std::vector<std::string> helpString;
2310 if (showAll) {
2311 helpString.emplace_back("*** Available commands:");
2314 helpString.emplace_back(ISpeechSynthesizerMsgs_set_voice_helper::s_tag);
2315 helpString.emplace_back(ISpeechSynthesizerMsgs_get_voice_helper::s_tag);
2317 helpString.emplace_back(ISpeechSynthesizerMsgs_set_speed_helper::s_tag);
2318 helpString.emplace_back(ISpeechSynthesizerMsgs_get_speed_helper::s_tag);
2319 helpString.emplace_back(ISpeechSynthesizerMsgs_set_pitch_helper::s_tag);
2320 helpString.emplace_back(ISpeechSynthesizerMsgs_get_pitch_helper::s_tag);
2321 helpString.emplace_back(ISpeechSynthesizerMsgs_synthesize_helper::s_tag);
2322 helpString.emplace_back("help");
2323 } else {
2326 }
2329 }
2332 }
2335 }
2338 }
2341 }
2344 }
2347 }
2350 }
2353 }
2354 if (functionName == "help") {
2355 helpString.emplace_back("std::vector<std::string> help(const std::string& functionName = \"--all\")");
2356 helpString.emplace_back("Return list of available commands, or help message for a specific function");
2357 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");
2358 helpString.emplace_back("@return list of strings (one string per line)");
2359 }
2360 }
2361 if (helpString.empty()) {
2362 helpString.emplace_back("Command not found");
2363 }
2364 return helpString;
2365}
2366
2367// read from ConnectionReader
2369{
2370 constexpr size_t max_tag_len = 3;
2371 size_t tag_len = 1;
2372
2373 yarp::os::idl::WireReader reader(connection);
2374 reader.expectAccept();
2375 if (!reader.readListHeader()) {
2376 reader.fail();
2377 return false;
2378 }
2379
2380 std::string tag = reader.readTag(1);
2381 bool direct = (tag == "__direct__");
2382 if (direct) {
2383 tag = reader.readTag(1);
2384 }
2385 while (tag_len <= max_tag_len && !reader.isError()) {
2386 if(tag == "getRemoteProtocolVersion") {
2387 if (!reader.noMore()) {
2388 yError("Reader invalid protocol?! %s:%d - %s", __FILE__, __LINE__, __YFUNCTION__);
2389 reader.fail();
2390 return false;
2391 }
2392
2393 auto proto = getLocalProtocolVersion();
2394
2395 yarp::os::idl::WireWriter writer(reader);
2396 if (!writer.writeListHeader(1)) {
2397 yWarning("Writer invalid protocol?! %s:%d - %s", __FILE__, __LINE__, __YFUNCTION__);
2398 return false;}
2399 if (!writer.write(proto)) {
2400 yWarning("Writer invalid protocol?! %s:%d - %s", __FILE__, __LINE__, __YFUNCTION__);
2401 return false;
2402 }
2403 reader.accept();
2404 return true;
2405 }
2408 if (!helper.cmd.readArgs(reader)) {
2409 return false;
2410 }
2411
2412 helper.call(this);
2413
2414 yarp::os::idl::WireWriter writer(reader);
2415 if (!helper.reply.write(writer)) {
2416 return false;
2417 }
2418 reader.accept();
2419 return true;
2420 }
2423 if (!helper.cmd.readArgs(reader)) {
2424 return false;
2425 }
2426
2427 helper.call(this);
2428
2429 yarp::os::idl::WireWriter writer(reader);
2430 if (!helper.reply.write(writer)) {
2431 return false;
2432 }
2433 reader.accept();
2434 return true;
2435 }
2438 if (!helper.cmd.readArgs(reader)) {
2439 return false;
2440 }
2441
2442 helper.call(this);
2443
2444 yarp::os::idl::WireWriter writer(reader);
2445 if (!helper.reply.write(writer)) {
2446 return false;
2447 }
2448 reader.accept();
2449 return true;
2450 }
2453 if (!helper.cmd.readArgs(reader)) {
2454 return false;
2455 }
2456
2457 helper.call(this);
2458
2459 yarp::os::idl::WireWriter writer(reader);
2460 if (!helper.reply.write(writer)) {
2461 return false;
2462 }
2463 reader.accept();
2464 return true;
2465 }
2468 if (!helper.cmd.readArgs(reader)) {
2469 return false;
2470 }
2471
2472 helper.call(this);
2473
2474 yarp::os::idl::WireWriter writer(reader);
2475 if (!helper.reply.write(writer)) {
2476 return false;
2477 }
2478 reader.accept();
2479 return true;
2480 }
2483 if (!helper.cmd.readArgs(reader)) {
2484 return false;
2485 }
2486
2487 helper.call(this);
2488
2489 yarp::os::idl::WireWriter writer(reader);
2490 if (!helper.reply.write(writer)) {
2491 return false;
2492 }
2493 reader.accept();
2494 return true;
2495 }
2498 if (!helper.cmd.readArgs(reader)) {
2499 return false;
2500 }
2501
2502 helper.call(this);
2503
2504 yarp::os::idl::WireWriter writer(reader);
2505 if (!helper.reply.write(writer)) {
2506 return false;
2507 }
2508 reader.accept();
2509 return true;
2510 }
2513 if (!helper.cmd.readArgs(reader)) {
2514 return false;
2515 }
2516
2517 helper.call(this);
2518
2519 yarp::os::idl::WireWriter writer(reader);
2520 if (!helper.reply.write(writer)) {
2521 return false;
2522 }
2523 reader.accept();
2524 return true;
2525 }
2528 if (!helper.cmd.readArgs(reader)) {
2529 return false;
2530 }
2531
2532 helper.call(this);
2533
2534 yarp::os::idl::WireWriter writer(reader);
2535 if (!helper.reply.write(writer)) {
2536 return false;
2537 }
2538 reader.accept();
2539 return true;
2540 }
2543 if (!helper.cmd.readArgs(reader)) {
2544 return false;
2545 }
2546
2547 helper.call(this);
2548
2549 yarp::os::idl::WireWriter writer(reader);
2550 if (!helper.reply.write(writer)) {
2551 return false;
2552 }
2553 reader.accept();
2554 return true;
2555 }
2556 if (tag == "help") {
2557 std::string functionName;
2558 if (!reader.readString(functionName)) {
2559 functionName = "--all";
2560 }
2561 auto help_strings = help(functionName);
2562 yarp::os::idl::WireWriter writer(reader);
2563 if (!writer.isNull()) {
2564 if (!writer.writeListHeader(2)) {
2565 return false;
2566 }
2567 if (!writer.writeTag("many", 1, 0)) {
2568 return false;
2569 }
2570 if (!writer.writeListBegin(0, help_strings.size())) {
2571 return false;
2572 }
2573 for (const auto& help_string : help_strings) {
2574 if (!writer.writeString(help_string)) {
2575 return false;
2576 }
2577 }
2578 if (!writer.writeListEnd()) {
2579 return false;
2580 }
2581 }
2582 reader.accept();
2583 return true;
2584 }
2585 if (reader.noMore()) {
2586 reader.fail();
2587 return false;
2588 }
2589 std::string next_tag = reader.readTag(1);
2590 if (next_tag.empty()) {
2591 break;
2592 }
2593 tag.append("_").append(next_tag);
2594 tag_len = std::count(tag.begin(), tag.end(), '_') + 1;
2595 }
2596 return false;
2597}
#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 read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
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 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 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 writeTag(const yarp::os::idl::WireWriter &writer) const
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 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 writeArgs(const yarp::os::idl::WireWriter &writer) const
bool writeTag(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 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 writeArgs(const yarp::os::idl::WireWriter &writer) const
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 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 read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
bool writeTag(const yarp::os::idl::WireWriter &writer) const
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 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 write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
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 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.
return_set_language(*)(const std::string &) funcptr_t
bool writeTag(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 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.
return_set_pitch(*)(const double) funcptr_t
bool writeArgs(const yarp::os::idl::WireWriter &writer) const
bool writeTag(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 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.
return_set_speed(*)(const double) 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 write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
bool writeTag(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 read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
return_set_voice(*)(const std::string &) 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 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 writeTag(const yarp::os::idl::WireWriter &writer) const
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.
return_synthesize(*)(const std::string &) funcptr_t
virtual return_set_speed set_speed(const double speed)
virtual return_get_speed get_speed()
virtual return_set_pitch set_pitch(const double pitch)
virtual return_synthesize synthesize(const std::string &text)
virtual yarp::os::ApplicationNetworkProtocolVersion getLocalProtocolVersion()
virtual std::vector< std::string > help(const std::string &functionName="--all")
virtual return_get_pitch get_pitch()
virtual return_get_language get_language()
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
virtual return_get_voice get_voice()
virtual return_set_language set_language(const std::string &language)
virtual return_set_voice set_voice(const std::string &voice)
virtual return_get_available_voices get_available_voices()
virtual yarp::os::ApplicationNetworkProtocolVersion getRemoteProtocolVersion()
yarp::dev::ReturnValue ret
yarp::dev::ReturnValue ret
yarp::dev::ReturnValue ret
yarp::dev::ReturnValue ret
yarp::dev::ReturnValue ret
yarp::dev::ReturnValue ret
yarp::dev::ReturnValue ret
yarp::dev::ReturnValue ret
yarp::dev::ReturnValue ret
@ return_value_error_nws_nwc_communication_error
Method is not (yet) implemented.
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)
std::string readTag(size_t len=static_cast< size_t >(-1))
bool read(WirePortable &obj)
bool readFloat64(yarp::conf::float64_t &x)
IDL-friendly connection writer.
Definition WireWriter.h:28
bool write(const WirePortable &obj) const
bool writeListHeader(int len) const
bool writeTag(const char *tag, int split, int len) const
bool writeFloat64(yarp::conf::float64_t x, bool skip_tag=false) const
bool writeString(const std::string &str, bool skip_tag=false) const
bool writeListBegin(int tag, 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