blob: 9875785b01132795b1480f518ca11e46bb50043d [file] [log] [blame]
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001// automatically generated by the FlatBuffers compiler, do not modify
2
3
4#ifndef FLATBUFFERS_GENERATED_ARRAYSTEST_MYGAME_EXAMPLE_H_
5#define FLATBUFFERS_GENERATED_ARRAYSTEST_MYGAME_EXAMPLE_H_
6
7#include "flatbuffers/flatbuffers.h"
8
9namespace MyGame {
10namespace Example {
11
12struct NestedStruct;
13
14struct ArrayStruct;
15
16struct ArrayTable;
17struct ArrayTableT;
18
19bool operator==(const NestedStruct &lhs, const NestedStruct &rhs);
20bool operator!=(const NestedStruct &lhs, const NestedStruct &rhs);
21bool operator==(const ArrayStruct &lhs, const ArrayStruct &rhs);
22bool operator!=(const ArrayStruct &lhs, const ArrayStruct &rhs);
23bool operator==(const ArrayTableT &lhs, const ArrayTableT &rhs);
24bool operator!=(const ArrayTableT &lhs, const ArrayTableT &rhs);
25
26inline const flatbuffers::TypeTable *NestedStructTypeTable();
27
28inline const flatbuffers::TypeTable *ArrayStructTypeTable();
29
30inline const flatbuffers::TypeTable *ArrayTableTypeTable();
31
32enum class TestEnum : int8_t {
33 A = 0,
34 B = 1,
35 C = 2,
36 MIN = A,
37 MAX = C
38};
39
40inline const TestEnum (&EnumValuesTestEnum())[3] {
41 static const TestEnum values[] = {
42 TestEnum::A,
43 TestEnum::B,
44 TestEnum::C
45 };
46 return values;
47}
48
49inline const char * const *EnumNamesTestEnum() {
50 static const char * const names[4] = {
51 "A",
52 "B",
53 "C",
54 nullptr
55 };
56 return names;
57}
58
59inline const char *EnumNameTestEnum(TestEnum e) {
60 if (e < TestEnum::A || e > TestEnum::C) return "";
61 const size_t index = static_cast<size_t>(e);
62 return EnumNamesTestEnum()[index];
63}
64
65FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) NestedStruct FLATBUFFERS_FINAL_CLASS {
66 private:
67 int32_t a_[2];
68 int8_t b_;
69 int8_t c_[2];
70 int8_t padding0__;
71
72 public:
73 static const flatbuffers::TypeTable *MiniReflectTypeTable() {
74 return NestedStructTypeTable();
75 }
76 NestedStruct() {
77 memset(static_cast<void *>(this), 0, sizeof(NestedStruct));
78 }
79 NestedStruct(MyGame::Example::TestEnum _b)
80 : b_(flatbuffers::EndianScalar(static_cast<int8_t>(_b))) {
81 std::memset(a_, 0, sizeof(a_));
82 std::memset(c_, 0, sizeof(c_));
83 (void)padding0__;
84 }
85 const flatbuffers::Array<int32_t, 2> *a() const {
86 return reinterpret_cast<const flatbuffers::Array<int32_t, 2> *>(a_);
87 }
88 flatbuffers::Array<int32_t, 2> *mutable_a() {
89 return reinterpret_cast<flatbuffers::Array<int32_t, 2> *>(a_);
90 }
91 MyGame::Example::TestEnum b() const {
92 return static_cast<MyGame::Example::TestEnum>(flatbuffers::EndianScalar(b_));
93 }
94 void mutate_b(MyGame::Example::TestEnum _b) {
95 flatbuffers::WriteScalar(&b_, static_cast<int8_t>(_b));
96 }
97 const flatbuffers::Array<MyGame::Example::TestEnum, 2> *c() const {
98 return reinterpret_cast<const flatbuffers::Array<MyGame::Example::TestEnum, 2> *>(c_);
99 }
100 flatbuffers::Array<MyGame::Example::TestEnum, 2> *mutable_c() {
101 return reinterpret_cast<flatbuffers::Array<MyGame::Example::TestEnum, 2> *>(c_);
102 }
103};
104FLATBUFFERS_STRUCT_END(NestedStruct, 12);
105
106inline bool operator==(const NestedStruct &lhs, const NestedStruct &rhs) {
107 return
108 (lhs.a() == rhs.a()) &&
109 (lhs.b() == rhs.b()) &&
110 (lhs.c() == rhs.c());
111}
112
113inline bool operator!=(const NestedStruct &lhs, const NestedStruct &rhs) {
114 return !(lhs == rhs);
115}
116
117
118FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) ArrayStruct FLATBUFFERS_FINAL_CLASS {
119 private:
120 float a_;
121 int32_t b_[15];
122 int8_t c_;
123 int8_t padding0__; int16_t padding1__;
124 MyGame::Example::NestedStruct d_[2];
125
126 public:
127 static const flatbuffers::TypeTable *MiniReflectTypeTable() {
128 return ArrayStructTypeTable();
129 }
130 ArrayStruct() {
131 memset(static_cast<void *>(this), 0, sizeof(ArrayStruct));
132 }
133 ArrayStruct(float _a, int8_t _c)
134 : a_(flatbuffers::EndianScalar(_a)),
135 c_(flatbuffers::EndianScalar(_c)),
136 padding0__(0),
137 padding1__(0) {
138 std::memset(b_, 0, sizeof(b_));
139 (void)padding0__; (void)padding1__;
140 std::memset(d_, 0, sizeof(d_));
141 }
142 float a() const {
143 return flatbuffers::EndianScalar(a_);
144 }
145 void mutate_a(float _a) {
146 flatbuffers::WriteScalar(&a_, _a);
147 }
148 const flatbuffers::Array<int32_t, 15> *b() const {
149 return reinterpret_cast<const flatbuffers::Array<int32_t, 15> *>(b_);
150 }
151 flatbuffers::Array<int32_t, 15> *mutable_b() {
152 return reinterpret_cast<flatbuffers::Array<int32_t, 15> *>(b_);
153 }
154 int8_t c() const {
155 return flatbuffers::EndianScalar(c_);
156 }
157 void mutate_c(int8_t _c) {
158 flatbuffers::WriteScalar(&c_, _c);
159 }
160 const flatbuffers::Array<MyGame::Example::NestedStruct, 2> *d() const {
161 return reinterpret_cast<const flatbuffers::Array<MyGame::Example::NestedStruct, 2> *>(d_);
162 }
163 flatbuffers::Array<MyGame::Example::NestedStruct, 2> *mutable_d() {
164 return reinterpret_cast<flatbuffers::Array<MyGame::Example::NestedStruct, 2> *>(d_);
165 }
166};
167FLATBUFFERS_STRUCT_END(ArrayStruct, 92);
168
169inline bool operator==(const ArrayStruct &lhs, const ArrayStruct &rhs) {
170 return
171 (lhs.a() == rhs.a()) &&
172 (lhs.b() == rhs.b()) &&
173 (lhs.c() == rhs.c()) &&
174 (lhs.d() == rhs.d());
175}
176
177inline bool operator!=(const ArrayStruct &lhs, const ArrayStruct &rhs) {
178 return !(lhs == rhs);
179}
180
181
182struct ArrayTableT : public flatbuffers::NativeTable {
183 typedef ArrayTable TableType;
184 flatbuffers::unique_ptr<MyGame::Example::ArrayStruct> a;
185 ArrayTableT() {
186 }
187};
188
189inline bool operator==(const ArrayTableT &lhs, const ArrayTableT &rhs) {
190 return
191 (lhs.a == rhs.a);
192}
193
194inline bool operator!=(const ArrayTableT &lhs, const ArrayTableT &rhs) {
195 return !(lhs == rhs);
196}
197
198
199struct ArrayTable FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
200 typedef ArrayTableT NativeTableType;
201 static const flatbuffers::TypeTable *MiniReflectTypeTable() {
202 return ArrayTableTypeTable();
203 }
204 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
205 VT_A = 4
206 };
207 const MyGame::Example::ArrayStruct *a() const {
208 return GetStruct<const MyGame::Example::ArrayStruct *>(VT_A);
209 }
210 MyGame::Example::ArrayStruct *mutable_a() {
211 return GetStruct<MyGame::Example::ArrayStruct *>(VT_A);
212 }
213 bool Verify(flatbuffers::Verifier &verifier) const {
214 return VerifyTableStart(verifier) &&
215 VerifyField<MyGame::Example::ArrayStruct>(verifier, VT_A) &&
216 verifier.EndTable();
217 }
218 ArrayTableT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
219 void UnPackTo(ArrayTableT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
220 static flatbuffers::Offset<ArrayTable> Pack(flatbuffers::FlatBufferBuilder &_fbb, const ArrayTableT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
221};
222
223struct ArrayTableBuilder {
224 flatbuffers::FlatBufferBuilder &fbb_;
225 flatbuffers::uoffset_t start_;
226 void add_a(const MyGame::Example::ArrayStruct *a) {
227 fbb_.AddStruct(ArrayTable::VT_A, a);
228 }
229 explicit ArrayTableBuilder(flatbuffers::FlatBufferBuilder &_fbb)
230 : fbb_(_fbb) {
231 start_ = fbb_.StartTable();
232 }
233 ArrayTableBuilder &operator=(const ArrayTableBuilder &);
234 flatbuffers::Offset<ArrayTable> Finish() {
235 const auto end = fbb_.EndTable(start_);
236 auto o = flatbuffers::Offset<ArrayTable>(end);
237 return o;
238 }
239};
240
241inline flatbuffers::Offset<ArrayTable> CreateArrayTable(
242 flatbuffers::FlatBufferBuilder &_fbb,
243 const MyGame::Example::ArrayStruct *a = 0) {
244 ArrayTableBuilder builder_(_fbb);
245 builder_.add_a(a);
246 return builder_.Finish();
247}
248
249flatbuffers::Offset<ArrayTable> CreateArrayTable(flatbuffers::FlatBufferBuilder &_fbb, const ArrayTableT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
250
251inline ArrayTableT *ArrayTable::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
252 auto _o = new ArrayTableT();
253 UnPackTo(_o, _resolver);
254 return _o;
255}
256
257inline void ArrayTable::UnPackTo(ArrayTableT *_o, const flatbuffers::resolver_function_t *_resolver) const {
258 (void)_o;
259 (void)_resolver;
260 { auto _e = a(); if (_e) _o->a = flatbuffers::unique_ptr<MyGame::Example::ArrayStruct>(new MyGame::Example::ArrayStruct(*_e)); };
261}
262
263inline flatbuffers::Offset<ArrayTable> ArrayTable::Pack(flatbuffers::FlatBufferBuilder &_fbb, const ArrayTableT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
264 return CreateArrayTable(_fbb, _o, _rehasher);
265}
266
267inline flatbuffers::Offset<ArrayTable> CreateArrayTable(flatbuffers::FlatBufferBuilder &_fbb, const ArrayTableT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
268 (void)_rehasher;
269 (void)_o;
270 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const ArrayTableT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
271 auto _a = _o->a ? _o->a.get() : 0;
272 return MyGame::Example::CreateArrayTable(
273 _fbb,
274 _a);
275}
276
277inline const flatbuffers::TypeTable *TestEnumTypeTable() {
278 static const flatbuffers::TypeCode type_codes[] = {
279 { flatbuffers::ET_CHAR, 0, 0 },
280 { flatbuffers::ET_CHAR, 0, 0 },
281 { flatbuffers::ET_CHAR, 0, 0 }
282 };
283 static const flatbuffers::TypeFunction type_refs[] = {
284 MyGame::Example::TestEnumTypeTable
285 };
286 static const char * const names[] = {
287 "A",
288 "B",
289 "C"
290 };
291 static const flatbuffers::TypeTable tt = {
292 flatbuffers::ST_ENUM, 3, type_codes, type_refs, nullptr, names
293 };
294 return &tt;
295}
296
297inline const flatbuffers::TypeTable *NestedStructTypeTable() {
298 static const flatbuffers::TypeCode type_codes[] = {
299 { flatbuffers::ET_SEQUENCE, 0, -1 },
300 { flatbuffers::ET_CHAR, 0, 0 },
301 { flatbuffers::ET_SEQUENCE, 0, 0 }
302 };
303 static const flatbuffers::TypeFunction type_refs[] = {
304 MyGame::Example::TestEnumTypeTable
305 };
306 static const int64_t values[] = { 0, 8, 9, 12 };
307 static const char * const names[] = {
308 "a",
309 "b",
310 "c"
311 };
312 static const flatbuffers::TypeTable tt = {
313 flatbuffers::ST_STRUCT, 3, type_codes, type_refs, values, names
314 };
315 return &tt;
316}
317
318inline const flatbuffers::TypeTable *ArrayStructTypeTable() {
319 static const flatbuffers::TypeCode type_codes[] = {
320 { flatbuffers::ET_FLOAT, 0, -1 },
321 { flatbuffers::ET_SEQUENCE, 0, -1 },
322 { flatbuffers::ET_CHAR, 0, -1 },
323 { flatbuffers::ET_SEQUENCE, 0, 0 }
324 };
325 static const flatbuffers::TypeFunction type_refs[] = {
326 MyGame::Example::NestedStructTypeTable
327 };
328 static const int64_t values[] = { 0, 4, 64, 68, 92 };
329 static const char * const names[] = {
330 "a",
331 "b",
332 "c",
333 "d"
334 };
335 static const flatbuffers::TypeTable tt = {
336 flatbuffers::ST_STRUCT, 4, type_codes, type_refs, values, names
337 };
338 return &tt;
339}
340
341inline const flatbuffers::TypeTable *ArrayTableTypeTable() {
342 static const flatbuffers::TypeCode type_codes[] = {
343 { flatbuffers::ET_SEQUENCE, 0, 0 }
344 };
345 static const flatbuffers::TypeFunction type_refs[] = {
346 MyGame::Example::ArrayStructTypeTable
347 };
348 static const char * const names[] = {
349 "a"
350 };
351 static const flatbuffers::TypeTable tt = {
352 flatbuffers::ST_TABLE, 1, type_codes, type_refs, nullptr, names
353 };
354 return &tt;
355}
356
357inline const MyGame::Example::ArrayTable *GetArrayTable(const void *buf) {
358 return flatbuffers::GetRoot<MyGame::Example::ArrayTable>(buf);
359}
360
361inline const MyGame::Example::ArrayTable *GetSizePrefixedArrayTable(const void *buf) {
362 return flatbuffers::GetSizePrefixedRoot<MyGame::Example::ArrayTable>(buf);
363}
364
365inline ArrayTable *GetMutableArrayTable(void *buf) {
366 return flatbuffers::GetMutableRoot<ArrayTable>(buf);
367}
368
369inline const char *ArrayTableIdentifier() {
370 return "ARRT";
371}
372
373inline bool ArrayTableBufferHasIdentifier(const void *buf) {
374 return flatbuffers::BufferHasIdentifier(
375 buf, ArrayTableIdentifier());
376}
377
378inline bool VerifyArrayTableBuffer(
379 flatbuffers::Verifier &verifier) {
380 return verifier.VerifyBuffer<MyGame::Example::ArrayTable>(ArrayTableIdentifier());
381}
382
383inline bool VerifySizePrefixedArrayTableBuffer(
384 flatbuffers::Verifier &verifier) {
385 return verifier.VerifySizePrefixedBuffer<MyGame::Example::ArrayTable>(ArrayTableIdentifier());
386}
387
388inline const char *ArrayTableExtension() {
389 return "mon";
390}
391
392inline void FinishArrayTableBuffer(
393 flatbuffers::FlatBufferBuilder &fbb,
394 flatbuffers::Offset<MyGame::Example::ArrayTable> root) {
395 fbb.Finish(root, ArrayTableIdentifier());
396}
397
398inline void FinishSizePrefixedArrayTableBuffer(
399 flatbuffers::FlatBufferBuilder &fbb,
400 flatbuffers::Offset<MyGame::Example::ArrayTable> root) {
401 fbb.FinishSizePrefixed(root, ArrayTableIdentifier());
402}
403
404inline flatbuffers::unique_ptr<MyGame::Example::ArrayTableT> UnPackArrayTable(
405 const void *buf,
406 const flatbuffers::resolver_function_t *res = nullptr) {
407 return flatbuffers::unique_ptr<MyGame::Example::ArrayTableT>(GetArrayTable(buf)->UnPack(res));
408}
409
410inline flatbuffers::unique_ptr<MyGame::Example::ArrayTableT> UnPackSizePrefixedArrayTable(
411 const void *buf,
412 const flatbuffers::resolver_function_t *res = nullptr) {
413 return flatbuffers::unique_ptr<MyGame::Example::ArrayTableT>(GetSizePrefixedArrayTable(buf)->UnPack(res));
414}
415
416} // namespace Example
417} // namespace MyGame
418
419#endif // FLATBUFFERS_GENERATED_ARRAYSTEST_MYGAME_EXAMPLE_H_