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 (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>
13#include <IAudioGrabberMsgs.h>
15#include <yarp/os/LogStream.h>
16
18
19#include <algorithm>
20
21namespace
22{
23 YARP_LOG_COMPONENT(SERVICE_LOG_COMPONENT, "IAudioGrabberMsgs")
24}
25
26//IAudioGrabberMsgs_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 IAudioGrabberMsgs_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 IAudioGrabberMsgs::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// setHWGain_RPC helper class declaration
111 public yarp::os::Portable
112{
113public:
115 explicit IAudioGrabberMsgs_setHWGain_RPC_helper(const double gain);
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 double gain);
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 double gain{0.0};
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 = yarp::dev::ReturnValue (*)(const double);
159 void call(IAudioGrabberMsgs* ptr);
160
163
164 static constexpr const char* s_tag{"setHWGain_RPC"};
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{"yarp::dev::ReturnValue IAudioGrabberMsgs::setHWGain_RPC(const double gain)"};
169 static constexpr const char* s_help{""};
170};
171
172// setSWGain_RPC helper class declaration
174 public yarp::os::Portable
175{
176public:
178 explicit IAudioGrabberMsgs_setSWGain_RPC_helper(const double gain);
179 bool write(yarp::os::ConnectionWriter& connection) const override;
180 bool read(yarp::os::ConnectionReader& connection) override;
181
182 class Command :
184 {
185 public:
186 Command() = default;
187 explicit Command(const double gain);
188
189 ~Command() override = default;
190
191 bool write(yarp::os::ConnectionWriter& connection) const override;
192 bool read(yarp::os::ConnectionReader& connection) override;
193
194 bool write(const yarp::os::idl::WireWriter& writer) const override;
195 bool writeTag(const yarp::os::idl::WireWriter& writer) const;
196 bool writeArgs(const yarp::os::idl::WireWriter& writer) const;
197
198 bool read(yarp::os::idl::WireReader& reader) override;
201
202 double gain{0.0};
203 };
204
205 class Reply :
207 {
208 public:
209 Reply() = default;
210 ~Reply() override = default;
211
212 bool write(yarp::os::ConnectionWriter& connection) const override;
213 bool read(yarp::os::ConnectionReader& connection) override;
214
215 bool write(const yarp::os::idl::WireWriter& writer) const override;
216 bool read(yarp::os::idl::WireReader& reader) override;
217
219 };
220
221 using funcptr_t = yarp::dev::ReturnValue (*)(const double);
222 void call(IAudioGrabberMsgs* ptr);
223
226
227 static constexpr const char* s_tag{"setSWGain_RPC"};
228 static constexpr size_t s_tag_len{2};
229 static constexpr size_t s_cmd_len{3};
230 static constexpr size_t s_reply_len{1};
231 static constexpr const char* s_prototype{"yarp::dev::ReturnValue IAudioGrabberMsgs::setSWGain_RPC(const double gain)"};
232 static constexpr const char* s_help{""};
233};
234
235// resetRecordingAudioBuffer_RPC helper class declaration
237 public yarp::os::Portable
238{
239public:
241 bool write(yarp::os::ConnectionWriter& connection) const override;
242 bool read(yarp::os::ConnectionReader& connection) override;
243
244 class Command :
246 {
247 public:
248 Command() = default;
249 ~Command() override = default;
250
251 bool write(yarp::os::ConnectionWriter& connection) const override;
252 bool read(yarp::os::ConnectionReader& connection) override;
253
254 bool write(const yarp::os::idl::WireWriter& writer) const override;
255 bool writeTag(const yarp::os::idl::WireWriter& writer) const;
256 bool writeArgs(const yarp::os::idl::WireWriter& writer) const;
257
258 bool read(yarp::os::idl::WireReader& reader) override;
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
280 void call(IAudioGrabberMsgs* ptr);
281
284
285 static constexpr const char* s_tag{"resetRecordingAudioBuffer_RPC"};
286 static constexpr size_t s_tag_len{2};
287 static constexpr size_t s_cmd_len{2};
288 static constexpr size_t s_reply_len{1};
289 static constexpr const char* s_prototype{"yarp::dev::ReturnValue IAudioGrabberMsgs::resetRecordingAudioBuffer_RPC()"};
290 static constexpr const char* s_help{""};
291};
292
293// startRecording_RPC 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(IAudioGrabberMsgs* ptr);
339
342
343 static constexpr const char* s_tag{"startRecording_RPC"};
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{1};
347 static constexpr const char* s_prototype{"yarp::dev::ReturnValue IAudioGrabberMsgs::startRecording_RPC()"};
348 static constexpr const char* s_help{""};
349};
350
351// stopRecording_RPC 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(IAudioGrabberMsgs* ptr);
397
400
401 static constexpr const char* s_tag{"stopRecording_RPC"};
402 static constexpr size_t s_tag_len{2};
403 static constexpr size_t s_cmd_len{2};
404 static constexpr size_t s_reply_len{1};
405 static constexpr const char* s_prototype{"yarp::dev::ReturnValue IAudioGrabberMsgs::stopRecording_RPC()"};
406 static constexpr const char* s_help{""};
407};
408
409// isRecording_RPC helper class declaration
411 public yarp::os::Portable
412{
413public:
415 bool write(yarp::os::ConnectionWriter& connection) const override;
416 bool read(yarp::os::ConnectionReader& connection) override;
417
418 class Command :
420 {
421 public:
422 Command() = default;
423 ~Command() override = default;
424
425 bool write(yarp::os::ConnectionWriter& connection) const override;
426 bool read(yarp::os::ConnectionReader& connection) override;
427
428 bool write(const yarp::os::idl::WireWriter& writer) const override;
429 bool writeTag(const yarp::os::idl::WireWriter& writer) const;
430 bool writeArgs(const yarp::os::idl::WireWriter& writer) const;
431
432 bool read(yarp::os::idl::WireReader& reader) override;
435 };
436
437 class Reply :
439 {
440 public:
441 Reply() = default;
442 ~Reply() override = default;
443
444 bool write(yarp::os::ConnectionWriter& connection) const override;
445 bool read(yarp::os::ConnectionReader& connection) override;
446
447 bool write(const yarp::os::idl::WireWriter& writer) const override;
448 bool read(yarp::os::idl::WireReader& reader) override;
449
451 };
452
454 void call(IAudioGrabberMsgs* ptr);
455
458
459 static constexpr const char* s_tag{"isRecording_RPC"};
460 static constexpr size_t s_tag_len{2};
461 static constexpr size_t s_cmd_len{2};
462 static constexpr size_t s_reply_len{2};
463 static constexpr const char* s_prototype{"return_isRecording IAudioGrabberMsgs::isRecording_RPC()"};
464 static constexpr const char* s_help{""};
465};
466
467// getSound_RPC helper class declaration
469 public yarp::os::Portable
470{
471public:
473 IAudioGrabberMsgs_getSound_RPC_helper(const size_t min_number_of_samples, const size_t max_number_of_samples, const double max_samples_timeout_s);
474 bool write(yarp::os::ConnectionWriter& connection) const override;
475 bool read(yarp::os::ConnectionReader& connection) override;
476
477 class Command :
479 {
480 public:
481 Command() = default;
482 Command(const size_t min_number_of_samples, const size_t max_number_of_samples, const double max_samples_timeout_s);
483
484 ~Command() override = default;
485
486 bool write(yarp::os::ConnectionWriter& connection) const override;
487 bool read(yarp::os::ConnectionReader& connection) override;
488
489 bool write(const yarp::os::idl::WireWriter& writer) const override;
490 bool writeTag(const yarp::os::idl::WireWriter& writer) const;
491 bool writeArgs(const yarp::os::idl::WireWriter& writer) const;
492
493 bool read(yarp::os::idl::WireReader& reader) override;
496
500 };
501
502 class Reply :
504 {
505 public:
506 Reply() = default;
507 ~Reply() override = default;
508
509 bool write(yarp::os::ConnectionWriter& connection) const override;
510 bool read(yarp::os::ConnectionReader& connection) override;
511
512 bool write(const yarp::os::idl::WireWriter& writer) const override;
513 bool read(yarp::os::idl::WireReader& reader) override;
514
516 };
517
518 using funcptr_t = return_getSound (*)(const size_t, const size_t, const double);
519 void call(IAudioGrabberMsgs* ptr);
520
523
524 static constexpr const char* s_tag{"getSound_RPC"};
525 static constexpr size_t s_tag_len{2};
526 static constexpr size_t s_cmd_len{5};
527 static constexpr size_t s_reply_len{2};
528 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)"};
529 static constexpr const char* s_help{""};
530};
531
532// getRecordingAudioBufferMaxSize_RPC helper class declaration
534 public yarp::os::Portable
535{
536public:
538 bool write(yarp::os::ConnectionWriter& connection) const override;
539 bool read(yarp::os::ConnectionReader& connection) override;
540
541 class Command :
543 {
544 public:
545 Command() = default;
546 ~Command() override = default;
547
548 bool write(yarp::os::ConnectionWriter& connection) const override;
549 bool read(yarp::os::ConnectionReader& connection) override;
550
551 bool write(const yarp::os::idl::WireWriter& writer) const override;
552 bool writeTag(const yarp::os::idl::WireWriter& writer) const;
553 bool writeArgs(const yarp::os::idl::WireWriter& writer) const;
554
555 bool read(yarp::os::idl::WireReader& reader) override;
558 };
559
560 class Reply :
562 {
563 public:
564 Reply() = default;
565 ~Reply() override = default;
566
567 bool write(yarp::os::ConnectionWriter& connection) const override;
568 bool read(yarp::os::ConnectionReader& connection) override;
569
570 bool write(const yarp::os::idl::WireWriter& writer) const override;
571 bool read(yarp::os::idl::WireReader& reader) override;
572
574 };
575
577 void call(IAudioGrabberMsgs* ptr);
578
581
582 static constexpr const char* s_tag{"getRecordingAudioBufferMaxSize_RPC"};
583 static constexpr size_t s_tag_len{2};
584 static constexpr size_t s_cmd_len{2};
585 static constexpr size_t s_reply_len{2};
586 static constexpr const char* s_prototype{"return_getRecordingAudioBufferMaxSize IAudioGrabberMsgs::getRecordingAudioBufferMaxSize_RPC()"};
587 static constexpr const char* s_help{""};
588};
589
590// getRecordingAudioBufferCurrentSize_RPC helper class declaration
592 public yarp::os::Portable
593{
594public:
596 bool write(yarp::os::ConnectionWriter& connection) const override;
597 bool read(yarp::os::ConnectionReader& connection) override;
598
599 class Command :
601 {
602 public:
603 Command() = default;
604 ~Command() override = default;
605
606 bool write(yarp::os::ConnectionWriter& connection) const override;
607 bool read(yarp::os::ConnectionReader& connection) override;
608
609 bool write(const yarp::os::idl::WireWriter& writer) const override;
610 bool writeTag(const yarp::os::idl::WireWriter& writer) const;
611 bool writeArgs(const yarp::os::idl::WireWriter& writer) const;
612
613 bool read(yarp::os::idl::WireReader& reader) override;
616 };
617
618 class Reply :
620 {
621 public:
622 Reply() = default;
623 ~Reply() override = default;
624
625 bool write(yarp::os::ConnectionWriter& connection) const override;
626 bool read(yarp::os::ConnectionReader& connection) override;
627
628 bool write(const yarp::os::idl::WireWriter& writer) const override;
629 bool read(yarp::os::idl::WireReader& reader) override;
630
632 };
633
635 void call(IAudioGrabberMsgs* ptr);
636
639
640 static constexpr const char* s_tag{"getRecordingAudioBufferCurrentSize_RPC"};
641 static constexpr size_t s_tag_len{2};
642 static constexpr size_t s_cmd_len{2};
643 static constexpr size_t s_reply_len{2};
644 static constexpr const char* s_prototype{"return_getRecordingAudioBufferCurrentSize IAudioGrabberMsgs::getRecordingAudioBufferCurrentSize_RPC()"};
645 static constexpr const char* s_help{""};
646};
647
648// setHWGain_RPC helper class implementation
653
655{
656 return cmd.write(connection);
657}
658
660{
661 return reply.read(connection);
662}
663
665 gain{gain}
666{
667}
668
670{
671 yarp::os::idl::WireWriter writer(connection);
672 if (!writer.writeListHeader(s_cmd_len)) {
673 return false;
674 }
675 return write(writer);
676}
677
679{
680 yarp::os::idl::WireReader reader(connection);
681 if (!reader.readListHeader()) {
682 reader.fail();
683 return false;
684 }
685 return read(reader);
686}
687
689{
690 if (!writeTag(writer)) {
691 return false;
692 }
693 if (!writeArgs(writer)) {
694 return false;
695 }
696 return true;
697}
698
700{
701 if (!writer.writeTag(s_tag, 1, s_tag_len)) {
702 return false;
703 }
704 return true;
705}
706
708{
709 if (!writer.writeFloat64(gain)) {
710 return false;
711 }
712 return true;
713}
714
716{
717 if (!readTag(reader)) {
718 return false;
719 }
720 if (!readArgs(reader)) {
721 return false;
722 }
723 return true;
724}
725
727{
728 std::string tag = reader.readTag(s_tag_len);
729 if (reader.isError()) {
730 return false;
731 }
732 if (tag != s_tag) {
733 reader.fail();
734 return false;
735 }
736 return true;
737}
738
740{
741 if (reader.noMore()) {
742 reader.fail();
743 return false;
744 }
745 if (!reader.readFloat64(gain)) {
746 reader.fail();
747 return false;
748 }
749 if (!reader.noMore()) {
750 reader.fail();
751 return false;
752 }
753 return true;
754}
755
757{
758 yarp::os::idl::WireWriter writer(connection);
759 return write(writer);
760}
761
763{
764 yarp::os::idl::WireReader reader(connection);
765 return read(reader);
766}
767
769{
770 if (!writer.isNull()) {
771 if (!writer.write(return_helper)) {
772 return false;
773 }
774 }
775 return true;
776}
777
779{
780 if (reader.noMore()) {
781 reader.fail();
782 return false;
783 }
784 if (!reader.read(return_helper)) {
785 reader.fail();
786 return false;
787 }
788 return true;
789}
790
795
796// setSWGain_RPC helper class implementation
801
803{
804 return cmd.write(connection);
805}
806
808{
809 return reply.read(connection);
810}
811
813 gain{gain}
814{
815}
816
818{
819 yarp::os::idl::WireWriter writer(connection);
820 if (!writer.writeListHeader(s_cmd_len)) {
821 return false;
822 }
823 return write(writer);
824}
825
827{
828 yarp::os::idl::WireReader reader(connection);
829 if (!reader.readListHeader()) {
830 reader.fail();
831 return false;
832 }
833 return read(reader);
834}
835
837{
838 if (!writeTag(writer)) {
839 return false;
840 }
841 if (!writeArgs(writer)) {
842 return false;
843 }
844 return true;
845}
846
848{
849 if (!writer.writeTag(s_tag, 1, s_tag_len)) {
850 return false;
851 }
852 return true;
853}
854
856{
857 if (!writer.writeFloat64(gain)) {
858 return false;
859 }
860 return true;
861}
862
864{
865 if (!readTag(reader)) {
866 return false;
867 }
868 if (!readArgs(reader)) {
869 return false;
870 }
871 return true;
872}
873
875{
876 std::string tag = reader.readTag(s_tag_len);
877 if (reader.isError()) {
878 return false;
879 }
880 if (tag != s_tag) {
881 reader.fail();
882 return false;
883 }
884 return true;
885}
886
888{
889 if (reader.noMore()) {
890 reader.fail();
891 return false;
892 }
893 if (!reader.readFloat64(gain)) {
894 reader.fail();
895 return false;
896 }
897 if (!reader.noMore()) {
898 reader.fail();
899 return false;
900 }
901 return true;
902}
903
905{
906 yarp::os::idl::WireWriter writer(connection);
907 return write(writer);
908}
909
911{
912 yarp::os::idl::WireReader reader(connection);
913 return read(reader);
914}
915
917{
918 if (!writer.isNull()) {
919 if (!writer.write(return_helper)) {
920 return false;
921 }
922 }
923 return true;
924}
925
927{
928 if (reader.noMore()) {
929 reader.fail();
930 return false;
931 }
932 if (!reader.read(return_helper)) {
933 reader.fail();
934 return false;
935 }
936 return true;
937}
938
943
944// resetRecordingAudioBuffer_RPC helper class implementation
949
954
956{
957 yarp::os::idl::WireWriter writer(connection);
958 if (!writer.writeListHeader(s_cmd_len)) {
959 return false;
960 }
961 return write(writer);
962}
963
965{
966 yarp::os::idl::WireReader reader(connection);
967 if (!reader.readListHeader()) {
968 reader.fail();
969 return false;
970 }
971 return read(reader);
972}
973
975{
976 if (!writeTag(writer)) {
977 return false;
978 }
979 if (!writeArgs(writer)) {
980 return false;
981 }
982 return true;
983}
984
986{
987 if (!writer.writeTag(s_tag, 1, s_tag_len)) {
988 return false;
989 }
990 return true;
991}
992
994{
995 return true;
996}
997
999{
1000 if (!readTag(reader)) {
1001 return false;
1002 }
1003 if (!readArgs(reader)) {
1004 return false;
1005 }
1006 return true;
1007}
1008
1010{
1011 std::string tag = reader.readTag(s_tag_len);
1012 if (reader.isError()) {
1013 return false;
1014 }
1015 if (tag != s_tag) {
1016 reader.fail();
1017 return false;
1018 }
1019 return true;
1020}
1021
1023{
1024 if (!reader.noMore()) {
1025 reader.fail();
1026 return false;
1027 }
1028 return true;
1029}
1030
1032{
1033 yarp::os::idl::WireWriter writer(connection);
1034 return write(writer);
1035}
1036
1042
1044{
1045 if (!writer.isNull()) {
1046 if (!writer.write(return_helper)) {
1047 return false;
1048 }
1049 }
1050 return true;
1051}
1052
1054{
1055 if (reader.noMore()) {
1056 reader.fail();
1057 return false;
1058 }
1059 if (!reader.read(return_helper)) {
1060 reader.fail();
1061 return false;
1062 }
1063 return true;
1064}
1065
1070
1071// startRecording_RPC helper class implementation
1073{
1074 return cmd.write(connection);
1075}
1076
1081
1083{
1084 yarp::os::idl::WireWriter writer(connection);
1085 if (!writer.writeListHeader(s_cmd_len)) {
1086 return false;
1087 }
1088 return write(writer);
1089}
1090
1092{
1093 yarp::os::idl::WireReader reader(connection);
1094 if (!reader.readListHeader()) {
1095 reader.fail();
1096 return false;
1097 }
1098 return read(reader);
1099}
1100
1102{
1103 if (!writeTag(writer)) {
1104 return false;
1105 }
1106 if (!writeArgs(writer)) {
1107 return false;
1108 }
1109 return true;
1110}
1111
1113{
1114 if (!writer.writeTag(s_tag, 1, s_tag_len)) {
1115 return false;
1116 }
1117 return true;
1118}
1119
1121{
1122 return true;
1123}
1124
1126{
1127 if (!readTag(reader)) {
1128 return false;
1129 }
1130 if (!readArgs(reader)) {
1131 return false;
1132 }
1133 return true;
1134}
1135
1137{
1138 std::string tag = reader.readTag(s_tag_len);
1139 if (reader.isError()) {
1140 return false;
1141 }
1142 if (tag != s_tag) {
1143 reader.fail();
1144 return false;
1145 }
1146 return true;
1147}
1148
1150{
1151 if (!reader.noMore()) {
1152 reader.fail();
1153 return false;
1154 }
1155 return true;
1156}
1157
1159{
1160 yarp::os::idl::WireWriter writer(connection);
1161 return write(writer);
1162}
1163
1165{
1166 yarp::os::idl::WireReader reader(connection);
1167 return read(reader);
1168}
1169
1171{
1172 if (!writer.isNull()) {
1173 if (!writer.write(return_helper)) {
1174 return false;
1175 }
1176 }
1177 return true;
1178}
1179
1181{
1182 if (reader.noMore()) {
1183 reader.fail();
1184 return false;
1185 }
1186 if (!reader.read(return_helper)) {
1187 reader.fail();
1188 return false;
1189 }
1190 return true;
1191}
1192
1197
1198// stopRecording_RPC helper class implementation
1200{
1201 return cmd.write(connection);
1202}
1203
1205{
1206 return reply.read(connection);
1207}
1208
1210{
1211 yarp::os::idl::WireWriter writer(connection);
1212 if (!writer.writeListHeader(s_cmd_len)) {
1213 return false;
1214 }
1215 return write(writer);
1216}
1217
1219{
1220 yarp::os::idl::WireReader reader(connection);
1221 if (!reader.readListHeader()) {
1222 reader.fail();
1223 return false;
1224 }
1225 return read(reader);
1226}
1227
1229{
1230 if (!writeTag(writer)) {
1231 return false;
1232 }
1233 if (!writeArgs(writer)) {
1234 return false;
1235 }
1236 return true;
1237}
1238
1240{
1241 if (!writer.writeTag(s_tag, 1, s_tag_len)) {
1242 return false;
1243 }
1244 return true;
1245}
1246
1248{
1249 return true;
1250}
1251
1253{
1254 if (!readTag(reader)) {
1255 return false;
1256 }
1257 if (!readArgs(reader)) {
1258 return false;
1259 }
1260 return true;
1261}
1262
1264{
1265 std::string tag = reader.readTag(s_tag_len);
1266 if (reader.isError()) {
1267 return false;
1268 }
1269 if (tag != s_tag) {
1270 reader.fail();
1271 return false;
1272 }
1273 return true;
1274}
1275
1277{
1278 if (!reader.noMore()) {
1279 reader.fail();
1280 return false;
1281 }
1282 return true;
1283}
1284
1286{
1287 yarp::os::idl::WireWriter writer(connection);
1288 return write(writer);
1289}
1290
1292{
1293 yarp::os::idl::WireReader reader(connection);
1294 return read(reader);
1295}
1296
1298{
1299 if (!writer.isNull()) {
1300 if (!writer.write(return_helper)) {
1301 return false;
1302 }
1303 }
1304 return true;
1305}
1306
1308{
1309 if (reader.noMore()) {
1310 reader.fail();
1311 return false;
1312 }
1313 if (!reader.read(return_helper)) {
1314 reader.fail();
1315 return false;
1316 }
1317 return true;
1318}
1319
1324
1325// isRecording_RPC helper class implementation
1327{
1328 return cmd.write(connection);
1329}
1330
1332{
1333 return reply.read(connection);
1334}
1335
1337{
1338 yarp::os::idl::WireWriter writer(connection);
1339 if (!writer.writeListHeader(s_cmd_len)) {
1340 return false;
1341 }
1342 return write(writer);
1343}
1344
1346{
1347 yarp::os::idl::WireReader reader(connection);
1348 if (!reader.readListHeader()) {
1349 reader.fail();
1350 return false;
1351 }
1352 return read(reader);
1353}
1354
1356{
1357 if (!writeTag(writer)) {
1358 return false;
1359 }
1360 if (!writeArgs(writer)) {
1361 return false;
1362 }
1363 return true;
1364}
1365
1367{
1368 if (!writer.writeTag(s_tag, 1, s_tag_len)) {
1369 return false;
1370 }
1371 return true;
1372}
1373
1375{
1376 return true;
1377}
1378
1380{
1381 if (!readTag(reader)) {
1382 return false;
1383 }
1384 if (!readArgs(reader)) {
1385 return false;
1386 }
1387 return true;
1388}
1389
1391{
1392 std::string tag = reader.readTag(s_tag_len);
1393 if (reader.isError()) {
1394 return false;
1395 }
1396 if (tag != s_tag) {
1397 reader.fail();
1398 return false;
1399 }
1400 return true;
1401}
1402
1404{
1405 if (!reader.noMore()) {
1406 reader.fail();
1407 return false;
1408 }
1409 return true;
1410}
1411
1413{
1414 yarp::os::idl::WireWriter writer(connection);
1415 return write(writer);
1416}
1417
1419{
1420 yarp::os::idl::WireReader reader(connection);
1421 return read(reader);
1422}
1423
1425{
1426 if (!writer.isNull()) {
1427 if (!writer.writeListHeader(s_reply_len)) {
1428 return false;
1429 }
1430 if (!writer.write(return_helper)) {
1431 return false;
1432 }
1433 }
1434 return true;
1435}
1436
1438{
1439 if (!reader.readListReturn()) {
1440 return false;
1441 }
1442 if (reader.noMore()) {
1443 reader.fail();
1444 return false;
1445 }
1446 if (!reader.read(return_helper)) {
1447 reader.fail();
1448 return false;
1449 }
1450 return true;
1451}
1452
1457
1458// getSound_RPC helper class implementation
1459IAudioGrabberMsgs_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) :
1460 cmd{min_number_of_samples, max_number_of_samples, max_samples_timeout_s}
1461{
1462}
1463
1465{
1466 return cmd.write(connection);
1467}
1468
1470{
1471 return reply.read(connection);
1472}
1473
1474IAudioGrabberMsgs_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) :
1475 min_number_of_samples{min_number_of_samples},
1476 max_number_of_samples{max_number_of_samples},
1477 max_samples_timeout_s{max_samples_timeout_s}
1478{
1479}
1480
1482{
1483 yarp::os::idl::WireWriter writer(connection);
1484 if (!writer.writeListHeader(s_cmd_len)) {
1485 return false;
1486 }
1487 return write(writer);
1488}
1489
1491{
1492 yarp::os::idl::WireReader reader(connection);
1493 if (!reader.readListHeader()) {
1494 reader.fail();
1495 return false;
1496 }
1497 return read(reader);
1498}
1499
1501{
1502 if (!writeTag(writer)) {
1503 return false;
1504 }
1505 if (!writeArgs(writer)) {
1506 return false;
1507 }
1508 return true;
1509}
1510
1512{
1513 if (!writer.writeTag(s_tag, 1, s_tag_len)) {
1514 return false;
1515 }
1516 return true;
1517}
1518
1520{
1521 if (!writer.writeSizeT(min_number_of_samples)) {
1522 return false;
1523 }
1524 if (!writer.writeSizeT(max_number_of_samples)) {
1525 return false;
1526 }
1527 if (!writer.writeFloat64(max_samples_timeout_s)) {
1528 return false;
1529 }
1530 return true;
1531}
1532
1534{
1535 if (!readTag(reader)) {
1536 return false;
1537 }
1538 if (!readArgs(reader)) {
1539 return false;
1540 }
1541 return true;
1542}
1543
1545{
1546 std::string tag = reader.readTag(s_tag_len);
1547 if (reader.isError()) {
1548 return false;
1549 }
1550 if (tag != s_tag) {
1551 reader.fail();
1552 return false;
1553 }
1554 return true;
1555}
1556
1558{
1559 if (reader.noMore()) {
1560 reader.fail();
1561 return false;
1562 }
1563 if (!reader.readSizeT(min_number_of_samples)) {
1564 reader.fail();
1565 return false;
1566 }
1567 if (reader.noMore()) {
1568 reader.fail();
1569 return false;
1570 }
1571 if (!reader.readSizeT(max_number_of_samples)) {
1572 reader.fail();
1573 return false;
1574 }
1575 if (reader.noMore()) {
1576 reader.fail();
1577 return false;
1578 }
1579 if (!reader.readFloat64(max_samples_timeout_s)) {
1580 reader.fail();
1581 return false;
1582 }
1583 if (!reader.noMore()) {
1584 reader.fail();
1585 return false;
1586 }
1587 return true;
1588}
1589
1591{
1592 yarp::os::idl::WireWriter writer(connection);
1593 return write(writer);
1594}
1595
1597{
1598 yarp::os::idl::WireReader reader(connection);
1599 return read(reader);
1600}
1601
1603{
1604 if (!writer.isNull()) {
1605 if (!writer.writeListHeader(s_reply_len)) {
1606 return false;
1607 }
1608 if (!writer.write(return_helper)) {
1609 return false;
1610 }
1611 }
1612 return true;
1613}
1614
1616{
1617 if (!reader.readListReturn()) {
1618 return false;
1619 }
1620 if (reader.noMore()) {
1621 reader.fail();
1622 return false;
1623 }
1624 if (!reader.read(return_helper)) {
1625 reader.fail();
1626 return false;
1627 }
1628 return true;
1629}
1630
1635
1636// getRecordingAudioBufferMaxSize_RPC helper class implementation
1641
1646
1648{
1649 yarp::os::idl::WireWriter writer(connection);
1650 if (!writer.writeListHeader(s_cmd_len)) {
1651 return false;
1652 }
1653 return write(writer);
1654}
1655
1657{
1658 yarp::os::idl::WireReader reader(connection);
1659 if (!reader.readListHeader()) {
1660 reader.fail();
1661 return false;
1662 }
1663 return read(reader);
1664}
1665
1667{
1668 if (!writeTag(writer)) {
1669 return false;
1670 }
1671 if (!writeArgs(writer)) {
1672 return false;
1673 }
1674 return true;
1675}
1676
1678{
1679 if (!writer.writeTag(s_tag, 1, s_tag_len)) {
1680 return false;
1681 }
1682 return true;
1683}
1684
1686{
1687 return true;
1688}
1689
1691{
1692 if (!readTag(reader)) {
1693 return false;
1694 }
1695 if (!readArgs(reader)) {
1696 return false;
1697 }
1698 return true;
1699}
1700
1702{
1703 std::string tag = reader.readTag(s_tag_len);
1704 if (reader.isError()) {
1705 return false;
1706 }
1707 if (tag != s_tag) {
1708 reader.fail();
1709 return false;
1710 }
1711 return true;
1712}
1713
1715{
1716 if (!reader.noMore()) {
1717 reader.fail();
1718 return false;
1719 }
1720 return true;
1721}
1722
1728
1734
1736{
1737 if (!writer.isNull()) {
1738 if (!writer.writeListHeader(s_reply_len)) {
1739 return false;
1740 }
1741 if (!writer.write(return_helper)) {
1742 return false;
1743 }
1744 }
1745 return true;
1746}
1747
1749{
1750 if (!reader.readListReturn()) {
1751 return false;
1752 }
1753 if (reader.noMore()) {
1754 reader.fail();
1755 return false;
1756 }
1757 if (!reader.read(return_helper)) {
1758 reader.fail();
1759 return false;
1760 }
1761 return true;
1762}
1763
1768
1769// getRecordingAudioBufferCurrentSize_RPC helper class implementation
1774
1779
1781{
1782 yarp::os::idl::WireWriter writer(connection);
1783 if (!writer.writeListHeader(s_cmd_len)) {
1784 return false;
1785 }
1786 return write(writer);
1787}
1788
1790{
1791 yarp::os::idl::WireReader reader(connection);
1792 if (!reader.readListHeader()) {
1793 reader.fail();
1794 return false;
1795 }
1796 return read(reader);
1797}
1798
1800{
1801 if (!writeTag(writer)) {
1802 return false;
1803 }
1804 if (!writeArgs(writer)) {
1805 return false;
1806 }
1807 return true;
1808}
1809
1811{
1812 if (!writer.writeTag(s_tag, 1, s_tag_len)) {
1813 return false;
1814 }
1815 return true;
1816}
1817
1822
1824{
1825 if (!readTag(reader)) {
1826 return false;
1827 }
1828 if (!readArgs(reader)) {
1829 return false;
1830 }
1831 return true;
1832}
1833
1835{
1836 std::string tag = reader.readTag(s_tag_len);
1837 if (reader.isError()) {
1838 return false;
1839 }
1840 if (tag != s_tag) {
1841 reader.fail();
1842 return false;
1843 }
1844 return true;
1845}
1846
1848{
1849 if (!reader.noMore()) {
1850 reader.fail();
1851 return false;
1852 }
1853 return true;
1854}
1855
1861
1867
1869{
1870 if (!writer.isNull()) {
1871 if (!writer.writeListHeader(s_reply_len)) {
1872 return false;
1873 }
1874 if (!writer.write(return_helper)) {
1875 return false;
1876 }
1877 }
1878 return true;
1879}
1880
1882{
1883 if (!reader.readListReturn()) {
1884 return false;
1885 }
1886 if (reader.noMore()) {
1887 reader.fail();
1888 return false;
1889 }
1890 if (!reader.read(return_helper)) {
1891 reader.fail();
1892 return false;
1893 }
1894 return true;
1895}
1896
1901
1902// Constructor
1904{
1905 yarp().setOwner(*this);
1906}
1907
1909{
1910 if (!yarp().canWrite()) {
1911 yError("Missing server method '%s'?", IAudioGrabberMsgs_setHWGain_RPC_helper::s_prototype);
1912 }
1914 bool ok = yarp().write(helper, helper);
1916}
1917
1919{
1920 if (!yarp().canWrite()) {
1921 yError("Missing server method '%s'?", IAudioGrabberMsgs_setSWGain_RPC_helper::s_prototype);
1922 }
1924 bool ok = yarp().write(helper, helper);
1926}
1927
1937
1939{
1940 if (!yarp().canWrite()) {
1942 }
1944 bool ok = yarp().write(helper, helper);
1946}
1947
1949{
1950 if (!yarp().canWrite()) {
1952 }
1954 bool ok = yarp().write(helper, helper);
1956}
1957
1959{
1960 if (!yarp().canWrite()) {
1961 yError("Missing server method '%s'?", IAudioGrabberMsgs_isRecording_RPC_helper::s_prototype);
1962 }
1964 bool ok = yarp().write(helper, helper);
1965 if (!ok) {
1966 return_isRecording failed_reply{};
1968 return failed_reply;
1969 }
1970 return helper.reply.return_helper;
1971}
1972
1973return_getSound IAudioGrabberMsgs::getSound_RPC(const size_t min_number_of_samples, const size_t max_number_of_samples, const double max_samples_timeout_s)
1974{
1975 if (!yarp().canWrite()) {
1976 yError("Missing server method '%s'?", IAudioGrabberMsgs_getSound_RPC_helper::s_prototype);
1977 }
1978 IAudioGrabberMsgs_getSound_RPC_helper helper{min_number_of_samples, max_number_of_samples, max_samples_timeout_s};
1979 bool ok = yarp().write(helper, helper);
1980 if (!ok) {
1981 return_getSound failed_reply{};
1983 return failed_reply;
1984 }
1985 return helper.reply.return_helper;
1986}
1987
1989{
1990 if (!yarp().canWrite()) {
1992 }
1994 bool ok = yarp().write(helper, helper);
1995 if (!ok) {
1998 return failed_reply;
1999 }
2000 return helper.reply.return_helper;
2001}
2002
2004{
2005 if (!yarp().canWrite()) {
2007 }
2009 bool ok = yarp().write(helper, helper);
2010 if (!ok) {
2013 return failed_reply;
2014 }
2015 return helper.reply.return_helper;
2016}
2017
2018// help method
2019std::vector<std::string> IAudioGrabberMsgs::help(const std::string& functionName)
2020{
2021 bool showAll = (functionName == "--all");
2022 std::vector<std::string> helpString;
2023 if (showAll) {
2024 helpString.emplace_back("*** Available commands:");
2025 helpString.emplace_back(IAudioGrabberMsgs_setHWGain_RPC_helper::s_tag);
2026 helpString.emplace_back(IAudioGrabberMsgs_setSWGain_RPC_helper::s_tag);
2030 helpString.emplace_back(IAudioGrabberMsgs_isRecording_RPC_helper::s_tag);
2031 helpString.emplace_back(IAudioGrabberMsgs_getSound_RPC_helper::s_tag);
2034 helpString.emplace_back("help");
2035 } else {
2038 }
2041 }
2044 }
2047 }
2050 }
2053 }
2056 }
2059 }
2062 }
2063 if (functionName == "help") {
2064 helpString.emplace_back("std::vector<std::string> help(const std::string& functionName = \"--all\")");
2065 helpString.emplace_back("Return list of available commands, or help message for a specific function");
2066 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");
2067 helpString.emplace_back("@return list of strings (one string per line)");
2068 }
2069 }
2070 if (helpString.empty()) {
2071 helpString.emplace_back("Command not found");
2072 }
2073 return helpString;
2074}
2075
2076// read from ConnectionReader
2078{
2079 constexpr size_t max_tag_len = 2;
2080 size_t tag_len = 1;
2081
2082 yarp::os::idl::WireReader reader(connection);
2083 reader.expectAccept();
2084 if (!reader.readListHeader()) {
2085 reader.fail();
2086 return false;
2087 }
2088
2089 std::string tag = reader.readTag(1);
2090 bool direct = (tag == "__direct__");
2091 if (direct) {
2092 tag = reader.readTag(1);
2093 }
2094 while (tag_len <= max_tag_len && !reader.isError()) {
2095 if(tag == "getRemoteProtocolVersion") {
2096 if (!reader.noMore()) {
2097 yError("Reader invalid protocol?! %s:%d - %s", __FILE__, __LINE__, __YFUNCTION__);
2098 reader.fail();
2099 return false;
2100 }
2101
2102 auto proto = getLocalProtocolVersion();
2103
2104 yarp::os::idl::WireWriter writer(reader);
2105 if (!writer.writeListHeader(1)) {
2106 yWarning("Writer invalid protocol?! %s:%d - %s", __FILE__, __LINE__, __YFUNCTION__);
2107 return false;}
2108 if (!writer.write(proto)) {
2109 yWarning("Writer invalid protocol?! %s:%d - %s", __FILE__, __LINE__, __YFUNCTION__);
2110 return false;
2111 }
2112 reader.accept();
2113 return true;
2114 }
2117 if (!helper.cmd.readArgs(reader)) {
2118 return false;
2119 }
2120
2121 helper.call(this);
2122
2123 yarp::os::idl::WireWriter writer(reader);
2124 if (!helper.reply.write(writer)) {
2125 return false;
2126 }
2127 reader.accept();
2128 return true;
2129 }
2132 if (!helper.cmd.readArgs(reader)) {
2133 return false;
2134 }
2135
2136 helper.call(this);
2137
2138 yarp::os::idl::WireWriter writer(reader);
2139 if (!helper.reply.write(writer)) {
2140 return false;
2141 }
2142 reader.accept();
2143 return true;
2144 }
2147 if (!helper.cmd.readArgs(reader)) {
2148 return false;
2149 }
2150
2151 helper.call(this);
2152
2153 yarp::os::idl::WireWriter writer(reader);
2154 if (!helper.reply.write(writer)) {
2155 return false;
2156 }
2157 reader.accept();
2158 return true;
2159 }
2162 if (!helper.cmd.readArgs(reader)) {
2163 return false;
2164 }
2165
2166 helper.call(this);
2167
2168 yarp::os::idl::WireWriter writer(reader);
2169 if (!helper.reply.write(writer)) {
2170 return false;
2171 }
2172 reader.accept();
2173 return true;
2174 }
2177 if (!helper.cmd.readArgs(reader)) {
2178 return false;
2179 }
2180
2181 helper.call(this);
2182
2183 yarp::os::idl::WireWriter writer(reader);
2184 if (!helper.reply.write(writer)) {
2185 return false;
2186 }
2187 reader.accept();
2188 return true;
2189 }
2192 if (!helper.cmd.readArgs(reader)) {
2193 return false;
2194 }
2195
2196 helper.call(this);
2197
2198 yarp::os::idl::WireWriter writer(reader);
2199 if (!helper.reply.write(writer)) {
2200 return false;
2201 }
2202 reader.accept();
2203 return true;
2204 }
2207 if (!helper.cmd.readArgs(reader)) {
2208 return false;
2209 }
2210
2211 helper.call(this);
2212
2213 yarp::os::idl::WireWriter writer(reader);
2214 if (!helper.reply.write(writer)) {
2215 return false;
2216 }
2217 reader.accept();
2218 return true;
2219 }
2222 if (!helper.cmd.readArgs(reader)) {
2223 return false;
2224 }
2225
2226 helper.call(this);
2227
2228 yarp::os::idl::WireWriter writer(reader);
2229 if (!helper.reply.write(writer)) {
2230 return false;
2231 }
2232 reader.accept();
2233 return true;
2234 }
2237 if (!helper.cmd.readArgs(reader)) {
2238 return false;
2239 }
2240
2241 helper.call(this);
2242
2243 yarp::os::idl::WireWriter writer(reader);
2244 if (!helper.reply.write(writer)) {
2245 return false;
2246 }
2247 reader.accept();
2248 return true;
2249 }
2250 if (tag == "help") {
2251 std::string functionName;
2252 if (!reader.readString(functionName)) {
2253 functionName = "--all";
2254 }
2255 auto help_strings = help(functionName);
2256 yarp::os::idl::WireWriter writer(reader);
2257 if (!writer.isNull()) {
2258 if (!writer.writeListHeader(2)) {
2259 return false;
2260 }
2261 if (!writer.writeTag("many", 1, 0)) {
2262 return false;
2263 }
2264 if (!writer.writeListBegin(0, help_strings.size())) {
2265 return false;
2266 }
2267 for (const auto& help_string : help_strings) {
2268 if (!writer.writeString(help_string)) {
2269 return false;
2270 }
2271 }
2272 if (!writer.writeListEnd()) {
2273 return false;
2274 }
2275 }
2276 reader.accept();
2277 return true;
2278 }
2279 if (reader.noMore()) {
2280 reader.fail();
2281 return false;
2282 }
2283 std::string next_tag = reader.readTag(1);
2284 if (next_tag.empty()) {
2285 break;
2286 }
2287 tag.append("_").append(next_tag);
2288 tag_len = std::count(tag.begin(), tag.end(), '_') + 1;
2289 }
2290 return false;
2291}
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()
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 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