-
Notifications
You must be signed in to change notification settings - Fork 1
/
imus_generated.h
240 lines (221 loc) · 7.74 KB
/
imus_generated.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
// automatically generated by the FlatBuffers compiler, do not modify
#ifndef FLATBUFFERS_GENERATED_IMUS_H_
#define FLATBUFFERS_GENERATED_IMUS_H_
#include "flatbuffers/flatbuffers.h"
struct Imu;
struct ImuBuilder;
struct ImuPacket;
struct ImuPacketBuilder;
struct Imu FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
typedef ImuBuilder Builder;
enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
VT_T = 4,
VT_TEMPERATURE = 6,
VT_ACCELEROMETER_X = 8,
VT_ACCELEROMETER_Y = 10,
VT_ACCELEROMETER_Z = 12,
VT_GYROSCOPE_X = 14,
VT_GYROSCOPE_Y = 16,
VT_GYROSCOPE_Z = 18,
VT_MAGNETOMETER_X = 20,
VT_MAGNETOMETER_Y = 22,
VT_MAGNETOMETER_Z = 24
};
int64_t t() const {
return GetField<int64_t>(VT_T, 0);
}
float temperature() const {
return GetField<float>(VT_TEMPERATURE, 0.0f);
}
float accelerometer_x() const {
return GetField<float>(VT_ACCELEROMETER_X, 0.0f);
}
float accelerometer_y() const {
return GetField<float>(VT_ACCELEROMETER_Y, 0.0f);
}
float accelerometer_z() const {
return GetField<float>(VT_ACCELEROMETER_Z, 0.0f);
}
float gyroscope_x() const {
return GetField<float>(VT_GYROSCOPE_X, 0.0f);
}
float gyroscope_y() const {
return GetField<float>(VT_GYROSCOPE_Y, 0.0f);
}
float gyroscope_z() const {
return GetField<float>(VT_GYROSCOPE_Z, 0.0f);
}
float magnetometer_x() const {
return GetField<float>(VT_MAGNETOMETER_X, 0.0f);
}
float magnetometer_y() const {
return GetField<float>(VT_MAGNETOMETER_Y, 0.0f);
}
float magnetometer_z() const {
return GetField<float>(VT_MAGNETOMETER_Z, 0.0f);
}
bool Verify(flatbuffers::Verifier &verifier) const {
return VerifyTableStart(verifier) &&
VerifyField<int64_t>(verifier, VT_T) &&
VerifyField<float>(verifier, VT_TEMPERATURE) &&
VerifyField<float>(verifier, VT_ACCELEROMETER_X) &&
VerifyField<float>(verifier, VT_ACCELEROMETER_Y) &&
VerifyField<float>(verifier, VT_ACCELEROMETER_Z) &&
VerifyField<float>(verifier, VT_GYROSCOPE_X) &&
VerifyField<float>(verifier, VT_GYROSCOPE_Y) &&
VerifyField<float>(verifier, VT_GYROSCOPE_Z) &&
VerifyField<float>(verifier, VT_MAGNETOMETER_X) &&
VerifyField<float>(verifier, VT_MAGNETOMETER_Y) &&
VerifyField<float>(verifier, VT_MAGNETOMETER_Z) &&
verifier.EndTable();
}
};
struct ImuBuilder {
typedef Imu Table;
flatbuffers::FlatBufferBuilder &fbb_;
flatbuffers::uoffset_t start_;
void add_t(int64_t t) {
fbb_.AddElement<int64_t>(Imu::VT_T, t, 0);
}
void add_temperature(float temperature) {
fbb_.AddElement<float>(Imu::VT_TEMPERATURE, temperature, 0.0f);
}
void add_accelerometer_x(float accelerometer_x) {
fbb_.AddElement<float>(Imu::VT_ACCELEROMETER_X, accelerometer_x, 0.0f);
}
void add_accelerometer_y(float accelerometer_y) {
fbb_.AddElement<float>(Imu::VT_ACCELEROMETER_Y, accelerometer_y, 0.0f);
}
void add_accelerometer_z(float accelerometer_z) {
fbb_.AddElement<float>(Imu::VT_ACCELEROMETER_Z, accelerometer_z, 0.0f);
}
void add_gyroscope_x(float gyroscope_x) {
fbb_.AddElement<float>(Imu::VT_GYROSCOPE_X, gyroscope_x, 0.0f);
}
void add_gyroscope_y(float gyroscope_y) {
fbb_.AddElement<float>(Imu::VT_GYROSCOPE_Y, gyroscope_y, 0.0f);
}
void add_gyroscope_z(float gyroscope_z) {
fbb_.AddElement<float>(Imu::VT_GYROSCOPE_Z, gyroscope_z, 0.0f);
}
void add_magnetometer_x(float magnetometer_x) {
fbb_.AddElement<float>(Imu::VT_MAGNETOMETER_X, magnetometer_x, 0.0f);
}
void add_magnetometer_y(float magnetometer_y) {
fbb_.AddElement<float>(Imu::VT_MAGNETOMETER_Y, magnetometer_y, 0.0f);
}
void add_magnetometer_z(float magnetometer_z) {
fbb_.AddElement<float>(Imu::VT_MAGNETOMETER_Z, magnetometer_z, 0.0f);
}
explicit ImuBuilder(flatbuffers::FlatBufferBuilder &_fbb)
: fbb_(_fbb) {
start_ = fbb_.StartTable();
}
ImuBuilder &operator=(const ImuBuilder &);
flatbuffers::Offset<Imu> Finish() {
const auto end = fbb_.EndTable(start_);
auto o = flatbuffers::Offset<Imu>(end);
return o;
}
};
inline flatbuffers::Offset<Imu> CreateImu(
flatbuffers::FlatBufferBuilder &_fbb,
int64_t t = 0,
float temperature = 0.0f,
float accelerometer_x = 0.0f,
float accelerometer_y = 0.0f,
float accelerometer_z = 0.0f,
float gyroscope_x = 0.0f,
float gyroscope_y = 0.0f,
float gyroscope_z = 0.0f,
float magnetometer_x = 0.0f,
float magnetometer_y = 0.0f,
float magnetometer_z = 0.0f) {
ImuBuilder builder_(_fbb);
builder_.add_t(t);
builder_.add_magnetometer_z(magnetometer_z);
builder_.add_magnetometer_y(magnetometer_y);
builder_.add_magnetometer_x(magnetometer_x);
builder_.add_gyroscope_z(gyroscope_z);
builder_.add_gyroscope_y(gyroscope_y);
builder_.add_gyroscope_x(gyroscope_x);
builder_.add_accelerometer_z(accelerometer_z);
builder_.add_accelerometer_y(accelerometer_y);
builder_.add_accelerometer_x(accelerometer_x);
builder_.add_temperature(temperature);
return builder_.Finish();
}
struct ImuPacket FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
typedef ImuPacketBuilder Builder;
enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
VT_ELEMENTS = 4
};
const flatbuffers::Vector<flatbuffers::Offset<Imu>> *elements() const {
return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<Imu>> *>(VT_ELEMENTS);
}
bool Verify(flatbuffers::Verifier &verifier) const {
return VerifyTableStart(verifier) &&
VerifyOffset(verifier, VT_ELEMENTS) &&
verifier.VerifyVector(elements()) &&
verifier.VerifyVectorOfTables(elements()) &&
verifier.EndTable();
}
};
struct ImuPacketBuilder {
typedef ImuPacket Table;
flatbuffers::FlatBufferBuilder &fbb_;
flatbuffers::uoffset_t start_;
void add_elements(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<Imu>>> elements) {
fbb_.AddOffset(ImuPacket::VT_ELEMENTS, elements);
}
explicit ImuPacketBuilder(flatbuffers::FlatBufferBuilder &_fbb)
: fbb_(_fbb) {
start_ = fbb_.StartTable();
}
ImuPacketBuilder &operator=(const ImuPacketBuilder &);
flatbuffers::Offset<ImuPacket> Finish() {
const auto end = fbb_.EndTable(start_);
auto o = flatbuffers::Offset<ImuPacket>(end);
return o;
}
};
inline flatbuffers::Offset<ImuPacket> CreateImuPacket(
flatbuffers::FlatBufferBuilder &_fbb,
flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<Imu>>> elements = 0) {
ImuPacketBuilder builder_(_fbb);
builder_.add_elements(elements);
return builder_.Finish();
}
inline flatbuffers::Offset<ImuPacket> CreateImuPacketDirect(
flatbuffers::FlatBufferBuilder &_fbb,
const std::vector<flatbuffers::Offset<Imu>> *elements = nullptr) {
auto elements__ = elements ? _fbb.CreateVector<flatbuffers::Offset<Imu>>(*elements) : 0;
return CreateImuPacket(
_fbb,
elements__);
}
inline const ImuPacket *GetImuPacket(const void *buf) {
return flatbuffers::GetRoot<ImuPacket>(buf);
}
inline const ImuPacket *GetSizePrefixedImuPacket(const void *buf) {
return flatbuffers::GetSizePrefixedRoot<ImuPacket>(buf);
}
inline bool VerifyImuPacketBuffer(
flatbuffers::Verifier &verifier) {
return verifier.VerifyBuffer<ImuPacket>(nullptr);
}
inline bool VerifySizePrefixedImuPacketBuffer(
flatbuffers::Verifier &verifier) {
return verifier.VerifySizePrefixedBuffer<ImuPacket>(nullptr);
}
inline void FinishImuPacketBuffer(
flatbuffers::FlatBufferBuilder &fbb,
flatbuffers::Offset<ImuPacket> root) {
fbb.Finish(root);
}
inline void FinishSizePrefixedImuPacketBuffer(
flatbuffers::FlatBufferBuilder &fbb,
flatbuffers::Offset<ImuPacket> root) {
fbb.FinishSizePrefixed(root);
}
#endif // FLATBUFFERS_GENERATED_IMUS_H_