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 (based on compiler 0.14.1-yarped)
7// yarpidl_thrift version 2.0 - 11/11/2026
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
47public:
48 // Default constructor
49 BatteryData() = default;
50
51 // Constructor with field values
52 BatteryData(const double charge,
53 const double voltage,
54 const double current,
55 const double temperature,
56 const std::int32_t status);
57
58 // Read structure on a Wire
59 bool read(yarp::os::idl::WireReader& reader) override;
60
61 // Read structure on a Connection
62 bool read(yarp::os::ConnectionReader& connection) override;
63
64 // Write structure on a Wire
65 bool write(const yarp::os::idl::WireWriter& writer) const override;
66
67 // Write structure on a Connection
68 bool write(yarp::os::ConnectionWriter& connection) const override;
69
70 // Convert to a printable string
71 std::string toString() const;
72
73 // If you want to serialize this class without nesting, use this helper
75
76private:
77 // read/write charge field
78 bool read_charge(yarp::os::idl::WireReader& reader);
79 bool write_charge(const yarp::os::idl::WireWriter& writer) const;
80 bool nested_read_charge(yarp::os::idl::WireReader& reader);
81 bool nested_write_charge(const yarp::os::idl::WireWriter& writer) const;
82
83 // read/write voltage field
84 bool read_voltage(yarp::os::idl::WireReader& reader);
85 bool write_voltage(const yarp::os::idl::WireWriter& writer) const;
86 bool nested_read_voltage(yarp::os::idl::WireReader& reader);
87 bool nested_write_voltage(const yarp::os::idl::WireWriter& writer) const;
88
89 // read/write current field
90 bool read_current(yarp::os::idl::WireReader& reader);
91 bool write_current(const yarp::os::idl::WireWriter& writer) const;
92 bool nested_read_current(yarp::os::idl::WireReader& reader);
93 bool nested_write_current(const yarp::os::idl::WireWriter& writer) const;
94
95 // read/write temperature field
96 bool read_temperature(yarp::os::idl::WireReader& reader);
97 bool write_temperature(const yarp::os::idl::WireWriter& writer) const;
98 bool nested_read_temperature(yarp::os::idl::WireReader& reader);
99 bool nested_write_temperature(const yarp::os::idl::WireWriter& writer) const;
100
101 // read/write status field
102 bool read_status(yarp::os::idl::WireReader& reader);
103 bool write_status(const yarp::os::idl::WireWriter& writer) const;
104 bool nested_read_status(yarp::os::idl::WireReader& reader);
105 bool nested_write_status(const yarp::os::idl::WireWriter& writer) const;
106};
107
108} // namespace yarp::dev
109
110#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:74
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