YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
BatteryData.h
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#ifndef YARP_THRIFT_GENERATOR_STRUCT_BATTERYDATA_H
12#define YARP_THRIFT_GENERATOR_STRUCT_BATTERYDATA_H
13
14#include <yarp/dev/api.h>
15
16#include <yarp/os/Wire.h>
18
19namespace yarp::dev {
20
23{
24public:
25 // Fields
29 double charge{0.0};
33 double voltage{0.0};
37 double current{0.0};
41 double temperature{0.0};
45 std::int32_t status{3};
46
47 // Default constructor
48 BatteryData() = default;
49
50 // Constructor with field values
51 BatteryData(const double charge,
52 const double voltage,
53 const double current,
54 const double temperature,
55 const std::int32_t status);
56
57 // Read structure on a Wire
58 bool read(yarp::os::idl::WireReader& reader) override;
59
60 // Read structure on a Connection
61 bool read(yarp::os::ConnectionReader& connection) override;
62
63 // Write structure on a Wire
64 bool write(const yarp::os::idl::WireWriter& writer) const override;
65
66 // Write structure on a Connection
67 bool write(yarp::os::ConnectionWriter& connection) const override;
68
69 // Convert to a printable string
70 std::string toString() const;
71
72 // If you want to serialize this class without nesting, use this helper
74
75private:
76 // read/write charge field
77 bool read_charge(yarp::os::idl::WireReader& reader);
78 bool write_charge(const yarp::os::idl::WireWriter& writer) const;
79 bool nested_read_charge(yarp::os::idl::WireReader& reader);
80 bool nested_write_charge(const yarp::os::idl::WireWriter& writer) const;
81
82 // read/write voltage field
83 bool read_voltage(yarp::os::idl::WireReader& reader);
84 bool write_voltage(const yarp::os::idl::WireWriter& writer) const;
85 bool nested_read_voltage(yarp::os::idl::WireReader& reader);
86 bool nested_write_voltage(const yarp::os::idl::WireWriter& writer) const;
87
88 // read/write current field
89 bool read_current(yarp::os::idl::WireReader& reader);
90 bool write_current(const yarp::os::idl::WireWriter& writer) const;
91 bool nested_read_current(yarp::os::idl::WireReader& reader);
92 bool nested_write_current(const yarp::os::idl::WireWriter& writer) const;
93
94 // read/write temperature field
95 bool read_temperature(yarp::os::idl::WireReader& reader);
96 bool write_temperature(const yarp::os::idl::WireWriter& writer) const;
97 bool nested_read_temperature(yarp::os::idl::WireReader& reader);
98 bool nested_write_temperature(const yarp::os::idl::WireWriter& writer) const;
99
100 // read/write status field
101 bool read_status(yarp::os::idl::WireReader& reader);
102 bool write_status(const yarp::os::idl::WireWriter& writer) const;
103 bool nested_read_status(yarp::os::idl::WireReader& reader);
104 bool nested_write_status(const yarp::os::idl::WireWriter& writer) const;
105};
106
107} // namespace yarp::dev
108
109#endif // YARP_THRIFT_GENERATOR_STRUCT_BATTERYDATA_H
std::string toString(const T &value)
convert an arbitrary type to string.
yarp::os::idl::Unwrapped< BatteryData > unwrapped
Definition BatteryData.h:73
An interface for reading from a network connection.
An interface for writing to a network connection.
A "tamed" Portable, that promises to serialize itself in an IDL-friendly way.
IDL-friendly connection reader.
Definition WireReader.h:27
IDL-friendly connection writer.
Definition WireWriter.h:28
For streams capable of holding different kinds of content, check what they actually have.
#define YARP_dev_API
Definition api.h:18