YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
IAudioGrabberMsgs.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5
6// Autogenerated by Thrift Compiler (0.14.1-yarped)
7//
8// This is an automatically generated file.
9// It could get re-generated if the ALLOW_IDL_GENERATION flag is on.
10
11#include <yarp/conf/version.h>
12#include <IAudioGrabberMsgs.h>
14#include <yarp/os/LogStream.h>
15
17
18#include <algorithm>
19
20namespace
21{
22 YARP_LOG_COMPONENT(SERVICE_LOG_COMPONENT, "IAudioGrabberMsgs")
23}
24
25//IAudioGrabberMsgs_getRemoteProtocolVersion_helper declaration
36
38{
39 yarp::os::idl::WireWriter writer(connection);
40 if (!writer.writeListHeader(1)) {
41 return false;
42 }
43 if (!writer.writeString("getRemoteProtocolVersion")) {
44 return false;
45 }
46 return true;
47}
48
49bool IAudioGrabberMsgs_getRemoteProtocolVersion_helper ::read(yarp::os::ConnectionReader & connection)
50 {
51 yarp::os::idl::WireReader reader(connection);
52 if (!reader.readListHeader()) {
53 reader.fail();
54 return false;
55 }
56
57 if (!helper_proto.read(connection)) {
58 reader.fail();
59 return false;
60 }
61 return true;
62}
63
64//ProtocolVersion, client side
66 {
67 if(!yarp().canWrite()) {
68 yError(" Missing server method IAudioGrabberMsgs::getRemoteProtocolVersion");
69 }
71 bool ok = yarp().write(helper, helper);
72 if (ok) {
73 return helper.helper_proto;}
74 else {
76 return failureproto;}
77}
78
79//ProtocolVersion, client side
81 {
82 auto locproto = this->getLocalProtocolVersion();
83 auto remproto = this->getRemoteProtocolVersion();
84 if (remproto.protocol_version != locproto.protocol_version)
85 {
86 yCError(SERVICE_LOG_COMPONENT) << "Invalid communication protocol.";
87 yCError(SERVICE_LOG_COMPONENT) << "Local Protocol Version: " << locproto.toString();
88 yCError(SERVICE_LOG_COMPONENT) << "Remote Protocol Version: " << remproto.toString();
89 return false;
90 }
91 return true;
92}
93
94//ProtocolVersion, server side
96{
98 //myproto.protocol_version using default value = 0
99 //to change this value add the following line to the .thrift file:
100 //const i16 protocol_version = <your_number_here>
101 myproto.protocol_version = 0;
105 return myproto;
106}
107
108// setHWGain_RPC helper class declaration
110 public yarp::os::Portable
111{
112public:
114 explicit IAudioGrabberMsgs_setHWGain_RPC_helper(const double gain);
115 bool write(yarp::os::ConnectionWriter& connection) const override;
116 bool read(yarp::os::ConnectionReader& connection) override;
117
118 class Command :
120 {
121 public:
122 Command() = default;
123 explicit Command(const double gain);
124
125 ~Command() override = default;
126
127 bool write(yarp::os::ConnectionWriter& connection) const override;
128 bool read(yarp::os::ConnectionReader& connection) override;
129
130 bool write(const yarp::os::idl::WireWriter& writer) const override;
131 bool writeTag(const yarp::os::idl::WireWriter& writer) const;
132 bool writeArgs(const yarp::os::idl::WireWriter& writer) const;
133
134 bool read(yarp::os::idl::WireReader& reader) override;
137
138 double gain{0.0};
139 };
140
141 class Reply :
143 {
144 public:
145 Reply() = default;
146 ~Reply() override = default;
147
148 bool write(yarp::os::ConnectionWriter& connection) const override;
149 bool read(yarp::os::ConnectionReader& connection) override;
150
151 bool write(const yarp::os::idl::WireWriter& writer) const override;
152 bool read(yarp::os::idl::WireReader& reader) override;
153
155 };
156
157 using funcptr_t = yarp::dev::ReturnValue (*)(const double);
158 void call(IAudioGrabberMsgs* ptr);
159
162
163 static constexpr const char* s_tag{"setHWGain_RPC"};
164 static constexpr size_t s_tag_len{2};
165 static constexpr size_t s_cmd_len{3};
166 static constexpr size_t s_reply_len{1};
167 static constexpr const char* s_prototype{"yarp::dev::ReturnValue IAudioGrabberMsgs::setHWGain_RPC(const double gain)"};
168 static constexpr const char* s_help{""};
169};
170
171// setSWGain_RPC helper class declaration
173 public yarp::os::Portable
174{
175public:
177 explicit IAudioGrabberMsgs_setSWGain_RPC_helper(const double gain);
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 explicit Command(const double gain);
187
188 ~Command() override = default;
189
190 bool write(yarp::os::ConnectionWriter& connection) const override;
191 bool read(yarp::os::ConnectionReader& connection) override;
192
193 bool write(const yarp::os::idl::WireWriter& writer) const override;
194 bool writeTag(const yarp::os::idl::WireWriter& writer) const;
195 bool writeArgs(const yarp::os::idl::WireWriter& writer) const;
196
197 bool read(yarp::os::idl::WireReader& reader) override;
200
201 double gain{0.0};
202 };
203
204 class Reply :
206 {
207 public:
208 Reply() = default;
209 ~Reply() override = default;
210
211 bool write(yarp::os::ConnectionWriter& connection) const override;
212 bool read(yarp::os::ConnectionReader& connection) override;
213
214 bool write(const yarp::os::idl::WireWriter& writer) const override;
215 bool read(yarp::os::idl::WireReader& reader) override;
216
218 };
219
220 using funcptr_t = yarp::dev::ReturnValue (*)(const double);
221 void call(IAudioGrabberMsgs* ptr);
222
225
226 static constexpr const char* s_tag{"setSWGain_RPC"};
227 static constexpr size_t s_tag_len{2};
228 static constexpr size_t s_cmd_len{3};
229 static constexpr size_t s_reply_len{1};
230 static constexpr const char* s_prototype{"yarp::dev::ReturnValue IAudioGrabberMsgs::setSWGain_RPC(const double gain)"};
231 static constexpr const char* s_help{""};
232};
233
234// resetRecordingAudioBuffer_RPC helper class declaration
236 public yarp::os::Portable
237{
238public:
240 bool write(yarp::os::ConnectionWriter& connection) const override;
241 bool read(yarp::os::ConnectionReader& connection) override;
242
243 class Command :
245 {
246 public:
247 Command() = default;
248 ~Command() override = default;
249
250 bool write(yarp::os::ConnectionWriter& connection) const override;
251 bool read(yarp::os::ConnectionReader& connection) override;
252
253 bool write(const yarp::os::idl::WireWriter& writer) const override;
254 bool writeTag(const yarp::os::idl::WireWriter& writer) const;
255 bool writeArgs(const yarp::os::idl::WireWriter& writer) const;
256
257 bool read(yarp::os::idl::WireReader& reader) override;
260 };
261
262 class Reply :
264 {
265 public:
266 Reply() = default;
267 ~Reply() override = default;
268
269 bool write(yarp::os::ConnectionWriter& connection) const override;
270 bool read(yarp::os::ConnectionReader& connection) override;
271
272 bool write(const yarp::os::idl::WireWriter& writer) const override;
273 bool read(yarp::os::idl::WireReader& reader) override;
274
276 };
277
279 void call(IAudioGrabberMsgs* ptr);
280
283
284 static constexpr const char* s_tag{"resetRecordingAudioBuffer_RPC"};
285 static constexpr size_t s_tag_len{2};
286 static constexpr size_t s_cmd_len{2};
287 static constexpr size_t s_reply_len{1};
288 static constexpr const char* s_prototype{"yarp::dev::ReturnValue IAudioGrabberMsgs::resetRecordingAudioBuffer_RPC()"};
289 static constexpr const char* s_help{""};
290};
291
292// startRecording_RPC helper class declaration
294 public yarp::os::Portable
295{
296public:
298 bool write(yarp::os::ConnectionWriter& connection) const override;
299 bool read(yarp::os::ConnectionReader& connection) override;
300
301 class Command :
303 {
304 public:
305 Command() = default;
306 ~Command() override = default;
307
308 bool write(yarp::os::ConnectionWriter& connection) const override;
309 bool read(yarp::os::ConnectionReader& connection) override;
310
311 bool write(const yarp::os::idl::WireWriter& writer) const override;
312 bool writeTag(const yarp::os::idl::WireWriter& writer) const;
313 bool writeArgs(const yarp::os::idl::WireWriter& writer) const;
314
315 bool read(yarp::os::idl::WireReader& reader) override;
318 };
319
320 class Reply :
322 {
323 public:
324 Reply() = default;
325 ~Reply() override = default;
326
327 bool write(yarp::os::ConnectionWriter& connection) const override;
328 bool read(yarp::os::ConnectionReader& connection) override;
329
330 bool write(const yarp::os::idl::WireWriter& writer) const override;
331 bool read(yarp::os::idl::WireReader& reader) override;
332
334 };
335
337 void call(IAudioGrabberMsgs* ptr);
338
341
342 static constexpr const char* s_tag{"startRecording_RPC"};
343 static constexpr size_t s_tag_len{2};
344 static constexpr size_t s_cmd_len{2};
345 static constexpr size_t s_reply_len{1};
346 static constexpr const char* s_prototype{"yarp::dev::ReturnValue IAudioGrabberMsgs::startRecording_RPC()"};
347 static constexpr const char* s_help{""};
348};
349
350// stopRecording_RPC helper class declaration
352 public yarp::os::Portable
353{
354public:
356 bool write(yarp::os::ConnectionWriter& connection) const override;
357 bool read(yarp::os::ConnectionReader& connection) override;
358
359 class Command :
361 {
362 public:
363 Command() = default;
364 ~Command() override = default;
365
366 bool write(yarp::os::ConnectionWriter& connection) const override;
367 bool read(yarp::os::ConnectionReader& connection) override;
368
369 bool write(const yarp::os::idl::WireWriter& writer) const override;
370 bool writeTag(const yarp::os::idl::WireWriter& writer) const;
371 bool writeArgs(const yarp::os::idl::WireWriter& writer) const;
372
373 bool read(yarp::os::idl::WireReader& reader) override;
376 };
377
378 class Reply :
380 {
381 public:
382 Reply() = default;
383 ~Reply() override = default;
384
385 bool write(yarp::os::ConnectionWriter& connection) const override;
386 bool read(yarp::os::ConnectionReader& connection) override;
387
388 bool write(const yarp::os::idl::WireWriter& writer) const override;
389 bool read(yarp::os::idl::WireReader& reader) override;
390
392 };
393
395 void call(IAudioGrabberMsgs* ptr);
396
399
400 static constexpr const char* s_tag{"stopRecording_RPC"};
401 static constexpr size_t s_tag_len{2};
402 static constexpr size_t s_cmd_len{2};
403 static constexpr size_t s_reply_len{1};
404 static constexpr const char* s_prototype{"yarp::dev::ReturnValue IAudioGrabberMsgs::stopRecording_RPC()"};
405 static constexpr const char* s_help{""};
406};
407
408// isRecording_RPC helper class declaration
410 public yarp::os::Portable
411{
412public:
414 bool write(yarp::os::ConnectionWriter& connection) const override;
415 bool read(yarp::os::ConnectionReader& connection) override;
416
417 class Command :
419 {
420 public:
421 Command() = default;
422 ~Command() override = default;
423
424 bool write(yarp::os::ConnectionWriter& connection) const override;
425 bool read(yarp::os::ConnectionReader& connection) override;
426
427 bool write(const yarp::os::idl::WireWriter& writer) const override;
428 bool writeTag(const yarp::os::idl::WireWriter& writer) const;
429 bool writeArgs(const yarp::os::idl::WireWriter& writer) const;
430
431 bool read(yarp::os::idl::WireReader& reader) override;
434 };
435
436 class Reply :
438 {
439 public:
440 Reply() = default;
441 ~Reply() override = default;
442
443 bool write(yarp::os::ConnectionWriter& connection) const override;
444 bool read(yarp::os::ConnectionReader& connection) override;
445
446 bool write(const yarp::os::idl::WireWriter& writer) const override;
447 bool read(yarp::os::idl::WireReader& reader) override;
448
450 };
451
453 void call(IAudioGrabberMsgs* ptr);
454
457
458 static constexpr const char* s_tag{"isRecording_RPC"};
459 static constexpr size_t s_tag_len{2};
460 static constexpr size_t s_cmd_len{2};
461 static constexpr size_t s_reply_len{2};
462 static constexpr const char* s_prototype{"return_isRecording IAudioGrabberMsgs::isRecording_RPC()"};
463 static constexpr const char* s_help{""};
464};
465
466// getSound_RPC helper class declaration
468 public yarp::os::Portable
469{
470public:
472 IAudioGrabberMsgs_getSound_RPC_helper(const size_t min_number_of_samples, const size_t max_number_of_samples, const double max_samples_timeout_s);
473 bool write(yarp::os::ConnectionWriter& connection) const override;
474 bool read(yarp::os::ConnectionReader& connection) override;
475
476 class Command :
478 {
479 public:
480 Command() = default;
481 Command(const size_t min_number_of_samples, const size_t max_number_of_samples, const double max_samples_timeout_s);
482
483 ~Command() override = default;
484
485 bool write(yarp::os::ConnectionWriter& connection) const override;
486 bool read(yarp::os::ConnectionReader& connection) override;
487
488 bool write(const yarp::os::idl::WireWriter& writer) const override;
489 bool writeTag(const yarp::os::idl::WireWriter& writer) const;
490 bool writeArgs(const yarp::os::idl::WireWriter& writer) const;
491
492 bool read(yarp::os::idl::WireReader& reader) override;
495
499 };
500
501 class Reply :
503 {
504 public:
505 Reply() = default;
506 ~Reply() override = default;
507
508 bool write(yarp::os::ConnectionWriter& connection) const override;
509 bool read(yarp::os::ConnectionReader& connection) override;
510
511 bool write(const yarp::os::idl::WireWriter& writer) const override;
512 bool read(yarp::os::idl::WireReader& reader) override;
513
515 };
516
517 using funcptr_t = return_getSound (*)(const size_t, const size_t, const double);
518 void call(IAudioGrabberMsgs* ptr);
519
522
523 static constexpr const char* s_tag{"getSound_RPC"};
524 static constexpr size_t s_tag_len{2};
525 static constexpr size_t s_cmd_len{5};
526 static constexpr size_t s_reply_len{2};
527 static constexpr const char* s_prototype{"return_getSound IAudioGrabberMsgs::getSound_RPC(const size_t min_number_of_samples, const size_t max_number_of_samples, const double max_samples_timeout_s)"};
528 static constexpr const char* s_help{""};
529};
530
531// getRecordingAudioBufferMaxSize_RPC helper class declaration
533 public yarp::os::Portable
534{
535public:
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 ~Command() override = default;
546
547 bool write(yarp::os::ConnectionWriter& connection) const override;
548 bool read(yarp::os::ConnectionReader& connection) override;
549
550 bool write(const yarp::os::idl::WireWriter& writer) const override;
551 bool writeTag(const yarp::os::idl::WireWriter& writer) const;
552 bool writeArgs(const yarp::os::idl::WireWriter& writer) const;
553
554 bool read(yarp::os::idl::WireReader& reader) override;
557 };
558
559 class Reply :
561 {
562 public:
563 Reply() = default;
564 ~Reply() override = default;
565
566 bool write(yarp::os::ConnectionWriter& connection) const override;
567 bool read(yarp::os::ConnectionReader& connection) override;
568
569 bool write(const yarp::os::idl::WireWriter& writer) const override;
570 bool read(yarp::os::idl::WireReader& reader) override;
571
573 };
574
576 void call(IAudioGrabberMsgs* ptr);
577
580
581 static constexpr const char* s_tag{"getRecordingAudioBufferMaxSize_RPC"};
582 static constexpr size_t s_tag_len{2};
583 static constexpr size_t s_cmd_len{2};
584 static constexpr size_t s_reply_len{2};
585 static constexpr const char* s_prototype{"return_getRecordingAudioBufferMaxSize IAudioGrabberMsgs::getRecordingAudioBufferMaxSize_RPC()"};
586 static constexpr const char* s_help{""};
587};
588
589// getRecordingAudioBufferCurrentSize_RPC helper class declaration
591 public yarp::os::Portable
592{
593public:
595 bool write(yarp::os::ConnectionWriter& connection) const override;
596 bool read(yarp::os::ConnectionReader& connection) override;
597
598 class Command :
600 {
601 public:
602 Command() = default;
603 ~Command() override = default;
604
605 bool write(yarp::os::ConnectionWriter& connection) const override;
606 bool read(yarp::os::ConnectionReader& connection) override;
607
608 bool write(const yarp::os::idl::WireWriter& writer) const override;
609 bool writeTag(const yarp::os::idl::WireWriter& writer) const;
610 bool writeArgs(const yarp::os::idl::WireWriter& writer) const;
611
612 bool read(yarp::os::idl::WireReader& reader) override;
615 };
616
617 class Reply :
619 {
620 public:
621 Reply() = default;
622 ~Reply() override = default;
623
624 bool write(yarp::os::ConnectionWriter& connection) const override;
625 bool read(yarp::os::ConnectionReader& connection) override;
626
627 bool write(const yarp::os::idl::WireWriter& writer) const override;
628 bool read(yarp::os::idl::WireReader& reader) override;
629
631 };
632
634 void call(IAudioGrabberMsgs* ptr);
635
638
639 static constexpr const char* s_tag{"getRecordingAudioBufferCurrentSize_RPC"};
640 static constexpr size_t s_tag_len{2};
641 static constexpr size_t s_cmd_len{2};
642 static constexpr size_t s_reply_len{2};
643 static constexpr const char* s_prototype{"return_getRecordingAudioBufferCurrentSize IAudioGrabberMsgs::getRecordingAudioBufferCurrentSize_RPC()"};
644 static constexpr const char* s_help{""};
645};
646
647// setHWGain_RPC helper class implementation
652
654{
655 return cmd.write(connection);
656}
657
659{
660 return reply.read(connection);
661}
662
664 gain{gain}
665{
666}
667
669{
670 yarp::os::idl::WireWriter writer(connection);
671 if (!writer.writeListHeader(s_cmd_len)) {
672 return false;
673 }
674 return write(writer);
675}
676
678{
679 yarp::os::idl::WireReader reader(connection);
680 if (!reader.readListHeader()) {
681 reader.fail();
682 return false;
683 }
684 return read(reader);
685}
686
688{
689 if (!writeTag(writer)) {
690 return false;
691 }
692 if (!writeArgs(writer)) {
693 return false;
694 }
695 return true;
696}
697
699{
700 if (!writer.writeTag(s_tag, 1, s_tag_len)) {
701 return false;
702 }
703 return true;
704}
705
707{
708 if (!writer.writeFloat64(gain)) {
709 return false;
710 }
711 return true;
712}
713
715{
716 if (!readTag(reader)) {
717 return false;
718 }
719 if (!readArgs(reader)) {
720 return false;
721 }
722 return true;
723}
724
726{
727 std::string tag = reader.readTag(s_tag_len);
728 if (reader.isError()) {
729 return false;
730 }
731 if (tag != s_tag) {
732 reader.fail();
733 return false;
734 }
735 return true;
736}
737
739{
740 if (reader.noMore()) {
741 reader.fail();
742 return false;
743 }
744 if (!reader.readFloat64(gain)) {
745 reader.fail();
746 return false;
747 }
748 if (!reader.noMore()) {
749 reader.fail();
750 return false;
751 }
752 return true;
753}
754
756{
757 yarp::os::idl::WireWriter writer(connection);
758 return write(writer);
759}
760
762{
763 yarp::os::idl::WireReader reader(connection);
764 return read(reader);
765}
766
768{
769 if (!writer.isNull()) {
770 if (!writer.write(return_helper)) {
771 return false;
772 }
773 }
774 return true;
775}
776
778{
779 if (reader.noMore()) {
780 reader.fail();
781 return false;
782 }
783 if (!reader.read(return_helper)) {
784 reader.fail();
785 return false;
786 }
787 return true;
788}
789
794
795// setSWGain_RPC helper class implementation
800
802{
803 return cmd.write(connection);
804}
805
807{
808 return reply.read(connection);
809}
810
812 gain{gain}
813{
814}
815
817{
818 yarp::os::idl::WireWriter writer(connection);
819 if (!writer.writeListHeader(s_cmd_len)) {
820 return false;
821 }
822 return write(writer);
823}
824
826{
827 yarp::os::idl::WireReader reader(connection);
828 if (!reader.readListHeader()) {
829 reader.fail();
830 return false;
831 }
832 return read(reader);
833}
834
836{
837 if (!writeTag(writer)) {
838 return false;
839 }
840 if (!writeArgs(writer)) {
841 return false;
842 }
843 return true;
844}
845
847{
848 if (!writer.writeTag(s_tag, 1, s_tag_len)) {
849 return false;
850 }
851 return true;
852}
853
855{
856 if (!writer.writeFloat64(gain)) {
857 return false;
858 }
859 return true;
860}
861
863{
864 if (!readTag(reader)) {
865 return false;
866 }
867 if (!readArgs(reader)) {
868 return false;
869 }
870 return true;
871}
872
874{
875 std::string tag = reader.readTag(s_tag_len);
876 if (reader.isError()) {
877 return false;
878 }
879 if (tag != s_tag) {
880 reader.fail();
881 return false;
882 }
883 return true;
884}
885
887{
888 if (reader.noMore()) {
889 reader.fail();
890 return false;
891 }
892 if (!reader.readFloat64(gain)) {
893 reader.fail();
894 return false;
895 }
896 if (!reader.noMore()) {
897 reader.fail();
898 return false;
899 }
900 return true;
901}
902
904{
905 yarp::os::idl::WireWriter writer(connection);
906 return write(writer);
907}
908
910{
911 yarp::os::idl::WireReader reader(connection);
912 return read(reader);
913}
914
916{
917 if (!writer.isNull()) {
918 if (!writer.write(return_helper)) {
919 return false;
920 }
921 }
922 return true;
923}
924
926{
927 if (reader.noMore()) {
928 reader.fail();
929 return false;
930 }
931 if (!reader.read(return_helper)) {
932 reader.fail();
933 return false;
934 }
935 return true;
936}
937
942
943// resetRecordingAudioBuffer_RPC helper class implementation
948
953
955{
956 yarp::os::idl::WireWriter writer(connection);
957 if (!writer.writeListHeader(s_cmd_len)) {
958 return false;
959 }
960 return write(writer);
961}
962
964{
965 yarp::os::idl::WireReader reader(connection);
966 if (!reader.readListHeader()) {
967 reader.fail();
968 return false;
969 }
970 return read(reader);
971}
972
974{
975 if (!writeTag(writer)) {
976 return false;
977 }
978 if (!writeArgs(writer)) {
979 return false;
980 }
981 return true;
982}
983
985{
986 if (!writer.writeTag(s_tag, 1, s_tag_len)) {
987 return false;
988 }
989 return true;
990}
991
993{
994 return true;
995}
996
998{
999 if (!readTag(reader)) {
1000 return false;
1001 }
1002 if (!readArgs(reader)) {
1003 return false;
1004 }
1005 return true;
1006}
1007
1009{
1010 std::string tag = reader.readTag(s_tag_len);
1011 if (reader.isError()) {
1012 return false;
1013 }
1014 if (tag != s_tag) {
1015 reader.fail();
1016 return false;
1017 }
1018 return true;
1019}
1020
1022{
1023 if (!reader.noMore()) {
1024 reader.fail();
1025 return false;
1026 }
1027 return true;
1028}
1029
1031{
1032 yarp::os::idl::WireWriter writer(connection);
1033 return write(writer);
1034}
1035
1041
1043{
1044 if (!writer.isNull()) {
1045 if (!writer.write(return_helper)) {
1046 return false;
1047 }
1048 }
1049 return true;
1050}
1051
1053{
1054 if (reader.noMore()) {
1055 reader.fail();
1056 return false;
1057 }
1058 if (!reader.read(return_helper)) {
1059 reader.fail();
1060 return false;
1061 }
1062 return true;
1063}
1064
1069
1070// startRecording_RPC helper class implementation
1072{
1073 return cmd.write(connection);
1074}
1075
1080
1082{
1083 yarp::os::idl::WireWriter writer(connection);
1084 if (!writer.writeListHeader(s_cmd_len)) {
1085 return false;
1086 }
1087 return write(writer);
1088}
1089
1091{
1092 yarp::os::idl::WireReader reader(connection);
1093 if (!reader.readListHeader()) {
1094 reader.fail();
1095 return false;
1096 }
1097 return read(reader);
1098}
1099
1101{
1102 if (!writeTag(writer)) {
1103 return false;
1104 }
1105 if (!writeArgs(writer)) {
1106 return false;
1107 }
1108 return true;
1109}
1110
1112{
1113 if (!writer.writeTag(s_tag, 1, s_tag_len)) {
1114 return false;
1115 }
1116 return true;
1117}
1118
1120{
1121 return true;
1122}
1123
1125{
1126 if (!readTag(reader)) {
1127 return false;
1128 }
1129 if (!readArgs(reader)) {
1130 return false;
1131 }
1132 return true;
1133}
1134
1136{
1137 std::string tag = reader.readTag(s_tag_len);
1138 if (reader.isError()) {
1139 return false;
1140 }
1141 if (tag != s_tag) {
1142 reader.fail();
1143 return false;
1144 }
1145 return true;
1146}
1147
1149{
1150 if (!reader.noMore()) {
1151 reader.fail();
1152 return false;
1153 }
1154 return true;
1155}
1156
1158{
1159 yarp::os::idl::WireWriter writer(connection);
1160 return write(writer);
1161}
1162
1164{
1165 yarp::os::idl::WireReader reader(connection);
1166 return read(reader);
1167}
1168
1170{
1171 if (!writer.isNull()) {
1172 if (!writer.write(return_helper)) {
1173 return false;
1174 }
1175 }
1176 return true;
1177}
1178
1180{
1181 if (reader.noMore()) {
1182 reader.fail();
1183 return false;
1184 }
1185 if (!reader.read(return_helper)) {
1186 reader.fail();
1187 return false;
1188 }
1189 return true;
1190}
1191
1196
1197// stopRecording_RPC helper class implementation
1199{
1200 return cmd.write(connection);
1201}
1202
1204{
1205 return reply.read(connection);
1206}
1207
1209{
1210 yarp::os::idl::WireWriter writer(connection);
1211 if (!writer.writeListHeader(s_cmd_len)) {
1212 return false;
1213 }
1214 return write(writer);
1215}
1216
1218{
1219 yarp::os::idl::WireReader reader(connection);
1220 if (!reader.readListHeader()) {
1221 reader.fail();
1222 return false;
1223 }
1224 return read(reader);
1225}
1226
1228{
1229 if (!writeTag(writer)) {
1230 return false;
1231 }
1232 if (!writeArgs(writer)) {
1233 return false;
1234 }
1235 return true;
1236}
1237
1239{
1240 if (!writer.writeTag(s_tag, 1, s_tag_len)) {
1241 return false;
1242 }
1243 return true;
1244}
1245
1247{
1248 return true;
1249}
1250
1252{
1253 if (!readTag(reader)) {
1254 return false;
1255 }
1256 if (!readArgs(reader)) {
1257 return false;
1258 }
1259 return true;
1260}
1261
1263{
1264 std::string tag = reader.readTag(s_tag_len);
1265 if (reader.isError()) {
1266 return false;
1267 }
1268 if (tag != s_tag) {
1269 reader.fail();
1270 return false;
1271 }
1272 return true;
1273}
1274
1276{
1277 if (!reader.noMore()) {
1278 reader.fail();
1279 return false;
1280 }
1281 return true;
1282}
1283
1285{
1286 yarp::os::idl::WireWriter writer(connection);
1287 return write(writer);
1288}
1289
1291{
1292 yarp::os::idl::WireReader reader(connection);
1293 return read(reader);
1294}
1295
1297{
1298 if (!writer.isNull()) {
1299 if (!writer.write(return_helper)) {
1300 return false;
1301 }
1302 }
1303 return true;
1304}
1305
1307{
1308 if (reader.noMore()) {
1309 reader.fail();
1310 return false;
1311 }
1312 if (!reader.read(return_helper)) {
1313 reader.fail();
1314 return false;
1315 }
1316 return true;
1317}
1318
1323
1324// isRecording_RPC helper class implementation
1326{
1327 return cmd.write(connection);
1328}
1329
1331{
1332 return reply.read(connection);
1333}
1334
1336{
1337 yarp::os::idl::WireWriter writer(connection);
1338 if (!writer.writeListHeader(s_cmd_len)) {
1339 return false;
1340 }
1341 return write(writer);
1342}
1343
1345{
1346 yarp::os::idl::WireReader reader(connection);
1347 if (!reader.readListHeader()) {
1348 reader.fail();
1349 return false;
1350 }
1351 return read(reader);
1352}
1353
1355{
1356 if (!writeTag(writer)) {
1357 return false;
1358 }
1359 if (!writeArgs(writer)) {
1360 return false;
1361 }
1362 return true;
1363}
1364
1366{
1367 if (!writer.writeTag(s_tag, 1, s_tag_len)) {
1368 return false;
1369 }
1370 return true;
1371}
1372
1374{
1375 return true;
1376}
1377
1379{
1380 if (!readTag(reader)) {
1381 return false;
1382 }
1383 if (!readArgs(reader)) {
1384 return false;
1385 }
1386 return true;
1387}
1388
1390{
1391 std::string tag = reader.readTag(s_tag_len);
1392 if (reader.isError()) {
1393 return false;
1394 }
1395 if (tag != s_tag) {
1396 reader.fail();
1397 return false;
1398 }
1399 return true;
1400}
1401
1403{
1404 if (!reader.noMore()) {
1405 reader.fail();
1406 return false;
1407 }
1408 return true;
1409}
1410
1412{
1413 yarp::os::idl::WireWriter writer(connection);
1414 return write(writer);
1415}
1416
1418{
1419 yarp::os::idl::WireReader reader(connection);
1420 return read(reader);
1421}
1422
1424{
1425 if (!writer.isNull()) {
1426 if (!writer.writeListHeader(s_reply_len)) {
1427 return false;
1428 }
1429 if (!writer.write(return_helper)) {
1430 return false;
1431 }
1432 }
1433 return true;
1434}
1435
1437{
1438 if (!reader.readListReturn()) {
1439 return false;
1440 }
1441 if (reader.noMore()) {
1442 reader.fail();
1443 return false;
1444 }
1445 if (!reader.read(return_helper)) {
1446 reader.fail();
1447 return false;
1448 }
1449 return true;
1450}
1451
1456
1457// getSound_RPC helper class implementation
1458IAudioGrabberMsgs_getSound_RPC_helper::IAudioGrabberMsgs_getSound_RPC_helper(const size_t min_number_of_samples, const size_t max_number_of_samples, const double max_samples_timeout_s) :
1459 cmd{min_number_of_samples, max_number_of_samples, max_samples_timeout_s}
1460{
1461}
1462
1464{
1465 return cmd.write(connection);
1466}
1467
1469{
1470 return reply.read(connection);
1471}
1472
1473IAudioGrabberMsgs_getSound_RPC_helper::Command::Command(const size_t min_number_of_samples, const size_t max_number_of_samples, const double max_samples_timeout_s) :
1474 min_number_of_samples{min_number_of_samples},
1475 max_number_of_samples{max_number_of_samples},
1476 max_samples_timeout_s{max_samples_timeout_s}
1477{
1478}
1479
1481{
1482 yarp::os::idl::WireWriter writer(connection);
1483 if (!writer.writeListHeader(s_cmd_len)) {
1484 return false;
1485 }
1486 return write(writer);
1487}
1488
1490{
1491 yarp::os::idl::WireReader reader(connection);
1492 if (!reader.readListHeader()) {
1493 reader.fail();
1494 return false;
1495 }
1496 return read(reader);
1497}
1498
1500{
1501 if (!writeTag(writer)) {
1502 return false;
1503 }
1504 if (!writeArgs(writer)) {
1505 return false;
1506 }
1507 return true;
1508}
1509
1511{
1512 if (!writer.writeTag(s_tag, 1, s_tag_len)) {
1513 return false;
1514 }
1515 return true;
1516}
1517
1519{
1520 if (!writer.writeSizeT(min_number_of_samples)) {
1521 return false;
1522 }
1523 if (!writer.writeSizeT(max_number_of_samples)) {
1524 return false;
1525 }
1526 if (!writer.writeFloat64(max_samples_timeout_s)) {
1527 return false;
1528 }
1529 return true;
1530}
1531
1533{
1534 if (!readTag(reader)) {
1535 return false;
1536 }
1537 if (!readArgs(reader)) {
1538 return false;
1539 }
1540 return true;
1541}
1542
1544{
1545 std::string tag = reader.readTag(s_tag_len);
1546 if (reader.isError()) {
1547 return false;
1548 }
1549 if (tag != s_tag) {
1550 reader.fail();
1551 return false;
1552 }
1553 return true;
1554}
1555
1557{
1558 if (reader.noMore()) {
1559 reader.fail();
1560 return false;
1561 }
1562 if (!reader.readSizeT(min_number_of_samples)) {
1563 reader.fail();
1564 return false;
1565 }
1566 if (reader.noMore()) {
1567 reader.fail();
1568 return false;
1569 }
1570 if (!reader.readSizeT(max_number_of_samples)) {
1571 reader.fail();
1572 return false;
1573 }
1574 if (reader.noMore()) {
1575 reader.fail();
1576 return false;
1577 }
1578 if (!reader.readFloat64(max_samples_timeout_s)) {
1579 reader.fail();
1580 return false;
1581 }
1582 if (!reader.noMore()) {
1583 reader.fail();
1584 return false;
1585 }
1586 return true;
1587}
1588
1590{
1591 yarp::os::idl::WireWriter writer(connection);
1592 return write(writer);
1593}
1594
1596{
1597 yarp::os::idl::WireReader reader(connection);
1598 return read(reader);
1599}
1600
1602{
1603 if (!writer.isNull()) {
1604 if (!writer.writeListHeader(s_reply_len)) {
1605 return false;
1606 }
1607 if (!writer.write(return_helper)) {
1608 return false;
1609 }
1610 }
1611 return true;
1612}
1613
1615{
1616 if (!reader.readListReturn()) {
1617 return false;
1618 }
1619 if (reader.noMore()) {
1620 reader.fail();
1621 return false;
1622 }
1623 if (!reader.read(return_helper)) {
1624 reader.fail();
1625 return false;
1626 }
1627 return true;
1628}
1629
1634
1635// getRecordingAudioBufferMaxSize_RPC helper class implementation
1640
1645
1647{
1648 yarp::os::idl::WireWriter writer(connection);
1649 if (!writer.writeListHeader(s_cmd_len)) {
1650 return false;
1651 }
1652 return write(writer);
1653}
1654
1656{
1657 yarp::os::idl::WireReader reader(connection);
1658 if (!reader.readListHeader()) {
1659 reader.fail();
1660 return false;
1661 }
1662 return read(reader);
1663}
1664
1666{
1667 if (!writeTag(writer)) {
1668 return false;
1669 }
1670 if (!writeArgs(writer)) {
1671 return false;
1672 }
1673 return true;
1674}
1675
1677{
1678 if (!writer.writeTag(s_tag, 1, s_tag_len)) {
1679 return false;
1680 }
1681 return true;
1682}
1683
1685{
1686 return true;
1687}
1688
1690{
1691 if (!readTag(reader)) {
1692 return false;
1693 }
1694 if (!readArgs(reader)) {
1695 return false;
1696 }
1697 return true;
1698}
1699
1701{
1702 std::string tag = reader.readTag(s_tag_len);
1703 if (reader.isError()) {
1704 return false;
1705 }
1706 if (tag != s_tag) {
1707 reader.fail();
1708 return false;
1709 }
1710 return true;
1711}
1712
1714{
1715 if (!reader.noMore()) {
1716 reader.fail();
1717 return false;
1718 }
1719 return true;
1720}
1721
1727
1733
1735{
1736 if (!writer.isNull()) {
1737 if (!writer.writeListHeader(s_reply_len)) {
1738 return false;
1739 }
1740 if (!writer.write(return_helper)) {
1741 return false;
1742 }
1743 }
1744 return true;
1745}
1746
1748{
1749 if (!reader.readListReturn()) {
1750 return false;
1751 }
1752 if (reader.noMore()) {
1753 reader.fail();
1754 return false;
1755 }
1756 if (!reader.read(return_helper)) {
1757 reader.fail();
1758 return false;
1759 }
1760 return true;
1761}
1762
1767
1768// getRecordingAudioBufferCurrentSize_RPC helper class implementation
1773
1778
1780{
1781 yarp::os::idl::WireWriter writer(connection);
1782 if (!writer.writeListHeader(s_cmd_len)) {
1783 return false;
1784 }
1785 return write(writer);
1786}
1787
1789{
1790 yarp::os::idl::WireReader reader(connection);
1791 if (!reader.readListHeader()) {
1792 reader.fail();
1793 return false;
1794 }
1795 return read(reader);
1796}
1797
1799{
1800 if (!writeTag(writer)) {
1801 return false;
1802 }
1803 if (!writeArgs(writer)) {
1804 return false;
1805 }
1806 return true;
1807}
1808
1810{
1811 if (!writer.writeTag(s_tag, 1, s_tag_len)) {
1812 return false;
1813 }
1814 return true;
1815}
1816
1821
1823{
1824 if (!readTag(reader)) {
1825 return false;
1826 }
1827 if (!readArgs(reader)) {
1828 return false;
1829 }
1830 return true;
1831}
1832
1834{
1835 std::string tag = reader.readTag(s_tag_len);
1836 if (reader.isError()) {
1837 return false;
1838 }
1839 if (tag != s_tag) {
1840 reader.fail();
1841 return false;
1842 }
1843 return true;
1844}
1845
1847{
1848 if (!reader.noMore()) {
1849 reader.fail();
1850 return false;
1851 }
1852 return true;
1853}
1854
1860
1866
1868{
1869 if (!writer.isNull()) {
1870 if (!writer.writeListHeader(s_reply_len)) {
1871 return false;
1872 }
1873 if (!writer.write(return_helper)) {
1874 return false;
1875 }
1876 }
1877 return true;
1878}
1879
1881{
1882 if (!reader.readListReturn()) {
1883 return false;
1884 }
1885 if (reader.noMore()) {
1886 reader.fail();
1887 return false;
1888 }
1889 if (!reader.read(return_helper)) {
1890 reader.fail();
1891 return false;
1892 }
1893 return true;
1894}
1895
1900
1901// Constructor
1903{
1904 yarp().setOwner(*this);
1905}
1906
1908{
1909 if (!yarp().canWrite()) {
1910 yError("Missing server method '%s'?", IAudioGrabberMsgs_setHWGain_RPC_helper::s_prototype);
1911 }
1913 bool ok = yarp().write(helper, helper);
1914 return ok ? helper.reply.return_helper : yarp::dev::ReturnValue{};
1915}
1916
1918{
1919 if (!yarp().canWrite()) {
1920 yError("Missing server method '%s'?", IAudioGrabberMsgs_setSWGain_RPC_helper::s_prototype);
1921 }
1923 bool ok = yarp().write(helper, helper);
1924 return ok ? helper.reply.return_helper : yarp::dev::ReturnValue{};
1925}
1926
1928{
1929 if (!yarp().canWrite()) {
1931 }
1933 bool ok = yarp().write(helper, helper);
1934 return ok ? helper.reply.return_helper : yarp::dev::ReturnValue{};
1935}
1936
1938{
1939 if (!yarp().canWrite()) {
1941 }
1943 bool ok = yarp().write(helper, helper);
1944 return ok ? helper.reply.return_helper : yarp::dev::ReturnValue{};
1945}
1946
1948{
1949 if (!yarp().canWrite()) {
1951 }
1953 bool ok = yarp().write(helper, helper);
1954 return ok ? helper.reply.return_helper : yarp::dev::ReturnValue{};
1955}
1956
1958{
1959 if (!yarp().canWrite()) {
1960 yError("Missing server method '%s'?", IAudioGrabberMsgs_isRecording_RPC_helper::s_prototype);
1961 }
1963 bool ok = yarp().write(helper, helper);
1964 return ok ? helper.reply.return_helper : return_isRecording{};
1965}
1966
1967return_getSound IAudioGrabberMsgs::getSound_RPC(const size_t min_number_of_samples, const size_t max_number_of_samples, const double max_samples_timeout_s)
1968{
1969 if (!yarp().canWrite()) {
1970 yError("Missing server method '%s'?", IAudioGrabberMsgs_getSound_RPC_helper::s_prototype);
1971 }
1972 IAudioGrabberMsgs_getSound_RPC_helper helper{min_number_of_samples, max_number_of_samples, max_samples_timeout_s};
1973 bool ok = yarp().write(helper, helper);
1974 return ok ? helper.reply.return_helper : return_getSound{};
1975}
1976
1978{
1979 if (!yarp().canWrite()) {
1981 }
1983 bool ok = yarp().write(helper, helper);
1984 return ok ? helper.reply.return_helper : return_getRecordingAudioBufferMaxSize{};
1985}
1986
1996
1997// help method
1998std::vector<std::string> IAudioGrabberMsgs::help(const std::string& functionName)
1999{
2000 bool showAll = (functionName == "--all");
2001 std::vector<std::string> helpString;
2002 if (showAll) {
2003 helpString.emplace_back("*** Available commands:");
2004 helpString.emplace_back(IAudioGrabberMsgs_setHWGain_RPC_helper::s_tag);
2005 helpString.emplace_back(IAudioGrabberMsgs_setSWGain_RPC_helper::s_tag);
2009 helpString.emplace_back(IAudioGrabberMsgs_isRecording_RPC_helper::s_tag);
2010 helpString.emplace_back(IAudioGrabberMsgs_getSound_RPC_helper::s_tag);
2013 helpString.emplace_back("help");
2014 } else {
2017 }
2020 }
2023 }
2026 }
2029 }
2032 }
2035 }
2038 }
2041 }
2042 if (functionName == "help") {
2043 helpString.emplace_back("std::vector<std::string> help(const std::string& functionName = \"--all\")");
2044 helpString.emplace_back("Return list of available commands, or help message for a specific function");
2045 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");
2046 helpString.emplace_back("@return list of strings (one string per line)");
2047 }
2048 }
2049 if (helpString.empty()) {
2050 helpString.emplace_back("Command not found");
2051 }
2052 return helpString;
2053}
2054
2055// read from ConnectionReader
2057{
2058 constexpr size_t max_tag_len = 2;
2059 size_t tag_len = 1;
2060
2061 yarp::os::idl::WireReader reader(connection);
2062 reader.expectAccept();
2063 if (!reader.readListHeader()) {
2064 reader.fail();
2065 return false;
2066 }
2067
2068 std::string tag = reader.readTag(1);
2069 bool direct = (tag == "__direct__");
2070 if (direct) {
2071 tag = reader.readTag(1);
2072 }
2073 while (tag_len <= max_tag_len && !reader.isError()) {
2074 if(tag == "getRemoteProtocolVersion") {
2075 if (!reader.noMore()) {
2076 yError("Reader invalid protocol?! %s:%d - %s", __FILE__, __LINE__, __YFUNCTION__);
2077 reader.fail();
2078 return false;
2079 }
2080
2081 auto proto = getLocalProtocolVersion();
2082
2083 yarp::os::idl::WireWriter writer(reader);
2084 if (!writer.writeListHeader(1)) {
2085 yWarning("Writer invalid protocol?! %s:%d - %s", __FILE__, __LINE__, __YFUNCTION__);
2086 return false;}
2087 if (!writer.write(proto)) {
2088 yWarning("Writer invalid protocol?! %s:%d - %s", __FILE__, __LINE__, __YFUNCTION__);
2089 return false;
2090 }
2091 reader.accept();
2092 return true;
2093 }
2096 if (!helper.cmd.readArgs(reader)) {
2097 return false;
2098 }
2099
2100 helper.call(this);
2101
2102 yarp::os::idl::WireWriter writer(reader);
2103 if (!helper.reply.write(writer)) {
2104 return false;
2105 }
2106 reader.accept();
2107 return true;
2108 }
2111 if (!helper.cmd.readArgs(reader)) {
2112 return false;
2113 }
2114
2115 helper.call(this);
2116
2117 yarp::os::idl::WireWriter writer(reader);
2118 if (!helper.reply.write(writer)) {
2119 return false;
2120 }
2121 reader.accept();
2122 return true;
2123 }
2126 if (!helper.cmd.readArgs(reader)) {
2127 return false;
2128 }
2129
2130 helper.call(this);
2131
2132 yarp::os::idl::WireWriter writer(reader);
2133 if (!helper.reply.write(writer)) {
2134 return false;
2135 }
2136 reader.accept();
2137 return true;
2138 }
2141 if (!helper.cmd.readArgs(reader)) {
2142 return false;
2143 }
2144
2145 helper.call(this);
2146
2147 yarp::os::idl::WireWriter writer(reader);
2148 if (!helper.reply.write(writer)) {
2149 return false;
2150 }
2151 reader.accept();
2152 return true;
2153 }
2156 if (!helper.cmd.readArgs(reader)) {
2157 return false;
2158 }
2159
2160 helper.call(this);
2161
2162 yarp::os::idl::WireWriter writer(reader);
2163 if (!helper.reply.write(writer)) {
2164 return false;
2165 }
2166 reader.accept();
2167 return true;
2168 }
2171 if (!helper.cmd.readArgs(reader)) {
2172 return false;
2173 }
2174
2175 helper.call(this);
2176
2177 yarp::os::idl::WireWriter writer(reader);
2178 if (!helper.reply.write(writer)) {
2179 return false;
2180 }
2181 reader.accept();
2182 return true;
2183 }
2186 if (!helper.cmd.readArgs(reader)) {
2187 return false;
2188 }
2189
2190 helper.call(this);
2191
2192 yarp::os::idl::WireWriter writer(reader);
2193 if (!helper.reply.write(writer)) {
2194 return false;
2195 }
2196 reader.accept();
2197 return true;
2198 }
2201 if (!helper.cmd.readArgs(reader)) {
2202 return false;
2203 }
2204
2205 helper.call(this);
2206
2207 yarp::os::idl::WireWriter writer(reader);
2208 if (!helper.reply.write(writer)) {
2209 return false;
2210 }
2211 reader.accept();
2212 return true;
2213 }
2216 if (!helper.cmd.readArgs(reader)) {
2217 return false;
2218 }
2219
2220 helper.call(this);
2221
2222 yarp::os::idl::WireWriter writer(reader);
2223 if (!helper.reply.write(writer)) {
2224 return false;
2225 }
2226 reader.accept();
2227 return true;
2228 }
2229 if (tag == "help") {
2230 std::string functionName;
2231 if (!reader.readString(functionName)) {
2232 functionName = "--all";
2233 }
2234 auto help_strings = help(functionName);
2235 yarp::os::idl::WireWriter writer(reader);
2236 if (!writer.isNull()) {
2237 if (!writer.writeListHeader(2)) {
2238 return false;
2239 }
2240 if (!writer.writeTag("many", 1, 0)) {
2241 return false;
2242 }
2243 if (!writer.writeListBegin(0, help_strings.size())) {
2244 return false;
2245 }
2246 for (const auto& help_string : help_strings) {
2247 if (!writer.writeString(help_string)) {
2248 return false;
2249 }
2250 }
2251 if (!writer.writeListEnd()) {
2252 return false;
2253 }
2254 }
2255 reader.accept();
2256 return true;
2257 }
2258 if (reader.noMore()) {
2259 reader.fail();
2260 return false;
2261 }
2262 std::string next_tag = reader.readTag(1);
2263 if (next_tag.empty()) {
2264 break;
2265 }
2266 tag.append("_").append(next_tag);
2267 tag_len = std::count(tag.begin(), tag.end(), '_') + 1;
2268 }
2269 return false;
2270}
size_t size_t
#define yError(...)
Definition Log.h:361
#define __YFUNCTION__
Definition Log.h:24
#define yWarning(...)
Definition Log.h:340
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_getRecordingAudioBufferCurrentSize(*)() funcptr_t
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 writeArgs(const yarp::os::idl::WireWriter &writer) const
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 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.
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 readArgs(yarp::os::idl::WireReader &reader)
bool readTag(yarp::os::idl::WireReader &reader)
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.
static constexpr const char * s_tag
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
static constexpr const char * s_prototype
return_getSound(*)(const size_t, const size_t, const double) funcptr_t
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
static constexpr const char * s_help
bool writeArgs(const yarp::os::idl::WireWriter &writer) const
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 readArgs(yarp::os::idl::WireReader &reader)
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.
static constexpr const char * s_prototype
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 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 writeTag(const yarp::os::idl::WireWriter &writer) const
bool readArgs(yarp::os::idl::WireReader &reader)
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 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.
yarp::dev::ReturnValue(*)(const double) funcptr_t
static constexpr const char * s_prototype
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 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 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.
yarp::dev::ReturnValue(*)(const double) funcptr_t
static constexpr const char * s_prototype
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 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 readTag(yarp::os::idl::WireReader &reader)
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 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 readArgs(yarp::os::idl::WireReader &reader)
bool writeArgs(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 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.
virtual return_isRecording isRecording_RPC()
virtual yarp::dev::ReturnValue setHWGain_RPC(const double gain)
virtual return_getRecordingAudioBufferMaxSize getRecordingAudioBufferMaxSize_RPC()
virtual std::vector< std::string > help(const std::string &functionName="--all")
virtual return_getRecordingAudioBufferCurrentSize getRecordingAudioBufferCurrentSize_RPC()
virtual bool checkProtocolVersion()
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
virtual yarp::os::ApplicationNetworkProtocolVersion getLocalProtocolVersion()
virtual return_getSound getSound_RPC(const size_t min_number_of_samples, const size_t max_number_of_samples, const double max_samples_timeout_s)
virtual yarp::dev::ReturnValue startRecording_RPC()
virtual yarp::dev::ReturnValue setSWGain_RPC(const double gain)
virtual yarp::os::ApplicationNetworkProtocolVersion getRemoteProtocolVersion()
virtual yarp::dev::ReturnValue resetRecordingAudioBuffer_RPC()
virtual yarp::dev::ReturnValue stopRecording_RPC()
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 readSizeT(std::size_t &x)
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
bool writeSizeT(std::size_t x, bool skip_tag=false) 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