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