YARP
Yet Another Robot Platform
FakeBatteryService.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2020 Istituto Italiano di Tecnologia (IIT)
3  * All rights reserved.
4  *
5  * This software may be modified and distributed under the terms of the
6  * BSD-3-Clause license. See the accompanying LICENSE file for details.
7  */
8 
9 // Autogenerated by Thrift Compiler (0.12.0-yarped)
10 //
11 // This is an automatically generated file.
12 // It could get re-generated if the ALLOW_IDL_GENERATION flag is on.
13 
14 #include <FakeBatteryService.h>
15 
16 #include <yarp/os/idl/WireTypes.h>
17 
19  public yarp::os::Portable
20 {
21 public:
22  explicit FakeBatteryService_setBatteryVoltage_helper(const double voltage);
23  bool write(yarp::os::ConnectionWriter& connection) const override;
24  bool read(yarp::os::ConnectionReader& connection) override;
25 
26  double m_voltage;
27 };
28 
30  m_voltage{voltage}
31 {
32 }
33 
35 {
36  yarp::os::idl::WireWriter writer(connection);
37  if (!writer.writeListHeader(2)) {
38  return false;
39  }
40  if (!writer.writeTag("setBatteryVoltage", 1, 1)) {
41  return false;
42  }
43  if (!writer.writeFloat64(m_voltage)) {
44  return false;
45  }
46  return true;
47 }
48 
50 {
51  YARP_UNUSED(connection);
52  return true;
53 }
54 
56  public yarp::os::Portable
57 {
58 public:
59  explicit FakeBatteryService_setBatteryCurrent_helper(const double current);
60  bool write(yarp::os::ConnectionWriter& connection) const override;
61  bool read(yarp::os::ConnectionReader& connection) override;
62 
63  double m_current;
64 };
65 
67  m_current{current}
68 {
69 }
70 
72 {
73  yarp::os::idl::WireWriter writer(connection);
74  if (!writer.writeListHeader(2)) {
75  return false;
76  }
77  if (!writer.writeTag("setBatteryCurrent", 1, 1)) {
78  return false;
79  }
80  if (!writer.writeFloat64(m_current)) {
81  return false;
82  }
83  return true;
84 }
85 
87 {
88  YARP_UNUSED(connection);
89  return true;
90 }
91 
93  public yarp::os::Portable
94 {
95 public:
96  explicit FakeBatteryService_setBatteryCharge_helper(const double charge);
97  bool write(yarp::os::ConnectionWriter& connection) const override;
98  bool read(yarp::os::ConnectionReader& connection) override;
99 
100  double m_charge;
101 };
102 
104  m_charge{charge}
105 {
106 }
107 
109 {
110  yarp::os::idl::WireWriter writer(connection);
111  if (!writer.writeListHeader(2)) {
112  return false;
113  }
114  if (!writer.writeTag("setBatteryCharge", 1, 1)) {
115  return false;
116  }
117  if (!writer.writeFloat64(m_charge)) {
118  return false;
119  }
120  return true;
121 }
122 
124 {
125  YARP_UNUSED(connection);
126  return true;
127 }
128 
130  public yarp::os::Portable
131 {
132 public:
133  explicit FakeBatteryService_setBatteryInfo_helper(const std::string& info);
134  bool write(yarp::os::ConnectionWriter& connection) const override;
135  bool read(yarp::os::ConnectionReader& connection) override;
136 
137  std::string m_info;
138 };
139 
141  m_info{info}
142 {
143 }
144 
146 {
147  yarp::os::idl::WireWriter writer(connection);
148  if (!writer.writeListHeader(2)) {
149  return false;
150  }
151  if (!writer.writeTag("setBatteryInfo", 1, 1)) {
152  return false;
153  }
154  if (!writer.writeString(m_info)) {
155  return false;
156  }
157  return true;
158 }
159 
161 {
162  YARP_UNUSED(connection);
163  return true;
164 }
165 
167  public yarp::os::Portable
168 {
169 public:
170  explicit FakeBatteryService_setBatteryTemperature_helper(const double temperature);
171  bool write(yarp::os::ConnectionWriter& connection) const override;
172  bool read(yarp::os::ConnectionReader& connection) override;
173 
175 };
176 
178  m_temperature{temperature}
179 {
180 }
181 
183 {
184  yarp::os::idl::WireWriter writer(connection);
185  if (!writer.writeListHeader(2)) {
186  return false;
187  }
188  if (!writer.writeTag("setBatteryTemperature", 1, 1)) {
189  return false;
190  }
191  if (!writer.writeFloat64(m_temperature)) {
192  return false;
193  }
194  return true;
195 }
196 
198 {
199  YARP_UNUSED(connection);
200  return true;
201 }
202 
204  public yarp::os::Portable
205 {
206 public:
208  bool write(yarp::os::ConnectionWriter& connection) const override;
209  bool read(yarp::os::ConnectionReader& connection) override;
210 
211  thread_local static double s_return_helper;
212 };
213 
215 
217 {
218  s_return_helper = {};
219 }
220 
222 {
223  yarp::os::idl::WireWriter writer(connection);
224  if (!writer.writeListHeader(1)) {
225  return false;
226  }
227  if (!writer.writeTag("getBatteryVoltage", 1, 1)) {
228  return false;
229  }
230  return true;
231 }
232 
234 {
235  yarp::os::idl::WireReader reader(connection);
236  if (!reader.readListReturn()) {
237  return false;
238  }
239  if (!reader.readFloat64(s_return_helper)) {
240  reader.fail();
241  return false;
242  }
243  return true;
244 }
245 
247  public yarp::os::Portable
248 {
249 public:
251  bool write(yarp::os::ConnectionWriter& connection) const override;
252  bool read(yarp::os::ConnectionReader& connection) override;
253 
254  thread_local static double s_return_helper;
255 };
256 
258 
260 {
261  s_return_helper = {};
262 }
263 
265 {
266  yarp::os::idl::WireWriter writer(connection);
267  if (!writer.writeListHeader(1)) {
268  return false;
269  }
270  if (!writer.writeTag("getBatteryCurrent", 1, 1)) {
271  return false;
272  }
273  return true;
274 }
275 
277 {
278  yarp::os::idl::WireReader reader(connection);
279  if (!reader.readListReturn()) {
280  return false;
281  }
282  if (!reader.readFloat64(s_return_helper)) {
283  reader.fail();
284  return false;
285  }
286  return true;
287 }
288 
290  public yarp::os::Portable
291 {
292 public:
294  bool write(yarp::os::ConnectionWriter& connection) const override;
295  bool read(yarp::os::ConnectionReader& connection) override;
296 
297  thread_local static double s_return_helper;
298 };
299 
301 
303 {
304  s_return_helper = {};
305 }
306 
308 {
309  yarp::os::idl::WireWriter writer(connection);
310  if (!writer.writeListHeader(1)) {
311  return false;
312  }
313  if (!writer.writeTag("getBatteryCharge", 1, 1)) {
314  return false;
315  }
316  return true;
317 }
318 
320 {
321  yarp::os::idl::WireReader reader(connection);
322  if (!reader.readListReturn()) {
323  return false;
324  }
325  if (!reader.readFloat64(s_return_helper)) {
326  reader.fail();
327  return false;
328  }
329  return true;
330 }
331 
333  public yarp::os::Portable
334 {
335 public:
337  bool write(yarp::os::ConnectionWriter& connection) const override;
338  bool read(yarp::os::ConnectionReader& connection) override;
339 
340  thread_local static std::string s_return_helper;
341 };
342 
344 
346 {
347  s_return_helper = {};
348 }
349 
351 {
352  yarp::os::idl::WireWriter writer(connection);
353  if (!writer.writeListHeader(1)) {
354  return false;
355  }
356  if (!writer.writeTag("getBatteryStatus", 1, 1)) {
357  return false;
358  }
359  return true;
360 }
361 
363 {
364  yarp::os::idl::WireReader reader(connection);
365  if (!reader.readListReturn()) {
366  return false;
367  }
368  if (!reader.readString(s_return_helper)) {
369  reader.fail();
370  return false;
371  }
372  return true;
373 }
374 
376  public yarp::os::Portable
377 {
378 public:
380  bool write(yarp::os::ConnectionWriter& connection) const override;
381  bool read(yarp::os::ConnectionReader& connection) override;
382 
383  thread_local static std::string s_return_helper;
384 };
385 
387 
389 {
390  s_return_helper = {};
391 }
392 
394 {
395  yarp::os::idl::WireWriter writer(connection);
396  if (!writer.writeListHeader(1)) {
397  return false;
398  }
399  if (!writer.writeTag("getBatteryInfo", 1, 1)) {
400  return false;
401  }
402  return true;
403 }
404 
406 {
407  yarp::os::idl::WireReader reader(connection);
408  if (!reader.readListReturn()) {
409  return false;
410  }
411  if (!reader.readString(s_return_helper)) {
412  reader.fail();
413  return false;
414  }
415  return true;
416 }
417 
419  public yarp::os::Portable
420 {
421 public:
423  bool write(yarp::os::ConnectionWriter& connection) const override;
424  bool read(yarp::os::ConnectionReader& connection) override;
425 
426  thread_local static double s_return_helper;
427 };
428 
430 
432 {
433  s_return_helper = {};
434 }
435 
437 {
438  yarp::os::idl::WireWriter writer(connection);
439  if (!writer.writeListHeader(1)) {
440  return false;
441  }
442  if (!writer.writeTag("getBatteryTemperature", 1, 1)) {
443  return false;
444  }
445  return true;
446 }
447 
449 {
450  yarp::os::idl::WireReader reader(connection);
451  if (!reader.readListReturn()) {
452  return false;
453  }
454  if (!reader.readFloat64(s_return_helper)) {
455  reader.fail();
456  return false;
457  }
458  return true;
459 }
460 
461 // Constructor
463 {
464  yarp().setOwner(*this);
465 }
466 
467 void FakeBatteryService::setBatteryVoltage(const double voltage)
468 {
470  if (!yarp().canWrite()) {
471  yError("Missing server method '%s'?", "void FakeBatteryService::setBatteryVoltage(const double voltage)");
472  }
473  yarp().write(helper);
474 }
475 
476 void FakeBatteryService::setBatteryCurrent(const double current)
477 {
479  if (!yarp().canWrite()) {
480  yError("Missing server method '%s'?", "void FakeBatteryService::setBatteryCurrent(const double current)");
481  }
482  yarp().write(helper);
483 }
484 
485 void FakeBatteryService::setBatteryCharge(const double charge)
486 {
488  if (!yarp().canWrite()) {
489  yError("Missing server method '%s'?", "void FakeBatteryService::setBatteryCharge(const double charge)");
490  }
491  yarp().write(helper);
492 }
493 
494 void FakeBatteryService::setBatteryInfo(const std::string& info)
495 {
497  if (!yarp().canWrite()) {
498  yError("Missing server method '%s'?", "void FakeBatteryService::setBatteryInfo(const std::string& info)");
499  }
500  yarp().write(helper);
501 }
502 
503 void FakeBatteryService::setBatteryTemperature(const double temperature)
504 {
506  if (!yarp().canWrite()) {
507  yError("Missing server method '%s'?", "void FakeBatteryService::setBatteryTemperature(const double temperature)");
508  }
509  yarp().write(helper);
510 }
511 
513 {
515  if (!yarp().canWrite()) {
516  yError("Missing server method '%s'?", "double FakeBatteryService::getBatteryVoltage()");
517  }
518  bool ok = yarp().write(helper, helper);
520 }
521 
523 {
525  if (!yarp().canWrite()) {
526  yError("Missing server method '%s'?", "double FakeBatteryService::getBatteryCurrent()");
527  }
528  bool ok = yarp().write(helper, helper);
530 }
531 
533 {
535  if (!yarp().canWrite()) {
536  yError("Missing server method '%s'?", "double FakeBatteryService::getBatteryCharge()");
537  }
538  bool ok = yarp().write(helper, helper);
540 }
541 
543 {
545  if (!yarp().canWrite()) {
546  yError("Missing server method '%s'?", "std::string FakeBatteryService::getBatteryStatus()");
547  }
548  bool ok = yarp().write(helper, helper);
550 }
551 
553 {
555  if (!yarp().canWrite()) {
556  yError("Missing server method '%s'?", "std::string FakeBatteryService::getBatteryInfo()");
557  }
558  bool ok = yarp().write(helper, helper);
560 }
561 
563 {
565  if (!yarp().canWrite()) {
566  yError("Missing server method '%s'?", "double FakeBatteryService::getBatteryTemperature()");
567  }
568  bool ok = yarp().write(helper, helper);
570 }
571 
572 // help method
573 std::vector<std::string> FakeBatteryService::help(const std::string& functionName)
574 {
575  bool showAll = (functionName == "--all");
576  std::vector<std::string> helpString;
577  if (showAll) {
578  helpString.emplace_back("*** Available commands:");
579  helpString.emplace_back("setBatteryVoltage");
580  helpString.emplace_back("setBatteryCurrent");
581  helpString.emplace_back("setBatteryCharge");
582  helpString.emplace_back("setBatteryInfo");
583  helpString.emplace_back("setBatteryTemperature");
584  helpString.emplace_back("getBatteryVoltage");
585  helpString.emplace_back("getBatteryCurrent");
586  helpString.emplace_back("getBatteryCharge");
587  helpString.emplace_back("getBatteryStatus");
588  helpString.emplace_back("getBatteryInfo");
589  helpString.emplace_back("getBatteryTemperature");
590  helpString.emplace_back("help");
591  } else {
592  if (functionName == "setBatteryVoltage") {
593  helpString.emplace_back("void setBatteryVoltage(const double voltage) ");
594  }
595  if (functionName == "setBatteryCurrent") {
596  helpString.emplace_back("void setBatteryCurrent(const double current) ");
597  }
598  if (functionName == "setBatteryCharge") {
599  helpString.emplace_back("void setBatteryCharge(const double charge) ");
600  }
601  if (functionName == "setBatteryInfo") {
602  helpString.emplace_back("void setBatteryInfo(const std::string& info) ");
603  }
604  if (functionName == "setBatteryTemperature") {
605  helpString.emplace_back("void setBatteryTemperature(const double temperature) ");
606  }
607  if (functionName == "getBatteryVoltage") {
608  helpString.emplace_back("double getBatteryVoltage() ");
609  }
610  if (functionName == "getBatteryCurrent") {
611  helpString.emplace_back("double getBatteryCurrent() ");
612  }
613  if (functionName == "getBatteryCharge") {
614  helpString.emplace_back("double getBatteryCharge() ");
615  }
616  if (functionName == "getBatteryStatus") {
617  helpString.emplace_back("std::string getBatteryStatus() ");
618  }
619  if (functionName == "getBatteryInfo") {
620  helpString.emplace_back("std::string getBatteryInfo() ");
621  }
622  if (functionName == "getBatteryTemperature") {
623  helpString.emplace_back("double getBatteryTemperature() ");
624  }
625  if (functionName == "help") {
626  helpString.emplace_back("std::vector<std::string> help(const std::string& functionName = \"--all\")");
627  helpString.emplace_back("Return list of available commands, or help message for a specific function");
628  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");
629  helpString.emplace_back("@return list of strings (one string per line)");
630  }
631  }
632  if (helpString.empty()) {
633  helpString.emplace_back("Command not found");
634  }
635  return helpString;
636 }
637 
638 // read from ConnectionReader
640 {
641  yarp::os::idl::WireReader reader(connection);
642  reader.expectAccept();
643  if (!reader.readListHeader()) {
644  reader.fail();
645  return false;
646  }
647 
648  std::string tag = reader.readTag();
649  bool direct = (tag == "__direct__");
650  if (direct) {
651  tag = reader.readTag();
652  }
653  while (!reader.isError()) {
654  if (tag == "setBatteryVoltage") {
655  double voltage;
656  if (!reader.readFloat64(voltage)) {
657  reader.fail();
658  return false;
659  }
660  if (!direct) {
662  yarp().callback(helper, *this, "__direct__");
663  } else {
664  setBatteryVoltage(voltage);
665  }
666  yarp::os::idl::WireWriter writer(reader);
667  if (!writer.isNull()) {
668  if (!writer.writeOnewayResponse()) {
669  return false;
670  }
671  }
672  reader.accept();
673  return true;
674  }
675  if (tag == "setBatteryCurrent") {
676  double current;
677  if (!reader.readFloat64(current)) {
678  reader.fail();
679  return false;
680  }
681  if (!direct) {
683  yarp().callback(helper, *this, "__direct__");
684  } else {
685  setBatteryCurrent(current);
686  }
687  yarp::os::idl::WireWriter writer(reader);
688  if (!writer.isNull()) {
689  if (!writer.writeOnewayResponse()) {
690  return false;
691  }
692  }
693  reader.accept();
694  return true;
695  }
696  if (tag == "setBatteryCharge") {
697  double charge;
698  if (!reader.readFloat64(charge)) {
699  reader.fail();
700  return false;
701  }
702  if (!direct) {
704  yarp().callback(helper, *this, "__direct__");
705  } else {
706  setBatteryCharge(charge);
707  }
708  yarp::os::idl::WireWriter writer(reader);
709  if (!writer.isNull()) {
710  if (!writer.writeOnewayResponse()) {
711  return false;
712  }
713  }
714  reader.accept();
715  return true;
716  }
717  if (tag == "setBatteryInfo") {
718  std::string info;
719  if (!reader.readString(info)) {
720  reader.fail();
721  return false;
722  }
723  if (!direct) {
725  yarp().callback(helper, *this, "__direct__");
726  } else {
727  setBatteryInfo(info);
728  }
729  yarp::os::idl::WireWriter writer(reader);
730  if (!writer.isNull()) {
731  if (!writer.writeOnewayResponse()) {
732  return false;
733  }
734  }
735  reader.accept();
736  return true;
737  }
738  if (tag == "setBatteryTemperature") {
739  double temperature;
740  if (!reader.readFloat64(temperature)) {
741  reader.fail();
742  return false;
743  }
744  if (!direct) {
746  yarp().callback(helper, *this, "__direct__");
747  } else {
748  setBatteryTemperature(temperature);
749  }
750  yarp::os::idl::WireWriter writer(reader);
751  if (!writer.isNull()) {
752  if (!writer.writeOnewayResponse()) {
753  return false;
754  }
755  }
756  reader.accept();
757  return true;
758  }
759  if (tag == "getBatteryVoltage") {
761  yarp::os::idl::WireWriter writer(reader);
762  if (!writer.isNull()) {
763  if (!writer.writeListHeader(1)) {
764  return false;
765  }
767  return false;
768  }
769  }
770  reader.accept();
771  return true;
772  }
773  if (tag == "getBatteryCurrent") {
775  yarp::os::idl::WireWriter writer(reader);
776  if (!writer.isNull()) {
777  if (!writer.writeListHeader(1)) {
778  return false;
779  }
781  return false;
782  }
783  }
784  reader.accept();
785  return true;
786  }
787  if (tag == "getBatteryCharge") {
789  yarp::os::idl::WireWriter writer(reader);
790  if (!writer.isNull()) {
791  if (!writer.writeListHeader(1)) {
792  return false;
793  }
795  return false;
796  }
797  }
798  reader.accept();
799  return true;
800  }
801  if (tag == "getBatteryStatus") {
803  yarp::os::idl::WireWriter writer(reader);
804  if (!writer.isNull()) {
805  if (!writer.writeListHeader(1)) {
806  return false;
807  }
809  return false;
810  }
811  }
812  reader.accept();
813  return true;
814  }
815  if (tag == "getBatteryInfo") {
817  yarp::os::idl::WireWriter writer(reader);
818  if (!writer.isNull()) {
819  if (!writer.writeListHeader(1)) {
820  return false;
821  }
823  return false;
824  }
825  }
826  reader.accept();
827  return true;
828  }
829  if (tag == "getBatteryTemperature") {
831  yarp::os::idl::WireWriter writer(reader);
832  if (!writer.isNull()) {
833  if (!writer.writeListHeader(1)) {
834  return false;
835  }
837  return false;
838  }
839  }
840  reader.accept();
841  return true;
842  }
843  if (tag == "help") {
844  std::string functionName;
845  if (!reader.readString(functionName)) {
846  functionName = "--all";
847  }
848  auto help_strings = help(functionName);
849  yarp::os::idl::WireWriter writer(reader);
850  if (!writer.isNull()) {
851  if (!writer.writeListHeader(2)) {
852  return false;
853  }
854  if (!writer.writeTag("many", 1, 0)) {
855  return false;
856  }
857  if (!writer.writeListBegin(BOTTLE_TAG_INT32, static_cast<uint32_t>(help_strings.size()))) {
858  return false;
859  }
860  for (const auto& help_string : help_strings) {
861  if (!writer.writeString(help_string)) {
862  return false;
863  }
864  }
865  if (!writer.writeListEnd()) {
866  return false;
867  }
868  }
869  reader.accept();
870  return true;
871  }
872  if (reader.noMore()) {
873  reader.fail();
874  return false;
875  }
876  std::string next_tag = reader.readTag();
877  if (next_tag == "") {
878  break;
879  }
880  tag.append("_").append(next_tag);
881  }
882  return false;
883 }
FakeBatteryService::getBatteryTemperature
virtual double getBatteryTemperature()
Definition: FakeBatteryService.cpp:562
FakeBatteryService_setBatteryCurrent_helper::m_current
double m_current
Definition: FakeBatteryService.cpp:63
yarp::os::idl::WireReader::readListReturn
bool readListReturn()
Definition: WireReader.cpp:501
FakeBatteryService_setBatteryCurrent_helper::FakeBatteryService_setBatteryCurrent_helper
FakeBatteryService_setBatteryCurrent_helper(const double current)
Definition: FakeBatteryService.cpp:66
FakeBatteryService::setBatteryTemperature
virtual void setBatteryTemperature(const double temperature)
Definition: FakeBatteryService.cpp:503
yarp::os::idl::WireReader::noMore
bool noMore()
Definition: WireReader.cpp:628
yarp::os::idl::WireReader::readString
bool readString(std::string &str, bool *is_vocab=nullptr)
Definition: WireReader.cpp:339
yarp::os::Portable
This is a base class for objects that can be both read from and be written to the YARP network.
Definition: Portable.h:29
FakeBatteryService.h
FakeBatteryService_getBatteryCharge_helper
Definition: FakeBatteryService.cpp:291
FakeBatteryService_setBatteryCharge_helper::read
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
Definition: FakeBatteryService.cpp:123
FakeBatteryService_setBatteryCurrent_helper::write
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
Definition: FakeBatteryService.cpp:71
FakeBatteryService_getBatteryTemperature_helper
Definition: FakeBatteryService.cpp:420
FakeBatteryService::getBatteryCurrent
virtual double getBatteryCurrent()
Definition: FakeBatteryService.cpp:522
FakeBatteryService_getBatteryCurrent_helper::s_return_helper
static thread_local double s_return_helper
Definition: FakeBatteryService.cpp:254
yarp::os::idl::WireWriter::writeFloat64
bool writeFloat64(yarp::conf::float64_t x) const
Definition: WireWriter.cpp:117
yarp::os::idl::WireWriter::writeOnewayResponse
bool writeOnewayResponse() const
Definition: WireWriter.cpp:242
FakeBatteryService_getBatteryVoltage_helper::s_return_helper
static thread_local double s_return_helper
Definition: FakeBatteryService.cpp:211
FakeBatteryService_getBatteryVoltage_helper
Definition: FakeBatteryService.cpp:205
WireTypes.h
FakeBatteryService::setBatteryCurrent
virtual void setBatteryCurrent(const double current)
Definition: FakeBatteryService.cpp:476
FakeBatteryService::getBatteryCharge
virtual double getBatteryCharge()
Definition: FakeBatteryService.cpp:532
FakeBatteryService_setBatteryTemperature_helper::read
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
Definition: FakeBatteryService.cpp:197
FakeBatteryService_setBatteryCurrent_helper
Definition: FakeBatteryService.cpp:57
FakeBatteryService_getBatteryStatus_helper::read
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
Definition: FakeBatteryService.cpp:362
FakeBatteryService::getBatteryStatus
virtual std::string getBatteryStatus()
Definition: FakeBatteryService.cpp:542
FakeBatteryService_getBatteryCurrent_helper::FakeBatteryService_getBatteryCurrent_helper
FakeBatteryService_getBatteryCurrent_helper()
Definition: FakeBatteryService.cpp:259
FakeBatteryService_getBatteryVoltage_helper::write
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
Definition: FakeBatteryService.cpp:221
FakeBatteryService_getBatteryInfo_helper::s_return_helper
static thread_local std::string s_return_helper
Definition: FakeBatteryService.cpp:383
FakeBatteryService_setBatteryInfo_helper::FakeBatteryService_setBatteryInfo_helper
FakeBatteryService_setBatteryInfo_helper(const std::string &info)
Definition: FakeBatteryService.cpp:140
yarp::os::idl::WireWriter::writeString
bool writeString(const std::string &tag) const
Definition: WireWriter.cpp:166
YARP_UNUSED
#define YARP_UNUSED(var)
Definition: api.h:159
FakeBatteryService_getBatteryCharge_helper::write
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
Definition: FakeBatteryService.cpp:307
yarp::os::idl::WireWriter::isNull
bool isNull() const
Definition: WireWriter.cpp:50
FakeBatteryService_setBatteryVoltage_helper::FakeBatteryService_setBatteryVoltage_helper
FakeBatteryService_setBatteryVoltage_helper(const double voltage)
Definition: FakeBatteryService.cpp:29
yarp::os::idl::WireReader::readTag
std::string readTag()
Definition: WireReader.cpp:552
FakeBatteryService_setBatteryInfo_helper::write
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
Definition: FakeBatteryService.cpp:145
yError
#define yError(...)
Definition: Log.h:282
FakeBatteryService::FakeBatteryService
FakeBatteryService()
Definition: FakeBatteryService.cpp:462
yarp::os::idl::WireWriter::writeListHeader
bool writeListHeader(int len) const
Definition: WireWriter.cpp:183
FakeBatteryService_getBatteryCharge_helper::read
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
Definition: FakeBatteryService.cpp:319
BOTTLE_TAG_INT32
#define BOTTLE_TAG_INT32
Definition: Bottle.h:23
FakeBatteryService_setBatteryInfo_helper::read
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
Definition: FakeBatteryService.cpp:160
yarp::os::idl::WireWriter
IDL-friendly connection writer.
Definition: WireWriter.h:33
FakeBatteryService_setBatteryVoltage_helper::write
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
Definition: FakeBatteryService.cpp:34
FakeBatteryService::setBatteryVoltage
virtual void setBatteryVoltage(const double voltage)
Definition: FakeBatteryService.cpp:467
FakeBatteryService_getBatteryInfo_helper
Definition: FakeBatteryService.cpp:377
FakeBatteryService_setBatteryTemperature_helper
Definition: FakeBatteryService.cpp:168
FakeBatteryService_setBatteryTemperature_helper::write
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
Definition: FakeBatteryService.cpp:182
FakeBatteryService_setBatteryCharge_helper::write
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
Definition: FakeBatteryService.cpp:108
FakeBatteryService_setBatteryCurrent_helper::read
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
Definition: FakeBatteryService.cpp:86
FakeBatteryService_getBatteryCurrent_helper::read
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
Definition: FakeBatteryService.cpp:276
FakeBatteryService_setBatteryInfo_helper
Definition: FakeBatteryService.cpp:131
FakeBatteryService_setBatteryInfo_helper::m_info
std::string m_info
Definition: FakeBatteryService.cpp:137
FakeBatteryService_getBatteryTemperature_helper::FakeBatteryService_getBatteryTemperature_helper
FakeBatteryService_getBatteryTemperature_helper()
Definition: FakeBatteryService.cpp:431
FakeBatteryService_setBatteryTemperature_helper::m_temperature
double m_temperature
Definition: FakeBatteryService.cpp:174
yarp::os::ConnectionWriter
An interface for writing to a network connection.
Definition: ConnectionWriter.h:40
yarp::os::idl::WireReader::expectAccept
void expectAccept()
Definition: WireReader.cpp:43
FakeBatteryService_getBatteryTemperature_helper::write
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
Definition: FakeBatteryService.cpp:436
FakeBatteryService_getBatteryCharge_helper::FakeBatteryService_getBatteryCharge_helper
FakeBatteryService_getBatteryCharge_helper()
Definition: FakeBatteryService.cpp:302
FakeBatteryService_setBatteryTemperature_helper::FakeBatteryService_setBatteryTemperature_helper
FakeBatteryService_setBatteryTemperature_helper(const double temperature)
Definition: FakeBatteryService.cpp:177
FakeBatteryService_setBatteryCharge_helper
Definition: FakeBatteryService.cpp:94
FakeBatteryService_getBatteryInfo_helper::FakeBatteryService_getBatteryInfo_helper
FakeBatteryService_getBatteryInfo_helper()
Definition: FakeBatteryService.cpp:388
FakeBatteryService_getBatteryCurrent_helper
Definition: FakeBatteryService.cpp:248
FakeBatteryService_getBatteryStatus_helper::write
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
Definition: FakeBatteryService.cpp:350
FakeBatteryService::read
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
Definition: FakeBatteryService.cpp:639
FakeBatteryService::setBatteryCharge
virtual void setBatteryCharge(const double charge)
Definition: FakeBatteryService.cpp:485
FakeBatteryService_getBatteryInfo_helper::write
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
Definition: FakeBatteryService.cpp:393
FakeBatteryService_getBatteryTemperature_helper::read
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
Definition: FakeBatteryService.cpp:448
FakeBatteryService_getBatteryTemperature_helper::s_return_helper
static thread_local double s_return_helper
Definition: FakeBatteryService.cpp:426
FakeBatteryService_setBatteryCharge_helper::m_charge
double m_charge
Definition: FakeBatteryService.cpp:100
yarp::os::idl::WireWriter::writeTag
bool writeTag(const char *tag, int split, int len) const
Definition: WireWriter.cpp:141
yarp::os::idl::WireReader
IDL-friendly connection reader.
Definition: WireReader.h:33
yarp::os::ConnectionReader
An interface for reading from a network connection.
Definition: ConnectionReader.h:40
yarp::os::idl::WireReader::fail
void fail()
Definition: WireReader.cpp:74
yarp::os::Wire::yarp
yarp::os::WireLink & yarp()
Get YARP state associated with this object.
Definition: Wire.h:34
FakeBatteryService_getBatteryCurrent_helper::write
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
Definition: FakeBatteryService.cpp:264
FakeBatteryService::getBatteryVoltage
virtual double getBatteryVoltage()
Definition: FakeBatteryService.cpp:512
FakeBatteryService::setBatteryInfo
virtual void setBatteryInfo(const std::string &info)
Definition: FakeBatteryService.cpp:494
FakeBatteryService_getBatteryVoltage_helper::FakeBatteryService_getBatteryVoltage_helper
FakeBatteryService_getBatteryVoltage_helper()
Definition: FakeBatteryService.cpp:216
FakeBatteryService_getBatteryStatus_helper
Definition: FakeBatteryService.cpp:334
yarp::os::idl::WireWriter::writeListBegin
bool writeListBegin(int tag, std::uint32_t len) const
Definition: WireWriter.cpp:204
yarp::os::idl::WireReader::accept
void accept()
Definition: WireReader.cpp:49
FakeBatteryService::getBatteryInfo
virtual std::string getBatteryInfo()
Definition: FakeBatteryService.cpp:552
FakeBatteryService_setBatteryVoltage_helper
Definition: FakeBatteryService.cpp:20
FakeBatteryService_getBatteryCharge_helper::s_return_helper
static thread_local double s_return_helper
Definition: FakeBatteryService.cpp:297
yarp::os::idl::WireWriter::writeListEnd
bool writeListEnd() const
Definition: WireWriter.cpp:227
FakeBatteryService_getBatteryVoltage_helper::read
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
Definition: FakeBatteryService.cpp:233
FakeBatteryService_getBatteryStatus_helper::FakeBatteryService_getBatteryStatus_helper
FakeBatteryService_getBatteryStatus_helper()
Definition: FakeBatteryService.cpp:345
FakeBatteryService_getBatteryInfo_helper::read
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
Definition: FakeBatteryService.cpp:405
FakeBatteryService_setBatteryVoltage_helper::m_voltage
double m_voltage
Definition: FakeBatteryService.cpp:26
FakeBatteryService_setBatteryCharge_helper::FakeBatteryService_setBatteryCharge_helper
FakeBatteryService_setBatteryCharge_helper(const double charge)
Definition: FakeBatteryService.cpp:103
yarp::os::idl::WireReader::readFloat64
bool readFloat64(yarp::conf::float64_t &x)
Definition: WireReader.cpp:279
FakeBatteryService_getBatteryStatus_helper::s_return_helper
static thread_local std::string s_return_helper
Definition: FakeBatteryService.cpp:340
FakeBatteryService::help
virtual std::vector< std::string > help(const std::string &functionName="--all")
Definition: FakeBatteryService.cpp:573
FakeBatteryService_setBatteryVoltage_helper::read
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
Definition: FakeBatteryService.cpp:49
yarp::os::idl::WireReader::readListHeader
bool readListHeader()
Definition: WireReader.cpp:470
yarp::os::idl::WireReader::isError
bool isError()
Definition: WireReader.cpp:547