1 // automatically generated by the FlatBuffers compiler, do not modify
2
3
4 #ifndef FLATBUFFERS_GENERATED_MONSTERTEST_MYGAME_EXAMPLE_H_
5 #define FLATBUFFERS_GENERATED_MONSTERTEST_MYGAME_EXAMPLE_H_
6
7 #include "flatbuffers/flatbuffers.h"
8 #include "flatbuffers/flexbuffers.h"
9
10 namespace MyGame {
11
12 struct InParentNamespace;
13 struct InParentNamespaceT;
14
15 namespace Example2 {
16
17 struct Monster;
18 struct MonsterT;
19
20 } // namespace Example2
21
22 namespace Example {
23
24 struct Test;
25
26 struct TestSimpleTableWithEnum;
27 struct TestSimpleTableWithEnumT;
28
29 struct Vec3;
30
31 struct Ability;
32
33 struct Stat;
34 struct StatT;
35
36 struct Referrable;
37 struct ReferrableT;
38
39 struct Monster;
40 struct MonsterT;
41
42 struct TypeAliases;
43 struct TypeAliasesT;
44
45 } // namespace Example
46
47 bool operator==(const InParentNamespaceT &lhs, const InParentNamespaceT &rhs);
48 bool operator!=(const InParentNamespaceT &lhs, const InParentNamespaceT &rhs);
49 namespace Example2 {
50
51 bool operator==(const MonsterT &lhs, const MonsterT &rhs);
52 bool operator!=(const MonsterT &lhs, const MonsterT &rhs);
53 } // namespace Example2
54
55 namespace Example {
56
57 bool operator==(const Test &lhs, const Test &rhs);
58 bool operator!=(const Test &lhs, const Test &rhs);
59 bool operator==(const TestSimpleTableWithEnumT &lhs, const TestSimpleTableWithEnumT &rhs);
60 bool operator!=(const TestSimpleTableWithEnumT &lhs, const TestSimpleTableWithEnumT &rhs);
61 bool operator==(const Vec3 &lhs, const Vec3 &rhs);
62 bool operator!=(const Vec3 &lhs, const Vec3 &rhs);
63 bool operator==(const Ability &lhs, const Ability &rhs);
64 bool operator!=(const Ability &lhs, const Ability &rhs);
65 bool operator==(const StatT &lhs, const StatT &rhs);
66 bool operator!=(const StatT &lhs, const StatT &rhs);
67 bool operator==(const ReferrableT &lhs, const ReferrableT &rhs);
68 bool operator!=(const ReferrableT &lhs, const ReferrableT &rhs);
69 bool operator==(const MonsterT &lhs, const MonsterT &rhs);
70 bool operator!=(const MonsterT &lhs, const MonsterT &rhs);
71 bool operator==(const TypeAliasesT &lhs, const TypeAliasesT &rhs);
72 bool operator!=(const TypeAliasesT &lhs, const TypeAliasesT &rhs);
73
74 } // namespace Example
75
76 inline const flatbuffers::TypeTable *InParentNamespaceTypeTable();
77
78 namespace Example2 {
79
80 inline const flatbuffers::TypeTable *MonsterTypeTable();
81
82 } // namespace Example2
83
84 namespace Example {
85
86 inline const flatbuffers::TypeTable *TestTypeTable();
87
88 inline const flatbuffers::TypeTable *TestSimpleTableWithEnumTypeTable();
89
90 inline const flatbuffers::TypeTable *Vec3TypeTable();
91
92 inline const flatbuffers::TypeTable *AbilityTypeTable();
93
94 inline const flatbuffers::TypeTable *StatTypeTable();
95
96 inline const flatbuffers::TypeTable *ReferrableTypeTable();
97
98 inline const flatbuffers::TypeTable *MonsterTypeTable();
99
100 inline const flatbuffers::TypeTable *TypeAliasesTypeTable();
101
102 enum Color {
103 Color_Red = 1,
104 Color_Green = 2,
105 Color_Blue = 8,
106 Color_NONE = 0,
107 Color_ANY = 11
108 };
109
EnumValuesColor()110 inline const Color (&EnumValuesColor())[3] {
111 static const Color values[] = {
112 Color_Red,
113 Color_Green,
114 Color_Blue
115 };
116 return values;
117 }
118
EnumNamesColor()119 inline const char * const *EnumNamesColor() {
120 static const char * const names[] = {
121 "Red",
122 "Green",
123 "",
124 "",
125 "",
126 "",
127 "",
128 "Blue",
129 nullptr
130 };
131 return names;
132 }
133
EnumNameColor(Color e)134 inline const char *EnumNameColor(Color e) {
135 if (e < Color_Red || e > Color_Blue) return "";
136 const size_t index = static_cast<size_t>(e) - static_cast<size_t>(Color_Red);
137 return EnumNamesColor()[index];
138 }
139
140 enum Any {
141 Any_NONE = 0,
142 Any_Monster = 1,
143 Any_TestSimpleTableWithEnum = 2,
144 Any_MyGame_Example2_Monster = 3,
145 Any_MIN = Any_NONE,
146 Any_MAX = Any_MyGame_Example2_Monster
147 };
148
EnumValuesAny()149 inline const Any (&EnumValuesAny())[4] {
150 static const Any values[] = {
151 Any_NONE,
152 Any_Monster,
153 Any_TestSimpleTableWithEnum,
154 Any_MyGame_Example2_Monster
155 };
156 return values;
157 }
158
EnumNamesAny()159 inline const char * const *EnumNamesAny() {
160 static const char * const names[] = {
161 "NONE",
162 "Monster",
163 "TestSimpleTableWithEnum",
164 "MyGame_Example2_Monster",
165 nullptr
166 };
167 return names;
168 }
169
EnumNameAny(Any e)170 inline const char *EnumNameAny(Any e) {
171 if (e < Any_NONE || e > Any_MyGame_Example2_Monster) return "";
172 const size_t index = static_cast<size_t>(e);
173 return EnumNamesAny()[index];
174 }
175
176 template<typename T> struct AnyTraits {
177 static const Any enum_value = Any_NONE;
178 };
179
180 template<> struct AnyTraits<Monster> {
181 static const Any enum_value = Any_Monster;
182 };
183
184 template<> struct AnyTraits<TestSimpleTableWithEnum> {
185 static const Any enum_value = Any_TestSimpleTableWithEnum;
186 };
187
188 template<> struct AnyTraits<MyGame::Example2::Monster> {
189 static const Any enum_value = Any_MyGame_Example2_Monster;
190 };
191
192 struct AnyUnion {
193 Any type;
194 void *value;
195
196 AnyUnion() : type(Any_NONE), value(nullptr) {}
197 AnyUnion(AnyUnion&& u) FLATBUFFERS_NOEXCEPT :
198 type(Any_NONE), value(nullptr)
199 { std::swap(type, u.type); std::swap(value, u.value); }
200 AnyUnion(const AnyUnion &) FLATBUFFERS_NOEXCEPT;
201 AnyUnion &operator=(const AnyUnion &u) FLATBUFFERS_NOEXCEPT
202 { AnyUnion t(u); std::swap(type, t.type); std::swap(value, t.value); return *this; }
203 AnyUnion &operator=(AnyUnion &&u) FLATBUFFERS_NOEXCEPT
204 { std::swap(type, u.type); std::swap(value, u.value); return *this; }
205 ~AnyUnion() { Reset(); }
206
207 void Reset();
208
209 #ifndef FLATBUFFERS_CPP98_STL
210 template <typename T>
211 void Set(T&& val) {
212 using RT = typename std::remove_reference<T>::type;
213 Reset();
214 type = AnyTraits<typename RT::TableType>::enum_value;
215 if (type != Any_NONE) {
216 value = new RT(std::forward<T>(val));
217 }
218 }
219 #endif // FLATBUFFERS_CPP98_STL
220
221 static void *UnPack(const void *obj, Any type, const flatbuffers::resolver_function_t *resolver);
222 flatbuffers::Offset<void> Pack(flatbuffers::FlatBufferBuilder &_fbb, const flatbuffers::rehasher_function_t *_rehasher = nullptr) const;
223
224 MonsterT *AsMonster() {
225 return type == Any_Monster ?
226 reinterpret_cast<MonsterT *>(value) : nullptr;
227 }
228 const MonsterT *AsMonster() const {
229 return type == Any_Monster ?
230 reinterpret_cast<const MonsterT *>(value) : nullptr;
231 }
232 TestSimpleTableWithEnumT *AsTestSimpleTableWithEnum() {
233 return type == Any_TestSimpleTableWithEnum ?
234 reinterpret_cast<TestSimpleTableWithEnumT *>(value) : nullptr;
235 }
236 const TestSimpleTableWithEnumT *AsTestSimpleTableWithEnum() const {
237 return type == Any_TestSimpleTableWithEnum ?
238 reinterpret_cast<const TestSimpleTableWithEnumT *>(value) : nullptr;
239 }
240 MyGame::Example2::MonsterT *AsMyGame_Example2_Monster() {
241 return type == Any_MyGame_Example2_Monster ?
242 reinterpret_cast<MyGame::Example2::MonsterT *>(value) : nullptr;
243 }
244 const MyGame::Example2::MonsterT *AsMyGame_Example2_Monster() const {
245 return type == Any_MyGame_Example2_Monster ?
246 reinterpret_cast<const MyGame::Example2::MonsterT *>(value) : nullptr;
247 }
248 };
249
250
251 inline bool operator==(const AnyUnion &lhs, const AnyUnion &rhs) {
252 if (lhs.type != rhs.type) return false;
253 switch (lhs.type) {
254 case Any_NONE: {
255 return true;
256 }
257 case Any_Monster: {
258 return *(reinterpret_cast<const MonsterT *>(lhs.value)) ==
259 *(reinterpret_cast<const MonsterT *>(rhs.value));
260 }
261 case Any_TestSimpleTableWithEnum: {
262 return *(reinterpret_cast<const TestSimpleTableWithEnumT *>(lhs.value)) ==
263 *(reinterpret_cast<const TestSimpleTableWithEnumT *>(rhs.value));
264 }
265 case Any_MyGame_Example2_Monster: {
266 return *(reinterpret_cast<const MyGame::Example2::MonsterT *>(lhs.value)) ==
267 *(reinterpret_cast<const MyGame::Example2::MonsterT *>(rhs.value));
268 }
269 default: {
270 return false;
271 }
272 }
273 }
274
275 inline bool operator!=(const AnyUnion &lhs, const AnyUnion &rhs) {
276 return !(lhs == rhs);
277 }
278
279 bool VerifyAny(flatbuffers::Verifier &verifier, const void *obj, Any type);
280 bool VerifyAnyVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector<flatbuffers::Offset<void>> *values, const flatbuffers::Vector<uint8_t> *types);
281
282 enum AnyUniqueAliases {
283 AnyUniqueAliases_NONE = 0,
284 AnyUniqueAliases_M = 1,
285 AnyUniqueAliases_T = 2,
286 AnyUniqueAliases_M2 = 3,
287 AnyUniqueAliases_MIN = AnyUniqueAliases_NONE,
288 AnyUniqueAliases_MAX = AnyUniqueAliases_M2
289 };
290
291 inline const AnyUniqueAliases (&EnumValuesAnyUniqueAliases())[4] {
292 static const AnyUniqueAliases values[] = {
293 AnyUniqueAliases_NONE,
294 AnyUniqueAliases_M,
295 AnyUniqueAliases_T,
296 AnyUniqueAliases_M2
297 };
298 return values;
299 }
300
301 inline const char * const *EnumNamesAnyUniqueAliases() {
302 static const char * const names[] = {
303 "NONE",
304 "M",
305 "T",
306 "M2",
307 nullptr
308 };
309 return names;
310 }
311
312 inline const char *EnumNameAnyUniqueAliases(AnyUniqueAliases e) {
313 if (e < AnyUniqueAliases_NONE || e > AnyUniqueAliases_M2) return "";
314 const size_t index = static_cast<size_t>(e);
315 return EnumNamesAnyUniqueAliases()[index];
316 }
317
318 template<typename T> struct AnyUniqueAliasesTraits {
319 static const AnyUniqueAliases enum_value = AnyUniqueAliases_NONE;
320 };
321
322 template<> struct AnyUniqueAliasesTraits<Monster> {
323 static const AnyUniqueAliases enum_value = AnyUniqueAliases_M;
324 };
325
326 template<> struct AnyUniqueAliasesTraits<TestSimpleTableWithEnum> {
327 static const AnyUniqueAliases enum_value = AnyUniqueAliases_T;
328 };
329
330 template<> struct AnyUniqueAliasesTraits<MyGame::Example2::Monster> {
331 static const AnyUniqueAliases enum_value = AnyUniqueAliases_M2;
332 };
333
334 struct AnyUniqueAliasesUnion {
335 AnyUniqueAliases type;
336 void *value;
337
338 AnyUniqueAliasesUnion() : type(AnyUniqueAliases_NONE), value(nullptr) {}
339 AnyUniqueAliasesUnion(AnyUniqueAliasesUnion&& u) FLATBUFFERS_NOEXCEPT :
340 type(AnyUniqueAliases_NONE), value(nullptr)
341 { std::swap(type, u.type); std::swap(value, u.value); }
342 AnyUniqueAliasesUnion(const AnyUniqueAliasesUnion &) FLATBUFFERS_NOEXCEPT;
343 AnyUniqueAliasesUnion &operator=(const AnyUniqueAliasesUnion &u) FLATBUFFERS_NOEXCEPT
344 { AnyUniqueAliasesUnion t(u); std::swap(type, t.type); std::swap(value, t.value); return *this; }
345 AnyUniqueAliasesUnion &operator=(AnyUniqueAliasesUnion &&u) FLATBUFFERS_NOEXCEPT
346 { std::swap(type, u.type); std::swap(value, u.value); return *this; }
347 ~AnyUniqueAliasesUnion() { Reset(); }
348
349 void Reset();
350
351 #ifndef FLATBUFFERS_CPP98_STL
352 template <typename T>
353 void Set(T&& val) {
354 using RT = typename std::remove_reference<T>::type;
355 Reset();
356 type = AnyUniqueAliasesTraits<typename RT::TableType>::enum_value;
357 if (type != AnyUniqueAliases_NONE) {
358 value = new RT(std::forward<T>(val));
359 }
360 }
361 #endif // FLATBUFFERS_CPP98_STL
362
363 static void *UnPack(const void *obj, AnyUniqueAliases type, const flatbuffers::resolver_function_t *resolver);
364 flatbuffers::Offset<void> Pack(flatbuffers::FlatBufferBuilder &_fbb, const flatbuffers::rehasher_function_t *_rehasher = nullptr) const;
365
366 MonsterT *AsM() {
367 return type == AnyUniqueAliases_M ?
368 reinterpret_cast<MonsterT *>(value) : nullptr;
369 }
370 const MonsterT *AsM() const {
371 return type == AnyUniqueAliases_M ?
372 reinterpret_cast<const MonsterT *>(value) : nullptr;
373 }
374 TestSimpleTableWithEnumT *AsT() {
375 return type == AnyUniqueAliases_T ?
376 reinterpret_cast<TestSimpleTableWithEnumT *>(value) : nullptr;
377 }
378 const TestSimpleTableWithEnumT *AsT() const {
379 return type == AnyUniqueAliases_T ?
380 reinterpret_cast<const TestSimpleTableWithEnumT *>(value) : nullptr;
381 }
382 MyGame::Example2::MonsterT *AsM2() {
383 return type == AnyUniqueAliases_M2 ?
384 reinterpret_cast<MyGame::Example2::MonsterT *>(value) : nullptr;
385 }
386 const MyGame::Example2::MonsterT *AsM2() const {
387 return type == AnyUniqueAliases_M2 ?
388 reinterpret_cast<const MyGame::Example2::MonsterT *>(value) : nullptr;
389 }
390 };
391
392
393 inline bool operator==(const AnyUniqueAliasesUnion &lhs, const AnyUniqueAliasesUnion &rhs) {
394 if (lhs.type != rhs.type) return false;
395 switch (lhs.type) {
396 case AnyUniqueAliases_NONE: {
397 return true;
398 }
399 case AnyUniqueAliases_M: {
400 return *(reinterpret_cast<const MonsterT *>(lhs.value)) ==
401 *(reinterpret_cast<const MonsterT *>(rhs.value));
402 }
403 case AnyUniqueAliases_T: {
404 return *(reinterpret_cast<const TestSimpleTableWithEnumT *>(lhs.value)) ==
405 *(reinterpret_cast<const TestSimpleTableWithEnumT *>(rhs.value));
406 }
407 case AnyUniqueAliases_M2: {
408 return *(reinterpret_cast<const MyGame::Example2::MonsterT *>(lhs.value)) ==
409 *(reinterpret_cast<const MyGame::Example2::MonsterT *>(rhs.value));
410 }
411 default: {
412 return false;
413 }
414 }
415 }
416
417 inline bool operator!=(const AnyUniqueAliasesUnion &lhs, const AnyUniqueAliasesUnion &rhs) {
418 return !(lhs == rhs);
419 }
420
421 bool VerifyAnyUniqueAliases(flatbuffers::Verifier &verifier, const void *obj, AnyUniqueAliases type);
422 bool VerifyAnyUniqueAliasesVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector<flatbuffers::Offset<void>> *values, const flatbuffers::Vector<uint8_t> *types);
423
424 enum AnyAmbiguousAliases {
425 AnyAmbiguousAliases_NONE = 0,
426 AnyAmbiguousAliases_M1 = 1,
427 AnyAmbiguousAliases_M2 = 2,
428 AnyAmbiguousAliases_M3 = 3,
429 AnyAmbiguousAliases_MIN = AnyAmbiguousAliases_NONE,
430 AnyAmbiguousAliases_MAX = AnyAmbiguousAliases_M3
431 };
432
433 inline const AnyAmbiguousAliases (&EnumValuesAnyAmbiguousAliases())[4] {
434 static const AnyAmbiguousAliases values[] = {
435 AnyAmbiguousAliases_NONE,
436 AnyAmbiguousAliases_M1,
437 AnyAmbiguousAliases_M2,
438 AnyAmbiguousAliases_M3
439 };
440 return values;
441 }
442
443 inline const char * const *EnumNamesAnyAmbiguousAliases() {
444 static const char * const names[] = {
445 "NONE",
446 "M1",
447 "M2",
448 "M3",
449 nullptr
450 };
451 return names;
452 }
453
454 inline const char *EnumNameAnyAmbiguousAliases(AnyAmbiguousAliases e) {
455 if (e < AnyAmbiguousAliases_NONE || e > AnyAmbiguousAliases_M3) return "";
456 const size_t index = static_cast<size_t>(e);
457 return EnumNamesAnyAmbiguousAliases()[index];
458 }
459
460 struct AnyAmbiguousAliasesUnion {
461 AnyAmbiguousAliases type;
462 void *value;
463
464 AnyAmbiguousAliasesUnion() : type(AnyAmbiguousAliases_NONE), value(nullptr) {}
465 AnyAmbiguousAliasesUnion(AnyAmbiguousAliasesUnion&& u) FLATBUFFERS_NOEXCEPT :
466 type(AnyAmbiguousAliases_NONE), value(nullptr)
467 { std::swap(type, u.type); std::swap(value, u.value); }
468 AnyAmbiguousAliasesUnion(const AnyAmbiguousAliasesUnion &) FLATBUFFERS_NOEXCEPT;
469 AnyAmbiguousAliasesUnion &operator=(const AnyAmbiguousAliasesUnion &u) FLATBUFFERS_NOEXCEPT
470 { AnyAmbiguousAliasesUnion t(u); std::swap(type, t.type); std::swap(value, t.value); return *this; }
471 AnyAmbiguousAliasesUnion &operator=(AnyAmbiguousAliasesUnion &&u) FLATBUFFERS_NOEXCEPT
472 { std::swap(type, u.type); std::swap(value, u.value); return *this; }
473 ~AnyAmbiguousAliasesUnion() { Reset(); }
474
475 void Reset();
476
477 static void *UnPack(const void *obj, AnyAmbiguousAliases type, const flatbuffers::resolver_function_t *resolver);
478 flatbuffers::Offset<void> Pack(flatbuffers::FlatBufferBuilder &_fbb, const flatbuffers::rehasher_function_t *_rehasher = nullptr) const;
479
480 MonsterT *AsM1() {
481 return type == AnyAmbiguousAliases_M1 ?
482 reinterpret_cast<MonsterT *>(value) : nullptr;
483 }
484 const MonsterT *AsM1() const {
485 return type == AnyAmbiguousAliases_M1 ?
486 reinterpret_cast<const MonsterT *>(value) : nullptr;
487 }
488 MonsterT *AsM2() {
489 return type == AnyAmbiguousAliases_M2 ?
490 reinterpret_cast<MonsterT *>(value) : nullptr;
491 }
492 const MonsterT *AsM2() const {
493 return type == AnyAmbiguousAliases_M2 ?
494 reinterpret_cast<const MonsterT *>(value) : nullptr;
495 }
496 MonsterT *AsM3() {
497 return type == AnyAmbiguousAliases_M3 ?
498 reinterpret_cast<MonsterT *>(value) : nullptr;
499 }
500 const MonsterT *AsM3() const {
501 return type == AnyAmbiguousAliases_M3 ?
502 reinterpret_cast<const MonsterT *>(value) : nullptr;
503 }
504 };
505
506
507 inline bool operator==(const AnyAmbiguousAliasesUnion &lhs, const AnyAmbiguousAliasesUnion &rhs) {
508 if (lhs.type != rhs.type) return false;
509 switch (lhs.type) {
510 case AnyAmbiguousAliases_NONE: {
511 return true;
512 }
513 case AnyAmbiguousAliases_M1: {
514 return *(reinterpret_cast<const MonsterT *>(lhs.value)) ==
515 *(reinterpret_cast<const MonsterT *>(rhs.value));
516 }
517 case AnyAmbiguousAliases_M2: {
518 return *(reinterpret_cast<const MonsterT *>(lhs.value)) ==
519 *(reinterpret_cast<const MonsterT *>(rhs.value));
520 }
521 case AnyAmbiguousAliases_M3: {
522 return *(reinterpret_cast<const MonsterT *>(lhs.value)) ==
523 *(reinterpret_cast<const MonsterT *>(rhs.value));
524 }
525 default: {
526 return false;
527 }
528 }
529 }
530
531 inline bool operator!=(const AnyAmbiguousAliasesUnion &lhs, const AnyAmbiguousAliasesUnion &rhs) {
532 return !(lhs == rhs);
533 }
534
535 bool VerifyAnyAmbiguousAliases(flatbuffers::Verifier &verifier, const void *obj, AnyAmbiguousAliases type);
536 bool VerifyAnyAmbiguousAliasesVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector<flatbuffers::Offset<void>> *values, const flatbuffers::Vector<uint8_t> *types);
537
538 FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(2) Test FLATBUFFERS_FINAL_CLASS {
539 private:
540 int16_t a_;
541 int8_t b_;
542 int8_t padding0__;
543
544 public:
545 static const flatbuffers::TypeTable *MiniReflectTypeTable() {
546 return TestTypeTable();
547 }
548 Test() {
549 memset(static_cast<void *>(this), 0, sizeof(Test));
550 }
551 Test(int16_t _a, int8_t _b)
552 : a_(flatbuffers::EndianScalar(_a)),
553 b_(flatbuffers::EndianScalar(_b)),
554 padding0__(0) {
555 (void)padding0__;
556 }
557 int16_t a() const {
558 return flatbuffers::EndianScalar(a_);
559 }
560 void mutate_a(int16_t _a) {
561 flatbuffers::WriteScalar(&a_, _a);
562 }
563 int8_t b() const {
564 return flatbuffers::EndianScalar(b_);
565 }
566 void mutate_b(int8_t _b) {
567 flatbuffers::WriteScalar(&b_, _b);
568 }
569 };
570 FLATBUFFERS_STRUCT_END(Test, 4);
571
572 inline bool operator==(const Test &lhs, const Test &rhs) {
573 return
574 (lhs.a() == rhs.a()) &&
575 (lhs.b() == rhs.b());
576 }
577
578 inline bool operator!=(const Test &lhs, const Test &rhs) {
579 return !(lhs == rhs);
580 }
581
582
583 FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) Vec3 FLATBUFFERS_FINAL_CLASS {
584 private:
585 float x_;
586 float y_;
587 float z_;
588 int32_t padding0__;
589 double test1_;
590 int8_t test2_;
591 int8_t padding1__;
592 Test test3_;
593 int16_t padding2__;
594
595 public:
596 static const flatbuffers::TypeTable *MiniReflectTypeTable() {
597 return Vec3TypeTable();
598 }
599 Vec3() {
600 memset(static_cast<void *>(this), 0, sizeof(Vec3));
601 }
602 Vec3(float _x, float _y, float _z, double _test1, Color _test2, const Test &_test3)
603 : x_(flatbuffers::EndianScalar(_x)),
604 y_(flatbuffers::EndianScalar(_y)),
605 z_(flatbuffers::EndianScalar(_z)),
606 padding0__(0),
607 test1_(flatbuffers::EndianScalar(_test1)),
608 test2_(flatbuffers::EndianScalar(static_cast<int8_t>(_test2))),
609 padding1__(0),
610 test3_(_test3),
611 padding2__(0) {
612 (void)padding0__;
613 (void)padding1__;
614 (void)padding2__;
615 }
616 float x() const {
617 return flatbuffers::EndianScalar(x_);
618 }
619 void mutate_x(float _x) {
620 flatbuffers::WriteScalar(&x_, _x);
621 }
622 float y() const {
623 return flatbuffers::EndianScalar(y_);
624 }
625 void mutate_y(float _y) {
626 flatbuffers::WriteScalar(&y_, _y);
627 }
628 float z() const {
629 return flatbuffers::EndianScalar(z_);
630 }
631 void mutate_z(float _z) {
632 flatbuffers::WriteScalar(&z_, _z);
633 }
634 double test1() const {
635 return flatbuffers::EndianScalar(test1_);
636 }
637 void mutate_test1(double _test1) {
638 flatbuffers::WriteScalar(&test1_, _test1);
639 }
640 Color test2() const {
641 return static_cast<Color>(flatbuffers::EndianScalar(test2_));
642 }
643 void mutate_test2(Color _test2) {
644 flatbuffers::WriteScalar(&test2_, static_cast<int8_t>(_test2));
645 }
646 const Test &test3() const {
647 return test3_;
648 }
649 Test &mutable_test3() {
650 return test3_;
651 }
652 };
653 FLATBUFFERS_STRUCT_END(Vec3, 32);
654
655 inline bool operator==(const Vec3 &lhs, const Vec3 &rhs) {
656 return
657 (lhs.x() == rhs.x()) &&
658 (lhs.y() == rhs.y()) &&
659 (lhs.z() == rhs.z()) &&
660 (lhs.test1() == rhs.test1()) &&
661 (lhs.test2() == rhs.test2()) &&
662 (lhs.test3() == rhs.test3());
663 }
664
665 inline bool operator!=(const Vec3 &lhs, const Vec3 &rhs) {
666 return !(lhs == rhs);
667 }
668
669
670 FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) Ability FLATBUFFERS_FINAL_CLASS {
671 private:
672 uint32_t id_;
673 uint32_t distance_;
674
675 public:
676 static const flatbuffers::TypeTable *MiniReflectTypeTable() {
677 return AbilityTypeTable();
678 }
679 Ability() {
680 memset(static_cast<void *>(this), 0, sizeof(Ability));
681 }
682 Ability(uint32_t _id, uint32_t _distance)
683 : id_(flatbuffers::EndianScalar(_id)),
684 distance_(flatbuffers::EndianScalar(_distance)) {
685 }
686 uint32_t id() const {
687 return flatbuffers::EndianScalar(id_);
688 }
689 void mutate_id(uint32_t _id) {
690 flatbuffers::WriteScalar(&id_, _id);
691 }
692 bool KeyCompareLessThan(const Ability *o) const {
693 return id() < o->id();
694 }
695 int KeyCompareWithValue(uint32_t val) const {
696 return static_cast<int>(id() > val) - static_cast<int>(id() < val);
697 }
698 uint32_t distance() const {
699 return flatbuffers::EndianScalar(distance_);
700 }
701 void mutate_distance(uint32_t _distance) {
702 flatbuffers::WriteScalar(&distance_, _distance);
703 }
704 };
705 FLATBUFFERS_STRUCT_END(Ability, 8);
706
707 inline bool operator==(const Ability &lhs, const Ability &rhs) {
708 return
709 (lhs.id() == rhs.id()) &&
710 (lhs.distance() == rhs.distance());
711 }
712
713 inline bool operator!=(const Ability &lhs, const Ability &rhs) {
714 return !(lhs == rhs);
715 }
716
717
718 } // namespace Example
719
720 struct InParentNamespaceT : public flatbuffers::NativeTable {
721 typedef InParentNamespace TableType;
722 InParentNamespaceT() {
723 }
724 };
725
726 inline bool operator==(const InParentNamespaceT &, const InParentNamespaceT &) {
727 return true;
728 }
729
730 inline bool operator!=(const InParentNamespaceT &lhs, const InParentNamespaceT &rhs) {
731 return !(lhs == rhs);
732 }
733
734
735 struct InParentNamespace FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
736 typedef InParentNamespaceT NativeTableType;
737 static const flatbuffers::TypeTable *MiniReflectTypeTable() {
738 return InParentNamespaceTypeTable();
739 }
740 bool Verify(flatbuffers::Verifier &verifier) const {
741 return VerifyTableStart(verifier) &&
742 verifier.EndTable();
743 }
744 InParentNamespaceT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
745 void UnPackTo(InParentNamespaceT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
746 static flatbuffers::Offset<InParentNamespace> Pack(flatbuffers::FlatBufferBuilder &_fbb, const InParentNamespaceT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
747 };
748
749 struct InParentNamespaceBuilder {
750 flatbuffers::FlatBufferBuilder &fbb_;
751 flatbuffers::uoffset_t start_;
752 explicit InParentNamespaceBuilder(flatbuffers::FlatBufferBuilder &_fbb)
753 : fbb_(_fbb) {
754 start_ = fbb_.StartTable();
755 }
756 InParentNamespaceBuilder &operator=(const InParentNamespaceBuilder &);
757 flatbuffers::Offset<InParentNamespace> Finish() {
758 const auto end = fbb_.EndTable(start_);
759 auto o = flatbuffers::Offset<InParentNamespace>(end);
760 return o;
761 }
762 };
763
764 inline flatbuffers::Offset<InParentNamespace> CreateInParentNamespace(
765 flatbuffers::FlatBufferBuilder &_fbb) {
766 InParentNamespaceBuilder builder_(_fbb);
767 return builder_.Finish();
768 }
769
770 flatbuffers::Offset<InParentNamespace> CreateInParentNamespace(flatbuffers::FlatBufferBuilder &_fbb, const InParentNamespaceT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
771
772 namespace Example2 {
773
774 struct MonsterT : public flatbuffers::NativeTable {
775 typedef Monster TableType;
776 MonsterT() {
777 }
778 };
779
780 inline bool operator==(const MonsterT &, const MonsterT &) {
781 return true;
782 }
783
784 inline bool operator!=(const MonsterT &lhs, const MonsterT &rhs) {
785 return !(lhs == rhs);
786 }
787
788
789 struct Monster FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
790 typedef MonsterT NativeTableType;
791 static const flatbuffers::TypeTable *MiniReflectTypeTable() {
792 return MonsterTypeTable();
793 }
794 bool Verify(flatbuffers::Verifier &verifier) const {
795 return VerifyTableStart(verifier) &&
796 verifier.EndTable();
797 }
798 MonsterT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
799 void UnPackTo(MonsterT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
800 static flatbuffers::Offset<Monster> Pack(flatbuffers::FlatBufferBuilder &_fbb, const MonsterT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
801 };
802
803 struct MonsterBuilder {
804 flatbuffers::FlatBufferBuilder &fbb_;
805 flatbuffers::uoffset_t start_;
806 explicit MonsterBuilder(flatbuffers::FlatBufferBuilder &_fbb)
807 : fbb_(_fbb) {
808 start_ = fbb_.StartTable();
809 }
810 MonsterBuilder &operator=(const MonsterBuilder &);
811 flatbuffers::Offset<Monster> Finish() {
812 const auto end = fbb_.EndTable(start_);
813 auto o = flatbuffers::Offset<Monster>(end);
814 return o;
815 }
816 };
817
818 inline flatbuffers::Offset<Monster> CreateMonster(
819 flatbuffers::FlatBufferBuilder &_fbb) {
820 MonsterBuilder builder_(_fbb);
821 return builder_.Finish();
822 }
823
824 flatbuffers::Offset<Monster> CreateMonster(flatbuffers::FlatBufferBuilder &_fbb, const MonsterT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
825
826 } // namespace Example2
827
828 namespace Example {
829
830 struct TestSimpleTableWithEnumT : public flatbuffers::NativeTable {
831 typedef TestSimpleTableWithEnum TableType;
832 Color color;
833 TestSimpleTableWithEnumT()
834 : color(Color_Green) {
835 }
836 };
837
838 inline bool operator==(const TestSimpleTableWithEnumT &lhs, const TestSimpleTableWithEnumT &rhs) {
839 return
840 (lhs.color == rhs.color);
841 }
842
843 inline bool operator!=(const TestSimpleTableWithEnumT &lhs, const TestSimpleTableWithEnumT &rhs) {
844 return !(lhs == rhs);
845 }
846
847
848 struct TestSimpleTableWithEnum FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
849 typedef TestSimpleTableWithEnumT NativeTableType;
850 static const flatbuffers::TypeTable *MiniReflectTypeTable() {
851 return TestSimpleTableWithEnumTypeTable();
852 }
853 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
854 VT_COLOR = 4
855 };
856 Color color() const {
857 return static_cast<Color>(GetField<int8_t>(VT_COLOR, 2));
858 }
859 bool mutate_color(Color _color) {
860 return SetField<int8_t>(VT_COLOR, static_cast<int8_t>(_color), 2);
861 }
862 bool Verify(flatbuffers::Verifier &verifier) const {
863 return VerifyTableStart(verifier) &&
864 VerifyField<int8_t>(verifier, VT_COLOR) &&
865 verifier.EndTable();
866 }
867 TestSimpleTableWithEnumT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
868 void UnPackTo(TestSimpleTableWithEnumT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
869 static flatbuffers::Offset<TestSimpleTableWithEnum> Pack(flatbuffers::FlatBufferBuilder &_fbb, const TestSimpleTableWithEnumT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
870 };
871
872 struct TestSimpleTableWithEnumBuilder {
873 flatbuffers::FlatBufferBuilder &fbb_;
874 flatbuffers::uoffset_t start_;
875 void add_color(Color color) {
876 fbb_.AddElement<int8_t>(TestSimpleTableWithEnum::VT_COLOR, static_cast<int8_t>(color), 2);
877 }
878 explicit TestSimpleTableWithEnumBuilder(flatbuffers::FlatBufferBuilder &_fbb)
879 : fbb_(_fbb) {
880 start_ = fbb_.StartTable();
881 }
882 TestSimpleTableWithEnumBuilder &operator=(const TestSimpleTableWithEnumBuilder &);
883 flatbuffers::Offset<TestSimpleTableWithEnum> Finish() {
884 const auto end = fbb_.EndTable(start_);
885 auto o = flatbuffers::Offset<TestSimpleTableWithEnum>(end);
886 return o;
887 }
888 };
889
890 inline flatbuffers::Offset<TestSimpleTableWithEnum> CreateTestSimpleTableWithEnum(
891 flatbuffers::FlatBufferBuilder &_fbb,
892 Color color = Color_Green) {
893 TestSimpleTableWithEnumBuilder builder_(_fbb);
894 builder_.add_color(color);
895 return builder_.Finish();
896 }
897
898 flatbuffers::Offset<TestSimpleTableWithEnum> CreateTestSimpleTableWithEnum(flatbuffers::FlatBufferBuilder &_fbb, const TestSimpleTableWithEnumT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
899
900 struct StatT : public flatbuffers::NativeTable {
901 typedef Stat TableType;
902 std::string id;
903 int64_t val;
904 uint16_t count;
905 StatT()
906 : val(0),
907 count(0) {
908 }
909 };
910
911 inline bool operator==(const StatT &lhs, const StatT &rhs) {
912 return
913 (lhs.id == rhs.id) &&
914 (lhs.val == rhs.val) &&
915 (lhs.count == rhs.count);
916 }
917
918 inline bool operator!=(const StatT &lhs, const StatT &rhs) {
919 return !(lhs == rhs);
920 }
921
922
923 struct Stat FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
924 typedef StatT NativeTableType;
925 static const flatbuffers::TypeTable *MiniReflectTypeTable() {
926 return StatTypeTable();
927 }
928 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
929 VT_ID = 4,
930 VT_VAL = 6,
931 VT_COUNT = 8
932 };
933 const flatbuffers::String *id() const {
934 return GetPointer<const flatbuffers::String *>(VT_ID);
935 }
936 flatbuffers::String *mutable_id() {
937 return GetPointer<flatbuffers::String *>(VT_ID);
938 }
939 int64_t val() const {
940 return GetField<int64_t>(VT_VAL, 0);
941 }
942 bool mutate_val(int64_t _val) {
943 return SetField<int64_t>(VT_VAL, _val, 0);
944 }
945 uint16_t count() const {
946 return GetField<uint16_t>(VT_COUNT, 0);
947 }
948 bool mutate_count(uint16_t _count) {
949 return SetField<uint16_t>(VT_COUNT, _count, 0);
950 }
951 bool Verify(flatbuffers::Verifier &verifier) const {
952 return VerifyTableStart(verifier) &&
953 VerifyOffset(verifier, VT_ID) &&
954 verifier.VerifyString(id()) &&
955 VerifyField<int64_t>(verifier, VT_VAL) &&
956 VerifyField<uint16_t>(verifier, VT_COUNT) &&
957 verifier.EndTable();
958 }
959 StatT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
960 void UnPackTo(StatT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
961 static flatbuffers::Offset<Stat> Pack(flatbuffers::FlatBufferBuilder &_fbb, const StatT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
962 };
963
964 struct StatBuilder {
965 flatbuffers::FlatBufferBuilder &fbb_;
966 flatbuffers::uoffset_t start_;
967 void add_id(flatbuffers::Offset<flatbuffers::String> id) {
968 fbb_.AddOffset(Stat::VT_ID, id);
969 }
970 void add_val(int64_t val) {
971 fbb_.AddElement<int64_t>(Stat::VT_VAL, val, 0);
972 }
973 void add_count(uint16_t count) {
974 fbb_.AddElement<uint16_t>(Stat::VT_COUNT, count, 0);
975 }
976 explicit StatBuilder(flatbuffers::FlatBufferBuilder &_fbb)
977 : fbb_(_fbb) {
978 start_ = fbb_.StartTable();
979 }
980 StatBuilder &operator=(const StatBuilder &);
981 flatbuffers::Offset<Stat> Finish() {
982 const auto end = fbb_.EndTable(start_);
983 auto o = flatbuffers::Offset<Stat>(end);
984 return o;
985 }
986 };
987
988 inline flatbuffers::Offset<Stat> CreateStat(
989 flatbuffers::FlatBufferBuilder &_fbb,
990 flatbuffers::Offset<flatbuffers::String> id = 0,
991 int64_t val = 0,
992 uint16_t count = 0) {
993 StatBuilder builder_(_fbb);
994 builder_.add_val(val);
995 builder_.add_id(id);
996 builder_.add_count(count);
997 return builder_.Finish();
998 }
999
1000 inline flatbuffers::Offset<Stat> CreateStatDirect(
1001 flatbuffers::FlatBufferBuilder &_fbb,
1002 const char *id = nullptr,
1003 int64_t val = 0,
1004 uint16_t count = 0) {
1005 auto id__ = id ? _fbb.CreateString(id) : 0;
1006 return MyGame::Example::CreateStat(
1007 _fbb,
1008 id__,
1009 val,
1010 count);
1011 }
1012
1013 flatbuffers::Offset<Stat> CreateStat(flatbuffers::FlatBufferBuilder &_fbb, const StatT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
1014
1015 struct ReferrableT : public flatbuffers::NativeTable {
1016 typedef Referrable TableType;
1017 uint64_t id;
1018 ReferrableT()
1019 : id(0) {
1020 }
1021 };
1022
1023 inline bool operator==(const ReferrableT &lhs, const ReferrableT &rhs) {
1024 return
1025 (lhs.id == rhs.id);
1026 }
1027
1028 inline bool operator!=(const ReferrableT &lhs, const ReferrableT &rhs) {
1029 return !(lhs == rhs);
1030 }
1031
1032
1033 struct Referrable FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
1034 typedef ReferrableT NativeTableType;
1035 static const flatbuffers::TypeTable *MiniReflectTypeTable() {
1036 return ReferrableTypeTable();
1037 }
1038 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
1039 VT_ID = 4
1040 };
1041 uint64_t id() const {
1042 return GetField<uint64_t>(VT_ID, 0);
1043 }
1044 bool mutate_id(uint64_t _id) {
1045 return SetField<uint64_t>(VT_ID, _id, 0);
1046 }
1047 bool KeyCompareLessThan(const Referrable *o) const {
1048 return id() < o->id();
1049 }
1050 int KeyCompareWithValue(uint64_t val) const {
1051 return static_cast<int>(id() > val) - static_cast<int>(id() < val);
1052 }
1053 bool Verify(flatbuffers::Verifier &verifier) const {
1054 return VerifyTableStart(verifier) &&
1055 VerifyField<uint64_t>(verifier, VT_ID) &&
1056 verifier.EndTable();
1057 }
1058 ReferrableT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
1059 void UnPackTo(ReferrableT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
1060 static flatbuffers::Offset<Referrable> Pack(flatbuffers::FlatBufferBuilder &_fbb, const ReferrableT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
1061 };
1062
1063 struct ReferrableBuilder {
1064 flatbuffers::FlatBufferBuilder &fbb_;
1065 flatbuffers::uoffset_t start_;
1066 void add_id(uint64_t id) {
1067 fbb_.AddElement<uint64_t>(Referrable::VT_ID, id, 0);
1068 }
1069 explicit ReferrableBuilder(flatbuffers::FlatBufferBuilder &_fbb)
1070 : fbb_(_fbb) {
1071 start_ = fbb_.StartTable();
1072 }
1073 ReferrableBuilder &operator=(const ReferrableBuilder &);
1074 flatbuffers::Offset<Referrable> Finish() {
1075 const auto end = fbb_.EndTable(start_);
1076 auto o = flatbuffers::Offset<Referrable>(end);
1077 return o;
1078 }
1079 };
1080
1081 inline flatbuffers::Offset<Referrable> CreateReferrable(
1082 flatbuffers::FlatBufferBuilder &_fbb,
1083 uint64_t id = 0) {
1084 ReferrableBuilder builder_(_fbb);
1085 builder_.add_id(id);
1086 return builder_.Finish();
1087 }
1088
1089 flatbuffers::Offset<Referrable> CreateReferrable(flatbuffers::FlatBufferBuilder &_fbb, const ReferrableT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
1090
1091 struct MonsterT : public flatbuffers::NativeTable {
1092 typedef Monster TableType;
1093 flatbuffers::unique_ptr<Vec3> pos;
1094 int16_t mana;
1095 int16_t hp;
1096 std::string name;
1097 std::vector<uint8_t> inventory;
1098 Color color;
1099 AnyUnion test;
1100 std::vector<Test> test4;
1101 std::vector<std::string> testarrayofstring;
1102 std::vector<flatbuffers::unique_ptr<MonsterT>> testarrayoftables;
1103 flatbuffers::unique_ptr<MonsterT> enemy;
1104 std::vector<uint8_t> testnestedflatbuffer;
1105 flatbuffers::unique_ptr<StatT> testempty;
1106 bool testbool;
1107 int32_t testhashs32_fnv1;
1108 uint32_t testhashu32_fnv1;
1109 int64_t testhashs64_fnv1;
1110 uint64_t testhashu64_fnv1;
1111 int32_t testhashs32_fnv1a;
1112 Stat *testhashu32_fnv1a;
1113 int64_t testhashs64_fnv1a;
1114 uint64_t testhashu64_fnv1a;
1115 std::vector<bool> testarrayofbools;
1116 float testf;
1117 float testf2;
1118 float testf3;
1119 std::vector<std::string> testarrayofstring2;
1120 std::vector<Ability> testarrayofsortedstruct;
1121 std::vector<uint8_t> flex;
1122 std::vector<Test> test5;
1123 std::vector<int64_t> vector_of_longs;
1124 std::vector<double> vector_of_doubles;
1125 flatbuffers::unique_ptr<MyGame::InParentNamespaceT> parent_namespace_test;
1126 std::vector<flatbuffers::unique_ptr<ReferrableT>> vector_of_referrables;
1127 ReferrableT *single_weak_reference;
1128 std::vector<ReferrableT *> vector_of_weak_references;
1129 std::vector<flatbuffers::unique_ptr<ReferrableT>> vector_of_strong_referrables;
1130 ReferrableT *co_owning_reference;
1131 std::vector<flatbuffers::unique_ptr<ReferrableT>> vector_of_co_owning_references;
1132 ReferrableT *non_owning_reference;
1133 std::vector<ReferrableT *> vector_of_non_owning_references;
1134 AnyUniqueAliasesUnion any_unique;
1135 AnyAmbiguousAliasesUnion any_ambiguous;
1136 std::vector<Color> vector_of_enums;
1137 MonsterT()
1138 : mana(150),
1139 hp(100),
1140 color(Color_Blue),
1141 testbool(false),
1142 testhashs32_fnv1(0),
1143 testhashu32_fnv1(0),
1144 testhashs64_fnv1(0),
1145 testhashu64_fnv1(0),
1146 testhashs32_fnv1a(0),
1147 testhashu32_fnv1a(nullptr),
1148 testhashs64_fnv1a(0),
1149 testhashu64_fnv1a(0),
1150 testf(3.14159f),
1151 testf2(3.0f),
1152 testf3(0.0f),
1153 single_weak_reference(nullptr),
1154 co_owning_reference(nullptr),
1155 non_owning_reference(nullptr) {
1156 }
1157 };
1158
1159 inline bool operator==(const MonsterT &lhs, const MonsterT &rhs) {
1160 return
1161 (lhs.pos == rhs.pos) &&
1162 (lhs.mana == rhs.mana) &&
1163 (lhs.hp == rhs.hp) &&
1164 (lhs.name == rhs.name) &&
1165 (lhs.inventory == rhs.inventory) &&
1166 (lhs.color == rhs.color) &&
1167 (lhs.test == rhs.test) &&
1168 (lhs.test4 == rhs.test4) &&
1169 (lhs.testarrayofstring == rhs.testarrayofstring) &&
1170 (lhs.testarrayoftables == rhs.testarrayoftables) &&
1171 (lhs.enemy == rhs.enemy) &&
1172 (lhs.testnestedflatbuffer == rhs.testnestedflatbuffer) &&
1173 (lhs.testempty == rhs.testempty) &&
1174 (lhs.testbool == rhs.testbool) &&
1175 (lhs.testhashs32_fnv1 == rhs.testhashs32_fnv1) &&
1176 (lhs.testhashu32_fnv1 == rhs.testhashu32_fnv1) &&
1177 (lhs.testhashs64_fnv1 == rhs.testhashs64_fnv1) &&
1178 (lhs.testhashu64_fnv1 == rhs.testhashu64_fnv1) &&
1179 (lhs.testhashs32_fnv1a == rhs.testhashs32_fnv1a) &&
1180 (lhs.testhashu32_fnv1a == rhs.testhashu32_fnv1a) &&
1181 (lhs.testhashs64_fnv1a == rhs.testhashs64_fnv1a) &&
1182 (lhs.testhashu64_fnv1a == rhs.testhashu64_fnv1a) &&
1183 (lhs.testarrayofbools == rhs.testarrayofbools) &&
1184 (lhs.testf == rhs.testf) &&
1185 (lhs.testf2 == rhs.testf2) &&
1186 (lhs.testf3 == rhs.testf3) &&
1187 (lhs.testarrayofstring2 == rhs.testarrayofstring2) &&
1188 (lhs.testarrayofsortedstruct == rhs.testarrayofsortedstruct) &&
1189 (lhs.flex == rhs.flex) &&
1190 (lhs.test5 == rhs.test5) &&
1191 (lhs.vector_of_longs == rhs.vector_of_longs) &&
1192 (lhs.vector_of_doubles == rhs.vector_of_doubles) &&
1193 (lhs.parent_namespace_test == rhs.parent_namespace_test) &&
1194 (lhs.vector_of_referrables == rhs.vector_of_referrables) &&
1195 (lhs.single_weak_reference == rhs.single_weak_reference) &&
1196 (lhs.vector_of_weak_references == rhs.vector_of_weak_references) &&
1197 (lhs.vector_of_strong_referrables == rhs.vector_of_strong_referrables) &&
1198 (lhs.co_owning_reference == rhs.co_owning_reference) &&
1199 (lhs.vector_of_co_owning_references == rhs.vector_of_co_owning_references) &&
1200 (lhs.non_owning_reference == rhs.non_owning_reference) &&
1201 (lhs.vector_of_non_owning_references == rhs.vector_of_non_owning_references) &&
1202 (lhs.any_unique == rhs.any_unique) &&
1203 (lhs.any_ambiguous == rhs.any_ambiguous) &&
1204 (lhs.vector_of_enums == rhs.vector_of_enums);
1205 }
1206
1207 inline bool operator!=(const MonsterT &lhs, const MonsterT &rhs) {
1208 return !(lhs == rhs);
1209 }
1210
1211
1212 /// an example documentation comment: monster object
1213 struct Monster FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
1214 typedef MonsterT NativeTableType;
1215 static const flatbuffers::TypeTable *MiniReflectTypeTable() {
1216 return MonsterTypeTable();
1217 }
1218 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
1219 VT_POS = 4,
1220 VT_MANA = 6,
1221 VT_HP = 8,
1222 VT_NAME = 10,
1223 VT_INVENTORY = 14,
1224 VT_COLOR = 16,
1225 VT_TEST_TYPE = 18,
1226 VT_TEST = 20,
1227 VT_TEST4 = 22,
1228 VT_TESTARRAYOFSTRING = 24,
1229 VT_TESTARRAYOFTABLES = 26,
1230 VT_ENEMY = 28,
1231 VT_TESTNESTEDFLATBUFFER = 30,
1232 VT_TESTEMPTY = 32,
1233 VT_TESTBOOL = 34,
1234 VT_TESTHASHS32_FNV1 = 36,
1235 VT_TESTHASHU32_FNV1 = 38,
1236 VT_TESTHASHS64_FNV1 = 40,
1237 VT_TESTHASHU64_FNV1 = 42,
1238 VT_TESTHASHS32_FNV1A = 44,
1239 VT_TESTHASHU32_FNV1A = 46,
1240 VT_TESTHASHS64_FNV1A = 48,
1241 VT_TESTHASHU64_FNV1A = 50,
1242 VT_TESTARRAYOFBOOLS = 52,
1243 VT_TESTF = 54,
1244 VT_TESTF2 = 56,
1245 VT_TESTF3 = 58,
1246 VT_TESTARRAYOFSTRING2 = 60,
1247 VT_TESTARRAYOFSORTEDSTRUCT = 62,
1248 VT_FLEX = 64,
1249 VT_TEST5 = 66,
1250 VT_VECTOR_OF_LONGS = 68,
1251 VT_VECTOR_OF_DOUBLES = 70,
1252 VT_PARENT_NAMESPACE_TEST = 72,
1253 VT_VECTOR_OF_REFERRABLES = 74,
1254 VT_SINGLE_WEAK_REFERENCE = 76,
1255 VT_VECTOR_OF_WEAK_REFERENCES = 78,
1256 VT_VECTOR_OF_STRONG_REFERRABLES = 80,
1257 VT_CO_OWNING_REFERENCE = 82,
1258 VT_VECTOR_OF_CO_OWNING_REFERENCES = 84,
1259 VT_NON_OWNING_REFERENCE = 86,
1260 VT_VECTOR_OF_NON_OWNING_REFERENCES = 88,
1261 VT_ANY_UNIQUE_TYPE = 90,
1262 VT_ANY_UNIQUE = 92,
1263 VT_ANY_AMBIGUOUS_TYPE = 94,
1264 VT_ANY_AMBIGUOUS = 96,
1265 VT_VECTOR_OF_ENUMS = 98
1266 };
1267 const Vec3 *pos() const {
1268 return GetStruct<const Vec3 *>(VT_POS);
1269 }
1270 Vec3 *mutable_pos() {
1271 return GetStruct<Vec3 *>(VT_POS);
1272 }
1273 int16_t mana() const {
1274 return GetField<int16_t>(VT_MANA, 150);
1275 }
1276 bool mutate_mana(int16_t _mana) {
1277 return SetField<int16_t>(VT_MANA, _mana, 150);
1278 }
1279 int16_t hp() const {
1280 return GetField<int16_t>(VT_HP, 100);
1281 }
1282 bool mutate_hp(int16_t _hp) {
1283 return SetField<int16_t>(VT_HP, _hp, 100);
1284 }
1285 const flatbuffers::String *name() const {
1286 return GetPointer<const flatbuffers::String *>(VT_NAME);
1287 }
1288 flatbuffers::String *mutable_name() {
1289 return GetPointer<flatbuffers::String *>(VT_NAME);
1290 }
1291 bool KeyCompareLessThan(const Monster *o) const {
1292 return *name() < *o->name();
1293 }
1294 int KeyCompareWithValue(const char *val) const {
1295 return strcmp(name()->c_str(), val);
1296 }
1297 const flatbuffers::Vector<uint8_t> *inventory() const {
1298 return GetPointer<const flatbuffers::Vector<uint8_t> *>(VT_INVENTORY);
1299 }
1300 flatbuffers::Vector<uint8_t> *mutable_inventory() {
1301 return GetPointer<flatbuffers::Vector<uint8_t> *>(VT_INVENTORY);
1302 }
1303 Color color() const {
1304 return static_cast<Color>(GetField<int8_t>(VT_COLOR, 8));
1305 }
1306 bool mutate_color(Color _color) {
1307 return SetField<int8_t>(VT_COLOR, static_cast<int8_t>(_color), 8);
1308 }
1309 Any test_type() const {
1310 return static_cast<Any>(GetField<uint8_t>(VT_TEST_TYPE, 0));
1311 }
1312 bool mutate_test_type(Any _test_type) {
1313 return SetField<uint8_t>(VT_TEST_TYPE, static_cast<uint8_t>(_test_type), 0);
1314 }
1315 const void *test() const {
1316 return GetPointer<const void *>(VT_TEST);
1317 }
1318 template<typename T> const T *test_as() const;
1319 const Monster *test_as_Monster() const {
1320 return test_type() == Any_Monster ? static_cast<const Monster *>(test()) : nullptr;
1321 }
1322 const TestSimpleTableWithEnum *test_as_TestSimpleTableWithEnum() const {
1323 return test_type() == Any_TestSimpleTableWithEnum ? static_cast<const TestSimpleTableWithEnum *>(test()) : nullptr;
1324 }
1325 const MyGame::Example2::Monster *test_as_MyGame_Example2_Monster() const {
1326 return test_type() == Any_MyGame_Example2_Monster ? static_cast<const MyGame::Example2::Monster *>(test()) : nullptr;
1327 }
1328 void *mutable_test() {
1329 return GetPointer<void *>(VT_TEST);
1330 }
1331 const flatbuffers::Vector<const Test *> *test4() const {
1332 return GetPointer<const flatbuffers::Vector<const Test *> *>(VT_TEST4);
1333 }
1334 flatbuffers::Vector<const Test *> *mutable_test4() {
1335 return GetPointer<flatbuffers::Vector<const Test *> *>(VT_TEST4);
1336 }
1337 const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *testarrayofstring() const {
1338 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *>(VT_TESTARRAYOFSTRING);
1339 }
1340 flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *mutable_testarrayofstring() {
1341 return GetPointer<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *>(VT_TESTARRAYOFSTRING);
1342 }
1343 /// an example documentation comment: this will end up in the generated code
1344 /// multiline too
1345 const flatbuffers::Vector<flatbuffers::Offset<Monster>> *testarrayoftables() const {
1346 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<Monster>> *>(VT_TESTARRAYOFTABLES);
1347 }
1348 flatbuffers::Vector<flatbuffers::Offset<Monster>> *mutable_testarrayoftables() {
1349 return GetPointer<flatbuffers::Vector<flatbuffers::Offset<Monster>> *>(VT_TESTARRAYOFTABLES);
1350 }
1351 const Monster *enemy() const {
1352 return GetPointer<const Monster *>(VT_ENEMY);
1353 }
1354 Monster *mutable_enemy() {
1355 return GetPointer<Monster *>(VT_ENEMY);
1356 }
1357 const flatbuffers::Vector<uint8_t> *testnestedflatbuffer() const {
1358 return GetPointer<const flatbuffers::Vector<uint8_t> *>(VT_TESTNESTEDFLATBUFFER);
1359 }
1360 flatbuffers::Vector<uint8_t> *mutable_testnestedflatbuffer() {
1361 return GetPointer<flatbuffers::Vector<uint8_t> *>(VT_TESTNESTEDFLATBUFFER);
1362 }
1363 const MyGame::Example::Monster *testnestedflatbuffer_nested_root() const {
1364 return flatbuffers::GetRoot<MyGame::Example::Monster>(testnestedflatbuffer()->Data());
1365 }
1366 const Stat *testempty() const {
1367 return GetPointer<const Stat *>(VT_TESTEMPTY);
1368 }
1369 Stat *mutable_testempty() {
1370 return GetPointer<Stat *>(VT_TESTEMPTY);
1371 }
1372 bool testbool() const {
1373 return GetField<uint8_t>(VT_TESTBOOL, 0) != 0;
1374 }
1375 bool mutate_testbool(bool _testbool) {
1376 return SetField<uint8_t>(VT_TESTBOOL, static_cast<uint8_t>(_testbool), 0);
1377 }
1378 int32_t testhashs32_fnv1() const {
1379 return GetField<int32_t>(VT_TESTHASHS32_FNV1, 0);
1380 }
1381 bool mutate_testhashs32_fnv1(int32_t _testhashs32_fnv1) {
1382 return SetField<int32_t>(VT_TESTHASHS32_FNV1, _testhashs32_fnv1, 0);
1383 }
1384 uint32_t testhashu32_fnv1() const {
1385 return GetField<uint32_t>(VT_TESTHASHU32_FNV1, 0);
1386 }
1387 bool mutate_testhashu32_fnv1(uint32_t _testhashu32_fnv1) {
1388 return SetField<uint32_t>(VT_TESTHASHU32_FNV1, _testhashu32_fnv1, 0);
1389 }
1390 int64_t testhashs64_fnv1() const {
1391 return GetField<int64_t>(VT_TESTHASHS64_FNV1, 0);
1392 }
1393 bool mutate_testhashs64_fnv1(int64_t _testhashs64_fnv1) {
1394 return SetField<int64_t>(VT_TESTHASHS64_FNV1, _testhashs64_fnv1, 0);
1395 }
1396 uint64_t testhashu64_fnv1() const {
1397 return GetField<uint64_t>(VT_TESTHASHU64_FNV1, 0);
1398 }
1399 bool mutate_testhashu64_fnv1(uint64_t _testhashu64_fnv1) {
1400 return SetField<uint64_t>(VT_TESTHASHU64_FNV1, _testhashu64_fnv1, 0);
1401 }
1402 int32_t testhashs32_fnv1a() const {
1403 return GetField<int32_t>(VT_TESTHASHS32_FNV1A, 0);
1404 }
1405 bool mutate_testhashs32_fnv1a(int32_t _testhashs32_fnv1a) {
1406 return SetField<int32_t>(VT_TESTHASHS32_FNV1A, _testhashs32_fnv1a, 0);
1407 }
1408 uint32_t testhashu32_fnv1a() const {
1409 return GetField<uint32_t>(VT_TESTHASHU32_FNV1A, 0);
1410 }
1411 bool mutate_testhashu32_fnv1a(uint32_t _testhashu32_fnv1a) {
1412 return SetField<uint32_t>(VT_TESTHASHU32_FNV1A, _testhashu32_fnv1a, 0);
1413 }
1414 int64_t testhashs64_fnv1a() const {
1415 return GetField<int64_t>(VT_TESTHASHS64_FNV1A, 0);
1416 }
1417 bool mutate_testhashs64_fnv1a(int64_t _testhashs64_fnv1a) {
1418 return SetField<int64_t>(VT_TESTHASHS64_FNV1A, _testhashs64_fnv1a, 0);
1419 }
1420 uint64_t testhashu64_fnv1a() const {
1421 return GetField<uint64_t>(VT_TESTHASHU64_FNV1A, 0);
1422 }
1423 bool mutate_testhashu64_fnv1a(uint64_t _testhashu64_fnv1a) {
1424 return SetField<uint64_t>(VT_TESTHASHU64_FNV1A, _testhashu64_fnv1a, 0);
1425 }
1426 const flatbuffers::Vector<uint8_t> *testarrayofbools() const {
1427 return GetPointer<const flatbuffers::Vector<uint8_t> *>(VT_TESTARRAYOFBOOLS);
1428 }
1429 flatbuffers::Vector<uint8_t> *mutable_testarrayofbools() {
1430 return GetPointer<flatbuffers::Vector<uint8_t> *>(VT_TESTARRAYOFBOOLS);
1431 }
1432 float testf() const {
1433 return GetField<float>(VT_TESTF, 3.14159f);
1434 }
1435 bool mutate_testf(float _testf) {
1436 return SetField<float>(VT_TESTF, _testf, 3.14159f);
1437 }
1438 float testf2() const {
1439 return GetField<float>(VT_TESTF2, 3.0f);
1440 }
1441 bool mutate_testf2(float _testf2) {
1442 return SetField<float>(VT_TESTF2, _testf2, 3.0f);
1443 }
1444 float testf3() const {
1445 return GetField<float>(VT_TESTF3, 0.0f);
1446 }
1447 bool mutate_testf3(float _testf3) {
1448 return SetField<float>(VT_TESTF3, _testf3, 0.0f);
1449 }
1450 const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *testarrayofstring2() const {
1451 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *>(VT_TESTARRAYOFSTRING2);
1452 }
1453 flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *mutable_testarrayofstring2() {
1454 return GetPointer<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *>(VT_TESTARRAYOFSTRING2);
1455 }
1456 const flatbuffers::Vector<const Ability *> *testarrayofsortedstruct() const {
1457 return GetPointer<const flatbuffers::Vector<const Ability *> *>(VT_TESTARRAYOFSORTEDSTRUCT);
1458 }
1459 flatbuffers::Vector<const Ability *> *mutable_testarrayofsortedstruct() {
1460 return GetPointer<flatbuffers::Vector<const Ability *> *>(VT_TESTARRAYOFSORTEDSTRUCT);
1461 }
1462 const flatbuffers::Vector<uint8_t> *flex() const {
1463 return GetPointer<const flatbuffers::Vector<uint8_t> *>(VT_FLEX);
1464 }
1465 flatbuffers::Vector<uint8_t> *mutable_flex() {
1466 return GetPointer<flatbuffers::Vector<uint8_t> *>(VT_FLEX);
1467 }
1468 flexbuffers::Reference flex_flexbuffer_root() const {
1469 return flexbuffers::GetRoot(flex()->Data(), flex()->size());
1470 }
1471 const flatbuffers::Vector<const Test *> *test5() const {
1472 return GetPointer<const flatbuffers::Vector<const Test *> *>(VT_TEST5);
1473 }
1474 flatbuffers::Vector<const Test *> *mutable_test5() {
1475 return GetPointer<flatbuffers::Vector<const Test *> *>(VT_TEST5);
1476 }
1477 const flatbuffers::Vector<int64_t> *vector_of_longs() const {
1478 return GetPointer<const flatbuffers::Vector<int64_t> *>(VT_VECTOR_OF_LONGS);
1479 }
1480 flatbuffers::Vector<int64_t> *mutable_vector_of_longs() {
1481 return GetPointer<flatbuffers::Vector<int64_t> *>(VT_VECTOR_OF_LONGS);
1482 }
1483 const flatbuffers::Vector<double> *vector_of_doubles() const {
1484 return GetPointer<const flatbuffers::Vector<double> *>(VT_VECTOR_OF_DOUBLES);
1485 }
1486 flatbuffers::Vector<double> *mutable_vector_of_doubles() {
1487 return GetPointer<flatbuffers::Vector<double> *>(VT_VECTOR_OF_DOUBLES);
1488 }
1489 const MyGame::InParentNamespace *parent_namespace_test() const {
1490 return GetPointer<const MyGame::InParentNamespace *>(VT_PARENT_NAMESPACE_TEST);
1491 }
1492 MyGame::InParentNamespace *mutable_parent_namespace_test() {
1493 return GetPointer<MyGame::InParentNamespace *>(VT_PARENT_NAMESPACE_TEST);
1494 }
1495 const flatbuffers::Vector<flatbuffers::Offset<Referrable>> *vector_of_referrables() const {
1496 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<Referrable>> *>(VT_VECTOR_OF_REFERRABLES);
1497 }
1498 flatbuffers::Vector<flatbuffers::Offset<Referrable>> *mutable_vector_of_referrables() {
1499 return GetPointer<flatbuffers::Vector<flatbuffers::Offset<Referrable>> *>(VT_VECTOR_OF_REFERRABLES);
1500 }
1501 uint64_t single_weak_reference() const {
1502 return GetField<uint64_t>(VT_SINGLE_WEAK_REFERENCE, 0);
1503 }
1504 bool mutate_single_weak_reference(uint64_t _single_weak_reference) {
1505 return SetField<uint64_t>(VT_SINGLE_WEAK_REFERENCE, _single_weak_reference, 0);
1506 }
1507 const flatbuffers::Vector<uint64_t> *vector_of_weak_references() const {
1508 return GetPointer<const flatbuffers::Vector<uint64_t> *>(VT_VECTOR_OF_WEAK_REFERENCES);
1509 }
1510 flatbuffers::Vector<uint64_t> *mutable_vector_of_weak_references() {
1511 return GetPointer<flatbuffers::Vector<uint64_t> *>(VT_VECTOR_OF_WEAK_REFERENCES);
1512 }
1513 const flatbuffers::Vector<flatbuffers::Offset<Referrable>> *vector_of_strong_referrables() const {
1514 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<Referrable>> *>(VT_VECTOR_OF_STRONG_REFERRABLES);
1515 }
1516 flatbuffers::Vector<flatbuffers::Offset<Referrable>> *mutable_vector_of_strong_referrables() {
1517 return GetPointer<flatbuffers::Vector<flatbuffers::Offset<Referrable>> *>(VT_VECTOR_OF_STRONG_REFERRABLES);
1518 }
1519 uint64_t co_owning_reference() const {
1520 return GetField<uint64_t>(VT_CO_OWNING_REFERENCE, 0);
1521 }
1522 bool mutate_co_owning_reference(uint64_t _co_owning_reference) {
1523 return SetField<uint64_t>(VT_CO_OWNING_REFERENCE, _co_owning_reference, 0);
1524 }
1525 const flatbuffers::Vector<uint64_t> *vector_of_co_owning_references() const {
1526 return GetPointer<const flatbuffers::Vector<uint64_t> *>(VT_VECTOR_OF_CO_OWNING_REFERENCES);
1527 }
1528 flatbuffers::Vector<uint64_t> *mutable_vector_of_co_owning_references() {
1529 return GetPointer<flatbuffers::Vector<uint64_t> *>(VT_VECTOR_OF_CO_OWNING_REFERENCES);
1530 }
1531 uint64_t non_owning_reference() const {
1532 return GetField<uint64_t>(VT_NON_OWNING_REFERENCE, 0);
1533 }
1534 bool mutate_non_owning_reference(uint64_t _non_owning_reference) {
1535 return SetField<uint64_t>(VT_NON_OWNING_REFERENCE, _non_owning_reference, 0);
1536 }
1537 const flatbuffers::Vector<uint64_t> *vector_of_non_owning_references() const {
1538 return GetPointer<const flatbuffers::Vector<uint64_t> *>(VT_VECTOR_OF_NON_OWNING_REFERENCES);
1539 }
1540 flatbuffers::Vector<uint64_t> *mutable_vector_of_non_owning_references() {
1541 return GetPointer<flatbuffers::Vector<uint64_t> *>(VT_VECTOR_OF_NON_OWNING_REFERENCES);
1542 }
1543 AnyUniqueAliases any_unique_type() const {
1544 return static_cast<AnyUniqueAliases>(GetField<uint8_t>(VT_ANY_UNIQUE_TYPE, 0));
1545 }
1546 bool mutate_any_unique_type(AnyUniqueAliases _any_unique_type) {
1547 return SetField<uint8_t>(VT_ANY_UNIQUE_TYPE, static_cast<uint8_t>(_any_unique_type), 0);
1548 }
1549 const void *any_unique() const {
1550 return GetPointer<const void *>(VT_ANY_UNIQUE);
1551 }
1552 template<typename T> const T *any_unique_as() const;
1553 const Monster *any_unique_as_M() const {
1554 return any_unique_type() == AnyUniqueAliases_M ? static_cast<const Monster *>(any_unique()) : nullptr;
1555 }
1556 const TestSimpleTableWithEnum *any_unique_as_T() const {
1557 return any_unique_type() == AnyUniqueAliases_T ? static_cast<const TestSimpleTableWithEnum *>(any_unique()) : nullptr;
1558 }
1559 const MyGame::Example2::Monster *any_unique_as_M2() const {
1560 return any_unique_type() == AnyUniqueAliases_M2 ? static_cast<const MyGame::Example2::Monster *>(any_unique()) : nullptr;
1561 }
1562 void *mutable_any_unique() {
1563 return GetPointer<void *>(VT_ANY_UNIQUE);
1564 }
1565 AnyAmbiguousAliases any_ambiguous_type() const {
1566 return static_cast<AnyAmbiguousAliases>(GetField<uint8_t>(VT_ANY_AMBIGUOUS_TYPE, 0));
1567 }
1568 bool mutate_any_ambiguous_type(AnyAmbiguousAliases _any_ambiguous_type) {
1569 return SetField<uint8_t>(VT_ANY_AMBIGUOUS_TYPE, static_cast<uint8_t>(_any_ambiguous_type), 0);
1570 }
1571 const void *any_ambiguous() const {
1572 return GetPointer<const void *>(VT_ANY_AMBIGUOUS);
1573 }
1574 const Monster *any_ambiguous_as_M1() const {
1575 return any_ambiguous_type() == AnyAmbiguousAliases_M1 ? static_cast<const Monster *>(any_ambiguous()) : nullptr;
1576 }
1577 const Monster *any_ambiguous_as_M2() const {
1578 return any_ambiguous_type() == AnyAmbiguousAliases_M2 ? static_cast<const Monster *>(any_ambiguous()) : nullptr;
1579 }
1580 const Monster *any_ambiguous_as_M3() const {
1581 return any_ambiguous_type() == AnyAmbiguousAliases_M3 ? static_cast<const Monster *>(any_ambiguous()) : nullptr;
1582 }
1583 void *mutable_any_ambiguous() {
1584 return GetPointer<void *>(VT_ANY_AMBIGUOUS);
1585 }
1586 const flatbuffers::Vector<int8_t> *vector_of_enums() const {
1587 return GetPointer<const flatbuffers::Vector<int8_t> *>(VT_VECTOR_OF_ENUMS);
1588 }
1589 flatbuffers::Vector<int8_t> *mutable_vector_of_enums() {
1590 return GetPointer<flatbuffers::Vector<int8_t> *>(VT_VECTOR_OF_ENUMS);
1591 }
1592 bool Verify(flatbuffers::Verifier &verifier) const {
1593 return VerifyTableStart(verifier) &&
1594 VerifyField<Vec3>(verifier, VT_POS) &&
1595 VerifyField<int16_t>(verifier, VT_MANA) &&
1596 VerifyField<int16_t>(verifier, VT_HP) &&
1597 VerifyOffsetRequired(verifier, VT_NAME) &&
1598 verifier.VerifyString(name()) &&
1599 VerifyOffset(verifier, VT_INVENTORY) &&
1600 verifier.VerifyVector(inventory()) &&
1601 VerifyField<int8_t>(verifier, VT_COLOR) &&
1602 VerifyField<uint8_t>(verifier, VT_TEST_TYPE) &&
1603 VerifyOffset(verifier, VT_TEST) &&
1604 VerifyAny(verifier, test(), test_type()) &&
1605 VerifyOffset(verifier, VT_TEST4) &&
1606 verifier.VerifyVector(test4()) &&
1607 VerifyOffset(verifier, VT_TESTARRAYOFSTRING) &&
1608 verifier.VerifyVector(testarrayofstring()) &&
1609 verifier.VerifyVectorOfStrings(testarrayofstring()) &&
1610 VerifyOffset(verifier, VT_TESTARRAYOFTABLES) &&
1611 verifier.VerifyVector(testarrayoftables()) &&
1612 verifier.VerifyVectorOfTables(testarrayoftables()) &&
1613 VerifyOffset(verifier, VT_ENEMY) &&
1614 verifier.VerifyTable(enemy()) &&
1615 VerifyOffset(verifier, VT_TESTNESTEDFLATBUFFER) &&
1616 verifier.VerifyVector(testnestedflatbuffer()) &&
1617 VerifyOffset(verifier, VT_TESTEMPTY) &&
1618 verifier.VerifyTable(testempty()) &&
1619 VerifyField<uint8_t>(verifier, VT_TESTBOOL) &&
1620 VerifyField<int32_t>(verifier, VT_TESTHASHS32_FNV1) &&
1621 VerifyField<uint32_t>(verifier, VT_TESTHASHU32_FNV1) &&
1622 VerifyField<int64_t>(verifier, VT_TESTHASHS64_FNV1) &&
1623 VerifyField<uint64_t>(verifier, VT_TESTHASHU64_FNV1) &&
1624 VerifyField<int32_t>(verifier, VT_TESTHASHS32_FNV1A) &&
1625 VerifyField<uint32_t>(verifier, VT_TESTHASHU32_FNV1A) &&
1626 VerifyField<int64_t>(verifier, VT_TESTHASHS64_FNV1A) &&
1627 VerifyField<uint64_t>(verifier, VT_TESTHASHU64_FNV1A) &&
1628 VerifyOffset(verifier, VT_TESTARRAYOFBOOLS) &&
1629 verifier.VerifyVector(testarrayofbools()) &&
1630 VerifyField<float>(verifier, VT_TESTF) &&
1631 VerifyField<float>(verifier, VT_TESTF2) &&
1632 VerifyField<float>(verifier, VT_TESTF3) &&
1633 VerifyOffset(verifier, VT_TESTARRAYOFSTRING2) &&
1634 verifier.VerifyVector(testarrayofstring2()) &&
1635 verifier.VerifyVectorOfStrings(testarrayofstring2()) &&
1636 VerifyOffset(verifier, VT_TESTARRAYOFSORTEDSTRUCT) &&
1637 verifier.VerifyVector(testarrayofsortedstruct()) &&
1638 VerifyOffset(verifier, VT_FLEX) &&
1639 verifier.VerifyVector(flex()) &&
1640 VerifyOffset(verifier, VT_TEST5) &&
1641 verifier.VerifyVector(test5()) &&
1642 VerifyOffset(verifier, VT_VECTOR_OF_LONGS) &&
1643 verifier.VerifyVector(vector_of_longs()) &&
1644 VerifyOffset(verifier, VT_VECTOR_OF_DOUBLES) &&
1645 verifier.VerifyVector(vector_of_doubles()) &&
1646 VerifyOffset(verifier, VT_PARENT_NAMESPACE_TEST) &&
1647 verifier.VerifyTable(parent_namespace_test()) &&
1648 VerifyOffset(verifier, VT_VECTOR_OF_REFERRABLES) &&
1649 verifier.VerifyVector(vector_of_referrables()) &&
1650 verifier.VerifyVectorOfTables(vector_of_referrables()) &&
1651 VerifyField<uint64_t>(verifier, VT_SINGLE_WEAK_REFERENCE) &&
1652 VerifyOffset(verifier, VT_VECTOR_OF_WEAK_REFERENCES) &&
1653 verifier.VerifyVector(vector_of_weak_references()) &&
1654 VerifyOffset(verifier, VT_VECTOR_OF_STRONG_REFERRABLES) &&
1655 verifier.VerifyVector(vector_of_strong_referrables()) &&
1656 verifier.VerifyVectorOfTables(vector_of_strong_referrables()) &&
1657 VerifyField<uint64_t>(verifier, VT_CO_OWNING_REFERENCE) &&
1658 VerifyOffset(verifier, VT_VECTOR_OF_CO_OWNING_REFERENCES) &&
1659 verifier.VerifyVector(vector_of_co_owning_references()) &&
1660 VerifyField<uint64_t>(verifier, VT_NON_OWNING_REFERENCE) &&
1661 VerifyOffset(verifier, VT_VECTOR_OF_NON_OWNING_REFERENCES) &&
1662 verifier.VerifyVector(vector_of_non_owning_references()) &&
1663 VerifyField<uint8_t>(verifier, VT_ANY_UNIQUE_TYPE) &&
1664 VerifyOffset(verifier, VT_ANY_UNIQUE) &&
1665 VerifyAnyUniqueAliases(verifier, any_unique(), any_unique_type()) &&
1666 VerifyField<uint8_t>(verifier, VT_ANY_AMBIGUOUS_TYPE) &&
1667 VerifyOffset(verifier, VT_ANY_AMBIGUOUS) &&
1668 VerifyAnyAmbiguousAliases(verifier, any_ambiguous(), any_ambiguous_type()) &&
1669 VerifyOffset(verifier, VT_VECTOR_OF_ENUMS) &&
1670 verifier.VerifyVector(vector_of_enums()) &&
1671 verifier.EndTable();
1672 }
1673 MonsterT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
1674 void UnPackTo(MonsterT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
1675 static flatbuffers::Offset<Monster> Pack(flatbuffers::FlatBufferBuilder &_fbb, const MonsterT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
1676 };
1677
1678 template<> inline const Monster *Monster::test_as<Monster>() const {
1679 return test_as_Monster();
1680 }
1681
1682 template<> inline const TestSimpleTableWithEnum *Monster::test_as<TestSimpleTableWithEnum>() const {
1683 return test_as_TestSimpleTableWithEnum();
1684 }
1685
1686 template<> inline const MyGame::Example2::Monster *Monster::test_as<MyGame::Example2::Monster>() const {
1687 return test_as_MyGame_Example2_Monster();
1688 }
1689
1690 template<> inline const Monster *Monster::any_unique_as<Monster>() const {
1691 return any_unique_as_M();
1692 }
1693
1694 template<> inline const TestSimpleTableWithEnum *Monster::any_unique_as<TestSimpleTableWithEnum>() const {
1695 return any_unique_as_T();
1696 }
1697
1698 template<> inline const MyGame::Example2::Monster *Monster::any_unique_as<MyGame::Example2::Monster>() const {
1699 return any_unique_as_M2();
1700 }
1701
1702 struct MonsterBuilder {
1703 flatbuffers::FlatBufferBuilder &fbb_;
1704 flatbuffers::uoffset_t start_;
1705 void add_pos(const Vec3 *pos) {
1706 fbb_.AddStruct(Monster::VT_POS, pos);
1707 }
1708 void add_mana(int16_t mana) {
1709 fbb_.AddElement<int16_t>(Monster::VT_MANA, mana, 150);
1710 }
1711 void add_hp(int16_t hp) {
1712 fbb_.AddElement<int16_t>(Monster::VT_HP, hp, 100);
1713 }
1714 void add_name(flatbuffers::Offset<flatbuffers::String> name) {
1715 fbb_.AddOffset(Monster::VT_NAME, name);
1716 }
1717 void add_inventory(flatbuffers::Offset<flatbuffers::Vector<uint8_t>> inventory) {
1718 fbb_.AddOffset(Monster::VT_INVENTORY, inventory);
1719 }
1720 void add_color(Color color) {
1721 fbb_.AddElement<int8_t>(Monster::VT_COLOR, static_cast<int8_t>(color), 8);
1722 }
1723 void add_test_type(Any test_type) {
1724 fbb_.AddElement<uint8_t>(Monster::VT_TEST_TYPE, static_cast<uint8_t>(test_type), 0);
1725 }
1726 void add_test(flatbuffers::Offset<void> test) {
1727 fbb_.AddOffset(Monster::VT_TEST, test);
1728 }
1729 void add_test4(flatbuffers::Offset<flatbuffers::Vector<const Test *>> test4) {
1730 fbb_.AddOffset(Monster::VT_TEST4, test4);
1731 }
1732 void add_testarrayofstring(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> testarrayofstring) {
1733 fbb_.AddOffset(Monster::VT_TESTARRAYOFSTRING, testarrayofstring);
1734 }
1735 void add_testarrayoftables(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<Monster>>> testarrayoftables) {
1736 fbb_.AddOffset(Monster::VT_TESTARRAYOFTABLES, testarrayoftables);
1737 }
1738 void add_enemy(flatbuffers::Offset<Monster> enemy) {
1739 fbb_.AddOffset(Monster::VT_ENEMY, enemy);
1740 }
1741 void add_testnestedflatbuffer(flatbuffers::Offset<flatbuffers::Vector<uint8_t>> testnestedflatbuffer) {
1742 fbb_.AddOffset(Monster::VT_TESTNESTEDFLATBUFFER, testnestedflatbuffer);
1743 }
1744 void add_testempty(flatbuffers::Offset<Stat> testempty) {
1745 fbb_.AddOffset(Monster::VT_TESTEMPTY, testempty);
1746 }
1747 void add_testbool(bool testbool) {
1748 fbb_.AddElement<uint8_t>(Monster::VT_TESTBOOL, static_cast<uint8_t>(testbool), 0);
1749 }
1750 void add_testhashs32_fnv1(int32_t testhashs32_fnv1) {
1751 fbb_.AddElement<int32_t>(Monster::VT_TESTHASHS32_FNV1, testhashs32_fnv1, 0);
1752 }
1753 void add_testhashu32_fnv1(uint32_t testhashu32_fnv1) {
1754 fbb_.AddElement<uint32_t>(Monster::VT_TESTHASHU32_FNV1, testhashu32_fnv1, 0);
1755 }
1756 void add_testhashs64_fnv1(int64_t testhashs64_fnv1) {
1757 fbb_.AddElement<int64_t>(Monster::VT_TESTHASHS64_FNV1, testhashs64_fnv1, 0);
1758 }
1759 void add_testhashu64_fnv1(uint64_t testhashu64_fnv1) {
1760 fbb_.AddElement<uint64_t>(Monster::VT_TESTHASHU64_FNV1, testhashu64_fnv1, 0);
1761 }
1762 void add_testhashs32_fnv1a(int32_t testhashs32_fnv1a) {
1763 fbb_.AddElement<int32_t>(Monster::VT_TESTHASHS32_FNV1A, testhashs32_fnv1a, 0);
1764 }
1765 void add_testhashu32_fnv1a(uint32_t testhashu32_fnv1a) {
1766 fbb_.AddElement<uint32_t>(Monster::VT_TESTHASHU32_FNV1A, testhashu32_fnv1a, 0);
1767 }
1768 void add_testhashs64_fnv1a(int64_t testhashs64_fnv1a) {
1769 fbb_.AddElement<int64_t>(Monster::VT_TESTHASHS64_FNV1A, testhashs64_fnv1a, 0);
1770 }
1771 void add_testhashu64_fnv1a(uint64_t testhashu64_fnv1a) {
1772 fbb_.AddElement<uint64_t>(Monster::VT_TESTHASHU64_FNV1A, testhashu64_fnv1a, 0);
1773 }
1774 void add_testarrayofbools(flatbuffers::Offset<flatbuffers::Vector<uint8_t>> testarrayofbools) {
1775 fbb_.AddOffset(Monster::VT_TESTARRAYOFBOOLS, testarrayofbools);
1776 }
1777 void add_testf(float testf) {
1778 fbb_.AddElement<float>(Monster::VT_TESTF, testf, 3.14159f);
1779 }
1780 void add_testf2(float testf2) {
1781 fbb_.AddElement<float>(Monster::VT_TESTF2, testf2, 3.0f);
1782 }
1783 void add_testf3(float testf3) {
1784 fbb_.AddElement<float>(Monster::VT_TESTF3, testf3, 0.0f);
1785 }
1786 void add_testarrayofstring2(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> testarrayofstring2) {
1787 fbb_.AddOffset(Monster::VT_TESTARRAYOFSTRING2, testarrayofstring2);
1788 }
1789 void add_testarrayofsortedstruct(flatbuffers::Offset<flatbuffers::Vector<const Ability *>> testarrayofsortedstruct) {
1790 fbb_.AddOffset(Monster::VT_TESTARRAYOFSORTEDSTRUCT, testarrayofsortedstruct);
1791 }
1792 void add_flex(flatbuffers::Offset<flatbuffers::Vector<uint8_t>> flex) {
1793 fbb_.AddOffset(Monster::VT_FLEX, flex);
1794 }
1795 void add_test5(flatbuffers::Offset<flatbuffers::Vector<const Test *>> test5) {
1796 fbb_.AddOffset(Monster::VT_TEST5, test5);
1797 }
1798 void add_vector_of_longs(flatbuffers::Offset<flatbuffers::Vector<int64_t>> vector_of_longs) {
1799 fbb_.AddOffset(Monster::VT_VECTOR_OF_LONGS, vector_of_longs);
1800 }
1801 void add_vector_of_doubles(flatbuffers::Offset<flatbuffers::Vector<double>> vector_of_doubles) {
1802 fbb_.AddOffset(Monster::VT_VECTOR_OF_DOUBLES, vector_of_doubles);
1803 }
1804 void add_parent_namespace_test(flatbuffers::Offset<MyGame::InParentNamespace> parent_namespace_test) {
1805 fbb_.AddOffset(Monster::VT_PARENT_NAMESPACE_TEST, parent_namespace_test);
1806 }
1807 void add_vector_of_referrables(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<Referrable>>> vector_of_referrables) {
1808 fbb_.AddOffset(Monster::VT_VECTOR_OF_REFERRABLES, vector_of_referrables);
1809 }
1810 void add_single_weak_reference(uint64_t single_weak_reference) {
1811 fbb_.AddElement<uint64_t>(Monster::VT_SINGLE_WEAK_REFERENCE, single_weak_reference, 0);
1812 }
1813 void add_vector_of_weak_references(flatbuffers::Offset<flatbuffers::Vector<uint64_t>> vector_of_weak_references) {
1814 fbb_.AddOffset(Monster::VT_VECTOR_OF_WEAK_REFERENCES, vector_of_weak_references);
1815 }
1816 void add_vector_of_strong_referrables(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<Referrable>>> vector_of_strong_referrables) {
1817 fbb_.AddOffset(Monster::VT_VECTOR_OF_STRONG_REFERRABLES, vector_of_strong_referrables);
1818 }
1819 void add_co_owning_reference(uint64_t co_owning_reference) {
1820 fbb_.AddElement<uint64_t>(Monster::VT_CO_OWNING_REFERENCE, co_owning_reference, 0);
1821 }
1822 void add_vector_of_co_owning_references(flatbuffers::Offset<flatbuffers::Vector<uint64_t>> vector_of_co_owning_references) {
1823 fbb_.AddOffset(Monster::VT_VECTOR_OF_CO_OWNING_REFERENCES, vector_of_co_owning_references);
1824 }
1825 void add_non_owning_reference(uint64_t non_owning_reference) {
1826 fbb_.AddElement<uint64_t>(Monster::VT_NON_OWNING_REFERENCE, non_owning_reference, 0);
1827 }
1828 void add_vector_of_non_owning_references(flatbuffers::Offset<flatbuffers::Vector<uint64_t>> vector_of_non_owning_references) {
1829 fbb_.AddOffset(Monster::VT_VECTOR_OF_NON_OWNING_REFERENCES, vector_of_non_owning_references);
1830 }
1831 void add_any_unique_type(AnyUniqueAliases any_unique_type) {
1832 fbb_.AddElement<uint8_t>(Monster::VT_ANY_UNIQUE_TYPE, static_cast<uint8_t>(any_unique_type), 0);
1833 }
1834 void add_any_unique(flatbuffers::Offset<void> any_unique) {
1835 fbb_.AddOffset(Monster::VT_ANY_UNIQUE, any_unique);
1836 }
1837 void add_any_ambiguous_type(AnyAmbiguousAliases any_ambiguous_type) {
1838 fbb_.AddElement<uint8_t>(Monster::VT_ANY_AMBIGUOUS_TYPE, static_cast<uint8_t>(any_ambiguous_type), 0);
1839 }
1840 void add_any_ambiguous(flatbuffers::Offset<void> any_ambiguous) {
1841 fbb_.AddOffset(Monster::VT_ANY_AMBIGUOUS, any_ambiguous);
1842 }
1843 void add_vector_of_enums(flatbuffers::Offset<flatbuffers::Vector<int8_t>> vector_of_enums) {
1844 fbb_.AddOffset(Monster::VT_VECTOR_OF_ENUMS, vector_of_enums);
1845 }
1846 explicit MonsterBuilder(flatbuffers::FlatBufferBuilder &_fbb)
1847 : fbb_(_fbb) {
1848 start_ = fbb_.StartTable();
1849 }
1850 MonsterBuilder &operator=(const MonsterBuilder &);
1851 flatbuffers::Offset<Monster> Finish() {
1852 const auto end = fbb_.EndTable(start_);
1853 auto o = flatbuffers::Offset<Monster>(end);
1854 fbb_.Required(o, Monster::VT_NAME);
1855 return o;
1856 }
1857 };
1858
1859 inline flatbuffers::Offset<Monster> CreateMonster(
1860 flatbuffers::FlatBufferBuilder &_fbb,
1861 const Vec3 *pos = 0,
1862 int16_t mana = 150,
1863 int16_t hp = 100,
1864 flatbuffers::Offset<flatbuffers::String> name = 0,
1865 flatbuffers::Offset<flatbuffers::Vector<uint8_t>> inventory = 0,
1866 Color color = Color_Blue,
1867 Any test_type = Any_NONE,
1868 flatbuffers::Offset<void> test = 0,
1869 flatbuffers::Offset<flatbuffers::Vector<const Test *>> test4 = 0,
1870 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> testarrayofstring = 0,
1871 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<Monster>>> testarrayoftables = 0,
1872 flatbuffers::Offset<Monster> enemy = 0,
1873 flatbuffers::Offset<flatbuffers::Vector<uint8_t>> testnestedflatbuffer = 0,
1874 flatbuffers::Offset<Stat> testempty = 0,
1875 bool testbool = false,
1876 int32_t testhashs32_fnv1 = 0,
1877 uint32_t testhashu32_fnv1 = 0,
1878 int64_t testhashs64_fnv1 = 0,
1879 uint64_t testhashu64_fnv1 = 0,
1880 int32_t testhashs32_fnv1a = 0,
1881 uint32_t testhashu32_fnv1a = 0,
1882 int64_t testhashs64_fnv1a = 0,
1883 uint64_t testhashu64_fnv1a = 0,
1884 flatbuffers::Offset<flatbuffers::Vector<uint8_t>> testarrayofbools = 0,
1885 float testf = 3.14159f,
1886 float testf2 = 3.0f,
1887 float testf3 = 0.0f,
1888 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> testarrayofstring2 = 0,
1889 flatbuffers::Offset<flatbuffers::Vector<const Ability *>> testarrayofsortedstruct = 0,
1890 flatbuffers::Offset<flatbuffers::Vector<uint8_t>> flex = 0,
1891 flatbuffers::Offset<flatbuffers::Vector<const Test *>> test5 = 0,
1892 flatbuffers::Offset<flatbuffers::Vector<int64_t>> vector_of_longs = 0,
1893 flatbuffers::Offset<flatbuffers::Vector<double>> vector_of_doubles = 0,
1894 flatbuffers::Offset<MyGame::InParentNamespace> parent_namespace_test = 0,
1895 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<Referrable>>> vector_of_referrables = 0,
1896 uint64_t single_weak_reference = 0,
1897 flatbuffers::Offset<flatbuffers::Vector<uint64_t>> vector_of_weak_references = 0,
1898 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<Referrable>>> vector_of_strong_referrables = 0,
1899 uint64_t co_owning_reference = 0,
1900 flatbuffers::Offset<flatbuffers::Vector<uint64_t>> vector_of_co_owning_references = 0,
1901 uint64_t non_owning_reference = 0,
1902 flatbuffers::Offset<flatbuffers::Vector<uint64_t>> vector_of_non_owning_references = 0,
1903 AnyUniqueAliases any_unique_type = AnyUniqueAliases_NONE,
1904 flatbuffers::Offset<void> any_unique = 0,
1905 AnyAmbiguousAliases any_ambiguous_type = AnyAmbiguousAliases_NONE,
1906 flatbuffers::Offset<void> any_ambiguous = 0,
1907 flatbuffers::Offset<flatbuffers::Vector<int8_t>> vector_of_enums = 0) {
1908 MonsterBuilder builder_(_fbb);
1909 builder_.add_non_owning_reference(non_owning_reference);
1910 builder_.add_co_owning_reference(co_owning_reference);
1911 builder_.add_single_weak_reference(single_weak_reference);
1912 builder_.add_testhashu64_fnv1a(testhashu64_fnv1a);
1913 builder_.add_testhashs64_fnv1a(testhashs64_fnv1a);
1914 builder_.add_testhashu64_fnv1(testhashu64_fnv1);
1915 builder_.add_testhashs64_fnv1(testhashs64_fnv1);
1916 builder_.add_vector_of_enums(vector_of_enums);
1917 builder_.add_any_ambiguous(any_ambiguous);
1918 builder_.add_any_unique(any_unique);
1919 builder_.add_vector_of_non_owning_references(vector_of_non_owning_references);
1920 builder_.add_vector_of_co_owning_references(vector_of_co_owning_references);
1921 builder_.add_vector_of_strong_referrables(vector_of_strong_referrables);
1922 builder_.add_vector_of_weak_references(vector_of_weak_references);
1923 builder_.add_vector_of_referrables(vector_of_referrables);
1924 builder_.add_parent_namespace_test(parent_namespace_test);
1925 builder_.add_vector_of_doubles(vector_of_doubles);
1926 builder_.add_vector_of_longs(vector_of_longs);
1927 builder_.add_test5(test5);
1928 builder_.add_flex(flex);
1929 builder_.add_testarrayofsortedstruct(testarrayofsortedstruct);
1930 builder_.add_testarrayofstring2(testarrayofstring2);
1931 builder_.add_testf3(testf3);
1932 builder_.add_testf2(testf2);
1933 builder_.add_testf(testf);
1934 builder_.add_testarrayofbools(testarrayofbools);
1935 builder_.add_testhashu32_fnv1a(testhashu32_fnv1a);
1936 builder_.add_testhashs32_fnv1a(testhashs32_fnv1a);
1937 builder_.add_testhashu32_fnv1(testhashu32_fnv1);
1938 builder_.add_testhashs32_fnv1(testhashs32_fnv1);
1939 builder_.add_testempty(testempty);
1940 builder_.add_testnestedflatbuffer(testnestedflatbuffer);
1941 builder_.add_enemy(enemy);
1942 builder_.add_testarrayoftables(testarrayoftables);
1943 builder_.add_testarrayofstring(testarrayofstring);
1944 builder_.add_test4(test4);
1945 builder_.add_test(test);
1946 builder_.add_inventory(inventory);
1947 builder_.add_name(name);
1948 builder_.add_pos(pos);
1949 builder_.add_hp(hp);
1950 builder_.add_mana(mana);
1951 builder_.add_any_ambiguous_type(any_ambiguous_type);
1952 builder_.add_any_unique_type(any_unique_type);
1953 builder_.add_testbool(testbool);
1954 builder_.add_test_type(test_type);
1955 builder_.add_color(color);
1956 return builder_.Finish();
1957 }
1958
1959 inline flatbuffers::Offset<Monster> CreateMonsterDirect(
1960 flatbuffers::FlatBufferBuilder &_fbb,
1961 const Vec3 *pos = 0,
1962 int16_t mana = 150,
1963 int16_t hp = 100,
1964 const char *name = nullptr,
1965 const std::vector<uint8_t> *inventory = nullptr,
1966 Color color = Color_Blue,
1967 Any test_type = Any_NONE,
1968 flatbuffers::Offset<void> test = 0,
1969 const std::vector<Test> *test4 = nullptr,
1970 const std::vector<flatbuffers::Offset<flatbuffers::String>> *testarrayofstring = nullptr,
1971 const std::vector<flatbuffers::Offset<Monster>> *testarrayoftables = nullptr,
1972 flatbuffers::Offset<Monster> enemy = 0,
1973 const std::vector<uint8_t> *testnestedflatbuffer = nullptr,
1974 flatbuffers::Offset<Stat> testempty = 0,
1975 bool testbool = false,
1976 int32_t testhashs32_fnv1 = 0,
1977 uint32_t testhashu32_fnv1 = 0,
1978 int64_t testhashs64_fnv1 = 0,
1979 uint64_t testhashu64_fnv1 = 0,
1980 int32_t testhashs32_fnv1a = 0,
1981 uint32_t testhashu32_fnv1a = 0,
1982 int64_t testhashs64_fnv1a = 0,
1983 uint64_t testhashu64_fnv1a = 0,
1984 const std::vector<uint8_t> *testarrayofbools = nullptr,
1985 float testf = 3.14159f,
1986 float testf2 = 3.0f,
1987 float testf3 = 0.0f,
1988 const std::vector<flatbuffers::Offset<flatbuffers::String>> *testarrayofstring2 = nullptr,
1989 const std::vector<Ability> *testarrayofsortedstruct = nullptr,
1990 const std::vector<uint8_t> *flex = nullptr,
1991 const std::vector<Test> *test5 = nullptr,
1992 const std::vector<int64_t> *vector_of_longs = nullptr,
1993 const std::vector<double> *vector_of_doubles = nullptr,
1994 flatbuffers::Offset<MyGame::InParentNamespace> parent_namespace_test = 0,
1995 const std::vector<flatbuffers::Offset<Referrable>> *vector_of_referrables = nullptr,
1996 uint64_t single_weak_reference = 0,
1997 const std::vector<uint64_t> *vector_of_weak_references = nullptr,
1998 const std::vector<flatbuffers::Offset<Referrable>> *vector_of_strong_referrables = nullptr,
1999 uint64_t co_owning_reference = 0,
2000 const std::vector<uint64_t> *vector_of_co_owning_references = nullptr,
2001 uint64_t non_owning_reference = 0,
2002 const std::vector<uint64_t> *vector_of_non_owning_references = nullptr,
2003 AnyUniqueAliases any_unique_type = AnyUniqueAliases_NONE,
2004 flatbuffers::Offset<void> any_unique = 0,
2005 AnyAmbiguousAliases any_ambiguous_type = AnyAmbiguousAliases_NONE,
2006 flatbuffers::Offset<void> any_ambiguous = 0,
2007 const std::vector<int8_t> *vector_of_enums = nullptr) {
2008 auto name__ = name ? _fbb.CreateString(name) : 0;
2009 auto inventory__ = inventory ? _fbb.CreateVector<uint8_t>(*inventory) : 0;
2010 auto test4__ = test4 ? _fbb.CreateVectorOfStructs<Test>(*test4) : 0;
2011 auto testarrayofstring__ = testarrayofstring ? _fbb.CreateVector<flatbuffers::Offset<flatbuffers::String>>(*testarrayofstring) : 0;
2012 auto testarrayoftables__ = testarrayoftables ? _fbb.CreateVector<flatbuffers::Offset<Monster>>(*testarrayoftables) : 0;
2013 auto testnestedflatbuffer__ = testnestedflatbuffer ? _fbb.CreateVector<uint8_t>(*testnestedflatbuffer) : 0;
2014 auto testarrayofbools__ = testarrayofbools ? _fbb.CreateVector<uint8_t>(*testarrayofbools) : 0;
2015 auto testarrayofstring2__ = testarrayofstring2 ? _fbb.CreateVector<flatbuffers::Offset<flatbuffers::String>>(*testarrayofstring2) : 0;
2016 auto testarrayofsortedstruct__ = testarrayofsortedstruct ? _fbb.CreateVectorOfStructs<Ability>(*testarrayofsortedstruct) : 0;
2017 auto flex__ = flex ? _fbb.CreateVector<uint8_t>(*flex) : 0;
2018 auto test5__ = test5 ? _fbb.CreateVectorOfStructs<Test>(*test5) : 0;
2019 auto vector_of_longs__ = vector_of_longs ? _fbb.CreateVector<int64_t>(*vector_of_longs) : 0;
2020 auto vector_of_doubles__ = vector_of_doubles ? _fbb.CreateVector<double>(*vector_of_doubles) : 0;
2021 auto vector_of_referrables__ = vector_of_referrables ? _fbb.CreateVector<flatbuffers::Offset<Referrable>>(*vector_of_referrables) : 0;
2022 auto vector_of_weak_references__ = vector_of_weak_references ? _fbb.CreateVector<uint64_t>(*vector_of_weak_references) : 0;
2023 auto vector_of_strong_referrables__ = vector_of_strong_referrables ? _fbb.CreateVector<flatbuffers::Offset<Referrable>>(*vector_of_strong_referrables) : 0;
2024 auto vector_of_co_owning_references__ = vector_of_co_owning_references ? _fbb.CreateVector<uint64_t>(*vector_of_co_owning_references) : 0;
2025 auto vector_of_non_owning_references__ = vector_of_non_owning_references ? _fbb.CreateVector<uint64_t>(*vector_of_non_owning_references) : 0;
2026 auto vector_of_enums__ = vector_of_enums ? _fbb.CreateVector<int8_t>(*vector_of_enums) : 0;
2027 return MyGame::Example::CreateMonster(
2028 _fbb,
2029 pos,
2030 mana,
2031 hp,
2032 name__,
2033 inventory__,
2034 color,
2035 test_type,
2036 test,
2037 test4__,
2038 testarrayofstring__,
2039 testarrayoftables__,
2040 enemy,
2041 testnestedflatbuffer__,
2042 testempty,
2043 testbool,
2044 testhashs32_fnv1,
2045 testhashu32_fnv1,
2046 testhashs64_fnv1,
2047 testhashu64_fnv1,
2048 testhashs32_fnv1a,
2049 testhashu32_fnv1a,
2050 testhashs64_fnv1a,
2051 testhashu64_fnv1a,
2052 testarrayofbools__,
2053 testf,
2054 testf2,
2055 testf3,
2056 testarrayofstring2__,
2057 testarrayofsortedstruct__,
2058 flex__,
2059 test5__,
2060 vector_of_longs__,
2061 vector_of_doubles__,
2062 parent_namespace_test,
2063 vector_of_referrables__,
2064 single_weak_reference,
2065 vector_of_weak_references__,
2066 vector_of_strong_referrables__,
2067 co_owning_reference,
2068 vector_of_co_owning_references__,
2069 non_owning_reference,
2070 vector_of_non_owning_references__,
2071 any_unique_type,
2072 any_unique,
2073 any_ambiguous_type,
2074 any_ambiguous,
2075 vector_of_enums__);
2076 }
2077
2078 flatbuffers::Offset<Monster> CreateMonster(flatbuffers::FlatBufferBuilder &_fbb, const MonsterT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
2079
2080 struct TypeAliasesT : public flatbuffers::NativeTable {
2081 typedef TypeAliases TableType;
2082 int8_t i8;
2083 uint8_t u8;
2084 int16_t i16;
2085 uint16_t u16;
2086 int32_t i32;
2087 uint32_t u32;
2088 int64_t i64;
2089 uint64_t u64;
2090 float f32;
2091 double f64;
2092 std::vector<int8_t> v8;
2093 std::vector<double> vf64;
2094 TypeAliasesT()
2095 : i8(0),
2096 u8(0),
2097 i16(0),
2098 u16(0),
2099 i32(0),
2100 u32(0),
2101 i64(0),
2102 u64(0),
2103 f32(0.0f),
2104 f64(0.0) {
2105 }
2106 };
2107
2108 inline bool operator==(const TypeAliasesT &lhs, const TypeAliasesT &rhs) {
2109 return
2110 (lhs.i8 == rhs.i8) &&
2111 (lhs.u8 == rhs.u8) &&
2112 (lhs.i16 == rhs.i16) &&
2113 (lhs.u16 == rhs.u16) &&
2114 (lhs.i32 == rhs.i32) &&
2115 (lhs.u32 == rhs.u32) &&
2116 (lhs.i64 == rhs.i64) &&
2117 (lhs.u64 == rhs.u64) &&
2118 (lhs.f32 == rhs.f32) &&
2119 (lhs.f64 == rhs.f64) &&
2120 (lhs.v8 == rhs.v8) &&
2121 (lhs.vf64 == rhs.vf64);
2122 }
2123
2124 inline bool operator!=(const TypeAliasesT &lhs, const TypeAliasesT &rhs) {
2125 return !(lhs == rhs);
2126 }
2127
2128
2129 struct TypeAliases FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
2130 typedef TypeAliasesT NativeTableType;
2131 static const flatbuffers::TypeTable *MiniReflectTypeTable() {
2132 return TypeAliasesTypeTable();
2133 }
2134 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
2135 VT_I8 = 4,
2136 VT_U8 = 6,
2137 VT_I16 = 8,
2138 VT_U16 = 10,
2139 VT_I32 = 12,
2140 VT_U32 = 14,
2141 VT_I64 = 16,
2142 VT_U64 = 18,
2143 VT_F32 = 20,
2144 VT_F64 = 22,
2145 VT_V8 = 24,
2146 VT_VF64 = 26
2147 };
2148 int8_t i8() const {
2149 return GetField<int8_t>(VT_I8, 0);
2150 }
2151 bool mutate_i8(int8_t _i8) {
2152 return SetField<int8_t>(VT_I8, _i8, 0);
2153 }
2154 uint8_t u8() const {
2155 return GetField<uint8_t>(VT_U8, 0);
2156 }
2157 bool mutate_u8(uint8_t _u8) {
2158 return SetField<uint8_t>(VT_U8, _u8, 0);
2159 }
2160 int16_t i16() const {
2161 return GetField<int16_t>(VT_I16, 0);
2162 }
2163 bool mutate_i16(int16_t _i16) {
2164 return SetField<int16_t>(VT_I16, _i16, 0);
2165 }
2166 uint16_t u16() const {
2167 return GetField<uint16_t>(VT_U16, 0);
2168 }
2169 bool mutate_u16(uint16_t _u16) {
2170 return SetField<uint16_t>(VT_U16, _u16, 0);
2171 }
2172 int32_t i32() const {
2173 return GetField<int32_t>(VT_I32, 0);
2174 }
2175 bool mutate_i32(int32_t _i32) {
2176 return SetField<int32_t>(VT_I32, _i32, 0);
2177 }
2178 uint32_t u32() const {
2179 return GetField<uint32_t>(VT_U32, 0);
2180 }
2181 bool mutate_u32(uint32_t _u32) {
2182 return SetField<uint32_t>(VT_U32, _u32, 0);
2183 }
2184 int64_t i64() const {
2185 return GetField<int64_t>(VT_I64, 0);
2186 }
2187 bool mutate_i64(int64_t _i64) {
2188 return SetField<int64_t>(VT_I64, _i64, 0);
2189 }
2190 uint64_t u64() const {
2191 return GetField<uint64_t>(VT_U64, 0);
2192 }
2193 bool mutate_u64(uint64_t _u64) {
2194 return SetField<uint64_t>(VT_U64, _u64, 0);
2195 }
2196 float f32() const {
2197 return GetField<float>(VT_F32, 0.0f);
2198 }
2199 bool mutate_f32(float _f32) {
2200 return SetField<float>(VT_F32, _f32, 0.0f);
2201 }
2202 double f64() const {
2203 return GetField<double>(VT_F64, 0.0);
2204 }
2205 bool mutate_f64(double _f64) {
2206 return SetField<double>(VT_F64, _f64, 0.0);
2207 }
2208 const flatbuffers::Vector<int8_t> *v8() const {
2209 return GetPointer<const flatbuffers::Vector<int8_t> *>(VT_V8);
2210 }
2211 flatbuffers::Vector<int8_t> *mutable_v8() {
2212 return GetPointer<flatbuffers::Vector<int8_t> *>(VT_V8);
2213 }
2214 const flatbuffers::Vector<double> *vf64() const {
2215 return GetPointer<const flatbuffers::Vector<double> *>(VT_VF64);
2216 }
2217 flatbuffers::Vector<double> *mutable_vf64() {
2218 return GetPointer<flatbuffers::Vector<double> *>(VT_VF64);
2219 }
2220 bool Verify(flatbuffers::Verifier &verifier) const {
2221 return VerifyTableStart(verifier) &&
2222 VerifyField<int8_t>(verifier, VT_I8) &&
2223 VerifyField<uint8_t>(verifier, VT_U8) &&
2224 VerifyField<int16_t>(verifier, VT_I16) &&
2225 VerifyField<uint16_t>(verifier, VT_U16) &&
2226 VerifyField<int32_t>(verifier, VT_I32) &&
2227 VerifyField<uint32_t>(verifier, VT_U32) &&
2228 VerifyField<int64_t>(verifier, VT_I64) &&
2229 VerifyField<uint64_t>(verifier, VT_U64) &&
2230 VerifyField<float>(verifier, VT_F32) &&
2231 VerifyField<double>(verifier, VT_F64) &&
2232 VerifyOffset(verifier, VT_V8) &&
2233 verifier.VerifyVector(v8()) &&
2234 VerifyOffset(verifier, VT_VF64) &&
2235 verifier.VerifyVector(vf64()) &&
2236 verifier.EndTable();
2237 }
2238 TypeAliasesT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
2239 void UnPackTo(TypeAliasesT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
2240 static flatbuffers::Offset<TypeAliases> Pack(flatbuffers::FlatBufferBuilder &_fbb, const TypeAliasesT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
2241 };
2242
2243 struct TypeAliasesBuilder {
2244 flatbuffers::FlatBufferBuilder &fbb_;
2245 flatbuffers::uoffset_t start_;
2246 void add_i8(int8_t i8) {
2247 fbb_.AddElement<int8_t>(TypeAliases::VT_I8, i8, 0);
2248 }
2249 void add_u8(uint8_t u8) {
2250 fbb_.AddElement<uint8_t>(TypeAliases::VT_U8, u8, 0);
2251 }
2252 void add_i16(int16_t i16) {
2253 fbb_.AddElement<int16_t>(TypeAliases::VT_I16, i16, 0);
2254 }
2255 void add_u16(uint16_t u16) {
2256 fbb_.AddElement<uint16_t>(TypeAliases::VT_U16, u16, 0);
2257 }
2258 void add_i32(int32_t i32) {
2259 fbb_.AddElement<int32_t>(TypeAliases::VT_I32, i32, 0);
2260 }
2261 void add_u32(uint32_t u32) {
2262 fbb_.AddElement<uint32_t>(TypeAliases::VT_U32, u32, 0);
2263 }
2264 void add_i64(int64_t i64) {
2265 fbb_.AddElement<int64_t>(TypeAliases::VT_I64, i64, 0);
2266 }
2267 void add_u64(uint64_t u64) {
2268 fbb_.AddElement<uint64_t>(TypeAliases::VT_U64, u64, 0);
2269 }
2270 void add_f32(float f32) {
2271 fbb_.AddElement<float>(TypeAliases::VT_F32, f32, 0.0f);
2272 }
2273 void add_f64(double f64) {
2274 fbb_.AddElement<double>(TypeAliases::VT_F64, f64, 0.0);
2275 }
2276 void add_v8(flatbuffers::Offset<flatbuffers::Vector<int8_t>> v8) {
2277 fbb_.AddOffset(TypeAliases::VT_V8, v8);
2278 }
2279 void add_vf64(flatbuffers::Offset<flatbuffers::Vector<double>> vf64) {
2280 fbb_.AddOffset(TypeAliases::VT_VF64, vf64);
2281 }
2282 explicit TypeAliasesBuilder(flatbuffers::FlatBufferBuilder &_fbb)
2283 : fbb_(_fbb) {
2284 start_ = fbb_.StartTable();
2285 }
2286 TypeAliasesBuilder &operator=(const TypeAliasesBuilder &);
2287 flatbuffers::Offset<TypeAliases> Finish() {
2288 const auto end = fbb_.EndTable(start_);
2289 auto o = flatbuffers::Offset<TypeAliases>(end);
2290 return o;
2291 }
2292 };
2293
2294 inline flatbuffers::Offset<TypeAliases> CreateTypeAliases(
2295 flatbuffers::FlatBufferBuilder &_fbb,
2296 int8_t i8 = 0,
2297 uint8_t u8 = 0,
2298 int16_t i16 = 0,
2299 uint16_t u16 = 0,
2300 int32_t i32 = 0,
2301 uint32_t u32 = 0,
2302 int64_t i64 = 0,
2303 uint64_t u64 = 0,
2304 float f32 = 0.0f,
2305 double f64 = 0.0,
2306 flatbuffers::Offset<flatbuffers::Vector<int8_t>> v8 = 0,
2307 flatbuffers::Offset<flatbuffers::Vector<double>> vf64 = 0) {
2308 TypeAliasesBuilder builder_(_fbb);
2309 builder_.add_f64(f64);
2310 builder_.add_u64(u64);
2311 builder_.add_i64(i64);
2312 builder_.add_vf64(vf64);
2313 builder_.add_v8(v8);
2314 builder_.add_f32(f32);
2315 builder_.add_u32(u32);
2316 builder_.add_i32(i32);
2317 builder_.add_u16(u16);
2318 builder_.add_i16(i16);
2319 builder_.add_u8(u8);
2320 builder_.add_i8(i8);
2321 return builder_.Finish();
2322 }
2323
2324 inline flatbuffers::Offset<TypeAliases> CreateTypeAliasesDirect(
2325 flatbuffers::FlatBufferBuilder &_fbb,
2326 int8_t i8 = 0,
2327 uint8_t u8 = 0,
2328 int16_t i16 = 0,
2329 uint16_t u16 = 0,
2330 int32_t i32 = 0,
2331 uint32_t u32 = 0,
2332 int64_t i64 = 0,
2333 uint64_t u64 = 0,
2334 float f32 = 0.0f,
2335 double f64 = 0.0,
2336 const std::vector<int8_t> *v8 = nullptr,
2337 const std::vector<double> *vf64 = nullptr) {
2338 auto v8__ = v8 ? _fbb.CreateVector<int8_t>(*v8) : 0;
2339 auto vf64__ = vf64 ? _fbb.CreateVector<double>(*vf64) : 0;
2340 return MyGame::Example::CreateTypeAliases(
2341 _fbb,
2342 i8,
2343 u8,
2344 i16,
2345 u16,
2346 i32,
2347 u32,
2348 i64,
2349 u64,
2350 f32,
2351 f64,
2352 v8__,
2353 vf64__);
2354 }
2355
2356 flatbuffers::Offset<TypeAliases> CreateTypeAliases(flatbuffers::FlatBufferBuilder &_fbb, const TypeAliasesT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
2357
2358 } // namespace Example
2359
2360 inline InParentNamespaceT *InParentNamespace::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
2361 auto _o = new InParentNamespaceT();
2362 UnPackTo(_o, _resolver);
2363 return _o;
2364 }
2365
2366 inline void InParentNamespace::UnPackTo(InParentNamespaceT *_o, const flatbuffers::resolver_function_t *_resolver) const {
2367 (void)_o;
2368 (void)_resolver;
2369 }
2370
2371 inline flatbuffers::Offset<InParentNamespace> InParentNamespace::Pack(flatbuffers::FlatBufferBuilder &_fbb, const InParentNamespaceT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
2372 return CreateInParentNamespace(_fbb, _o, _rehasher);
2373 }
2374
2375 inline flatbuffers::Offset<InParentNamespace> CreateInParentNamespace(flatbuffers::FlatBufferBuilder &_fbb, const InParentNamespaceT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
2376 (void)_rehasher;
2377 (void)_o;
2378 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const InParentNamespaceT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
2379 return MyGame::CreateInParentNamespace(
2380 _fbb);
2381 }
2382
2383 namespace Example2 {
2384
2385 inline MonsterT *Monster::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
2386 auto _o = new MonsterT();
2387 UnPackTo(_o, _resolver);
2388 return _o;
2389 }
2390
2391 inline void Monster::UnPackTo(MonsterT *_o, const flatbuffers::resolver_function_t *_resolver) const {
2392 (void)_o;
2393 (void)_resolver;
2394 }
2395
2396 inline flatbuffers::Offset<Monster> Monster::Pack(flatbuffers::FlatBufferBuilder &_fbb, const MonsterT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
2397 return CreateMonster(_fbb, _o, _rehasher);
2398 }
2399
2400 inline flatbuffers::Offset<Monster> CreateMonster(flatbuffers::FlatBufferBuilder &_fbb, const MonsterT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
2401 (void)_rehasher;
2402 (void)_o;
2403 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const MonsterT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
2404 return MyGame::Example2::CreateMonster(
2405 _fbb);
2406 }
2407
2408 } // namespace Example2
2409
2410 namespace Example {
2411
2412 inline TestSimpleTableWithEnumT *TestSimpleTableWithEnum::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
2413 auto _o = new TestSimpleTableWithEnumT();
2414 UnPackTo(_o, _resolver);
2415 return _o;
2416 }
2417
2418 inline void TestSimpleTableWithEnum::UnPackTo(TestSimpleTableWithEnumT *_o, const flatbuffers::resolver_function_t *_resolver) const {
2419 (void)_o;
2420 (void)_resolver;
2421 { auto _e = color(); _o->color = _e; };
2422 }
2423
2424 inline flatbuffers::Offset<TestSimpleTableWithEnum> TestSimpleTableWithEnum::Pack(flatbuffers::FlatBufferBuilder &_fbb, const TestSimpleTableWithEnumT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
2425 return CreateTestSimpleTableWithEnum(_fbb, _o, _rehasher);
2426 }
2427
2428 inline flatbuffers::Offset<TestSimpleTableWithEnum> CreateTestSimpleTableWithEnum(flatbuffers::FlatBufferBuilder &_fbb, const TestSimpleTableWithEnumT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
2429 (void)_rehasher;
2430 (void)_o;
2431 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const TestSimpleTableWithEnumT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
2432 auto _color = _o->color;
2433 return MyGame::Example::CreateTestSimpleTableWithEnum(
2434 _fbb,
2435 _color);
2436 }
2437
2438 inline StatT *Stat::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
2439 auto _o = new StatT();
2440 UnPackTo(_o, _resolver);
2441 return _o;
2442 }
2443
2444 inline void Stat::UnPackTo(StatT *_o, const flatbuffers::resolver_function_t *_resolver) const {
2445 (void)_o;
2446 (void)_resolver;
2447 { auto _e = id(); if (_e) _o->id = _e->str(); };
2448 { auto _e = val(); _o->val = _e; };
2449 { auto _e = count(); _o->count = _e; };
2450 }
2451
2452 inline flatbuffers::Offset<Stat> Stat::Pack(flatbuffers::FlatBufferBuilder &_fbb, const StatT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
2453 return CreateStat(_fbb, _o, _rehasher);
2454 }
2455
2456 inline flatbuffers::Offset<Stat> CreateStat(flatbuffers::FlatBufferBuilder &_fbb, const StatT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
2457 (void)_rehasher;
2458 (void)_o;
2459 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const StatT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
2460 auto _id = _o->id.empty() ? 0 : _fbb.CreateString(_o->id);
2461 auto _val = _o->val;
2462 auto _count = _o->count;
2463 return MyGame::Example::CreateStat(
2464 _fbb,
2465 _id,
2466 _val,
2467 _count);
2468 }
2469
2470 inline ReferrableT *Referrable::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
2471 auto _o = new ReferrableT();
2472 UnPackTo(_o, _resolver);
2473 return _o;
2474 }
2475
2476 inline void Referrable::UnPackTo(ReferrableT *_o, const flatbuffers::resolver_function_t *_resolver) const {
2477 (void)_o;
2478 (void)_resolver;
2479 { auto _e = id(); _o->id = _e; };
2480 }
2481
2482 inline flatbuffers::Offset<Referrable> Referrable::Pack(flatbuffers::FlatBufferBuilder &_fbb, const ReferrableT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
2483 return CreateReferrable(_fbb, _o, _rehasher);
2484 }
2485
2486 inline flatbuffers::Offset<Referrable> CreateReferrable(flatbuffers::FlatBufferBuilder &_fbb, const ReferrableT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
2487 (void)_rehasher;
2488 (void)_o;
2489 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const ReferrableT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
2490 auto _id = _o->id;
2491 return MyGame::Example::CreateReferrable(
2492 _fbb,
2493 _id);
2494 }
2495
2496 inline MonsterT *Monster::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
2497 auto _o = new MonsterT();
2498 UnPackTo(_o, _resolver);
2499 return _o;
2500 }
2501
2502 inline void Monster::UnPackTo(MonsterT *_o, const flatbuffers::resolver_function_t *_resolver) const {
2503 (void)_o;
2504 (void)_resolver;
2505 { auto _e = pos(); if (_e) _o->pos = flatbuffers::unique_ptr<Vec3>(new Vec3(*_e)); };
2506 { auto _e = mana(); _o->mana = _e; };
2507 { auto _e = hp(); _o->hp = _e; };
2508 { auto _e = name(); if (_e) _o->name = _e->str(); };
2509 { auto _e = inventory(); if (_e) { _o->inventory.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->inventory[_i] = _e->Get(_i); } } };
2510 { auto _e = color(); _o->color = _e; };
2511 { auto _e = test_type(); _o->test.type = _e; };
2512 { auto _e = test(); if (_e) _o->test.value = AnyUnion::UnPack(_e, test_type(), _resolver); };
2513 { auto _e = test4(); if (_e) { _o->test4.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->test4[_i] = *_e->Get(_i); } } };
2514 { auto _e = testarrayofstring(); if (_e) { _o->testarrayofstring.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->testarrayofstring[_i] = _e->Get(_i)->str(); } } };
2515 { auto _e = testarrayoftables(); if (_e) { _o->testarrayoftables.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->testarrayoftables[_i] = flatbuffers::unique_ptr<MonsterT>(_e->Get(_i)->UnPack(_resolver)); } } };
2516 { auto _e = enemy(); if (_e) _o->enemy = flatbuffers::unique_ptr<MonsterT>(_e->UnPack(_resolver)); };
2517 { auto _e = testnestedflatbuffer(); if (_e) { _o->testnestedflatbuffer.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->testnestedflatbuffer[_i] = _e->Get(_i); } } };
2518 { auto _e = testempty(); if (_e) _o->testempty = flatbuffers::unique_ptr<StatT>(_e->UnPack(_resolver)); };
2519 { auto _e = testbool(); _o->testbool = _e; };
2520 { auto _e = testhashs32_fnv1(); _o->testhashs32_fnv1 = _e; };
2521 { auto _e = testhashu32_fnv1(); _o->testhashu32_fnv1 = _e; };
2522 { auto _e = testhashs64_fnv1(); _o->testhashs64_fnv1 = _e; };
2523 { auto _e = testhashu64_fnv1(); _o->testhashu64_fnv1 = _e; };
2524 { auto _e = testhashs32_fnv1a(); _o->testhashs32_fnv1a = _e; };
2525 { auto _e = testhashu32_fnv1a(); //scalar resolver, naked
2526 if (_resolver) (*_resolver)(reinterpret_cast<void **>(&_o->testhashu32_fnv1a), static_cast<flatbuffers::hash_value_t>(_e)); else _o->testhashu32_fnv1a = nullptr; };
2527 { auto _e = testhashs64_fnv1a(); _o->testhashs64_fnv1a = _e; };
2528 { auto _e = testhashu64_fnv1a(); _o->testhashu64_fnv1a = _e; };
2529 { auto _e = testarrayofbools(); if (_e) { _o->testarrayofbools.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->testarrayofbools[_i] = _e->Get(_i) != 0; } } };
2530 { auto _e = testf(); _o->testf = _e; };
2531 { auto _e = testf2(); _o->testf2 = _e; };
2532 { auto _e = testf3(); _o->testf3 = _e; };
2533 { auto _e = testarrayofstring2(); if (_e) { _o->testarrayofstring2.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->testarrayofstring2[_i] = _e->Get(_i)->str(); } } };
2534 { auto _e = testarrayofsortedstruct(); if (_e) { _o->testarrayofsortedstruct.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->testarrayofsortedstruct[_i] = *_e->Get(_i); } } };
2535 { auto _e = flex(); if (_e) { _o->flex.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->flex[_i] = _e->Get(_i); } } };
2536 { auto _e = test5(); if (_e) { _o->test5.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->test5[_i] = *_e->Get(_i); } } };
2537 { auto _e = vector_of_longs(); if (_e) { _o->vector_of_longs.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->vector_of_longs[_i] = _e->Get(_i); } } };
2538 { auto _e = vector_of_doubles(); if (_e) { _o->vector_of_doubles.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->vector_of_doubles[_i] = _e->Get(_i); } } };
2539 { auto _e = parent_namespace_test(); if (_e) _o->parent_namespace_test = flatbuffers::unique_ptr<MyGame::InParentNamespaceT>(_e->UnPack(_resolver)); };
2540 { auto _e = vector_of_referrables(); if (_e) { _o->vector_of_referrables.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->vector_of_referrables[_i] = flatbuffers::unique_ptr<ReferrableT>(_e->Get(_i)->UnPack(_resolver)); } } };
2541 { auto _e = single_weak_reference(); //scalar resolver, naked
2542 if (_resolver) (*_resolver)(reinterpret_cast<void **>(&_o->single_weak_reference), static_cast<flatbuffers::hash_value_t>(_e)); else _o->single_weak_reference = nullptr; };
2543 { auto _e = vector_of_weak_references(); if (_e) { _o->vector_of_weak_references.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { //vector resolver, naked
2544 if (_resolver) (*_resolver)(reinterpret_cast<void **>(&_o->vector_of_weak_references[_i]), static_cast<flatbuffers::hash_value_t>(_e->Get(_i))); else _o->vector_of_weak_references[_i] = nullptr; } } };
2545 { auto _e = vector_of_strong_referrables(); if (_e) { _o->vector_of_strong_referrables.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->vector_of_strong_referrables[_i] = flatbuffers::unique_ptr<ReferrableT>(_e->Get(_i)->UnPack(_resolver)); } } };
2546 { auto _e = co_owning_reference(); //scalar resolver, naked
2547 if (_resolver) (*_resolver)(reinterpret_cast<void **>(&_o->co_owning_reference), static_cast<flatbuffers::hash_value_t>(_e)); else _o->co_owning_reference = nullptr; };
2548 { auto _e = vector_of_co_owning_references(); if (_e) { _o->vector_of_co_owning_references.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { //vector resolver, default_ptr_type
2549 if (_resolver) (*_resolver)(reinterpret_cast<void **>(&_o->vector_of_co_owning_references[_i]), static_cast<flatbuffers::hash_value_t>(_e->Get(_i)));/* else do nothing */; } } };
2550 { auto _e = non_owning_reference(); //scalar resolver, naked
2551 if (_resolver) (*_resolver)(reinterpret_cast<void **>(&_o->non_owning_reference), static_cast<flatbuffers::hash_value_t>(_e)); else _o->non_owning_reference = nullptr; };
2552 { auto _e = vector_of_non_owning_references(); if (_e) { _o->vector_of_non_owning_references.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { //vector resolver, naked
2553 if (_resolver) (*_resolver)(reinterpret_cast<void **>(&_o->vector_of_non_owning_references[_i]), static_cast<flatbuffers::hash_value_t>(_e->Get(_i))); else _o->vector_of_non_owning_references[_i] = nullptr; } } };
2554 { auto _e = any_unique_type(); _o->any_unique.type = _e; };
2555 { auto _e = any_unique(); if (_e) _o->any_unique.value = AnyUniqueAliasesUnion::UnPack(_e, any_unique_type(), _resolver); };
2556 { auto _e = any_ambiguous_type(); _o->any_ambiguous.type = _e; };
2557 { auto _e = any_ambiguous(); if (_e) _o->any_ambiguous.value = AnyAmbiguousAliasesUnion::UnPack(_e, any_ambiguous_type(), _resolver); };
2558 { auto _e = vector_of_enums(); if (_e) { _o->vector_of_enums.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->vector_of_enums[_i] = static_cast<Color>(_e->Get(_i)); } } };
2559 }
2560
2561 inline flatbuffers::Offset<Monster> Monster::Pack(flatbuffers::FlatBufferBuilder &_fbb, const MonsterT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
2562 return CreateMonster(_fbb, _o, _rehasher);
2563 }
2564
2565 inline flatbuffers::Offset<Monster> CreateMonster(flatbuffers::FlatBufferBuilder &_fbb, const MonsterT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
2566 (void)_rehasher;
2567 (void)_o;
2568 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const MonsterT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
2569 auto _pos = _o->pos ? _o->pos.get() : 0;
2570 auto _mana = _o->mana;
2571 auto _hp = _o->hp;
2572 auto _name = _fbb.CreateString(_o->name);
2573 auto _inventory = _o->inventory.size() ? _fbb.CreateVector(_o->inventory) : 0;
2574 auto _color = _o->color;
2575 auto _test_type = _o->test.type;
2576 auto _test = _o->test.Pack(_fbb);
2577 auto _test4 = _o->test4.size() ? _fbb.CreateVectorOfStructs(_o->test4) : 0;
2578 auto _testarrayofstring = _o->testarrayofstring.size() ? _fbb.CreateVectorOfStrings(_o->testarrayofstring) : 0;
2579 auto _testarrayoftables = _o->testarrayoftables.size() ? _fbb.CreateVector<flatbuffers::Offset<Monster>> (_o->testarrayoftables.size(), [](size_t i, _VectorArgs *__va) { return CreateMonster(*__va->__fbb, __va->__o->testarrayoftables[i].get(), __va->__rehasher); }, &_va ) : 0;
2580 auto _enemy = _o->enemy ? CreateMonster(_fbb, _o->enemy.get(), _rehasher) : 0;
2581 auto _testnestedflatbuffer = _o->testnestedflatbuffer.size() ? _fbb.CreateVector(_o->testnestedflatbuffer) : 0;
2582 auto _testempty = _o->testempty ? CreateStat(_fbb, _o->testempty.get(), _rehasher) : 0;
2583 auto _testbool = _o->testbool;
2584 auto _testhashs32_fnv1 = _o->testhashs32_fnv1;
2585 auto _testhashu32_fnv1 = _o->testhashu32_fnv1;
2586 auto _testhashs64_fnv1 = _o->testhashs64_fnv1;
2587 auto _testhashu64_fnv1 = _o->testhashu64_fnv1;
2588 auto _testhashs32_fnv1a = _o->testhashs32_fnv1a;
2589 auto _testhashu32_fnv1a = _rehasher ? static_cast<uint32_t>((*_rehasher)(_o->testhashu32_fnv1a)) : 0;
2590 auto _testhashs64_fnv1a = _o->testhashs64_fnv1a;
2591 auto _testhashu64_fnv1a = _o->testhashu64_fnv1a;
2592 auto _testarrayofbools = _o->testarrayofbools.size() ? _fbb.CreateVector(_o->testarrayofbools) : 0;
2593 auto _testf = _o->testf;
2594 auto _testf2 = _o->testf2;
2595 auto _testf3 = _o->testf3;
2596 auto _testarrayofstring2 = _o->testarrayofstring2.size() ? _fbb.CreateVectorOfStrings(_o->testarrayofstring2) : 0;
2597 auto _testarrayofsortedstruct = _o->testarrayofsortedstruct.size() ? _fbb.CreateVectorOfStructs(_o->testarrayofsortedstruct) : 0;
2598 auto _flex = _o->flex.size() ? _fbb.CreateVector(_o->flex) : 0;
2599 auto _test5 = _o->test5.size() ? _fbb.CreateVectorOfStructs(_o->test5) : 0;
2600 auto _vector_of_longs = _o->vector_of_longs.size() ? _fbb.CreateVector(_o->vector_of_longs) : 0;
2601 auto _vector_of_doubles = _o->vector_of_doubles.size() ? _fbb.CreateVector(_o->vector_of_doubles) : 0;
2602 auto _parent_namespace_test = _o->parent_namespace_test ? CreateInParentNamespace(_fbb, _o->parent_namespace_test.get(), _rehasher) : 0;
2603 auto _vector_of_referrables = _o->vector_of_referrables.size() ? _fbb.CreateVector<flatbuffers::Offset<Referrable>> (_o->vector_of_referrables.size(), [](size_t i, _VectorArgs *__va) { return CreateReferrable(*__va->__fbb, __va->__o->vector_of_referrables[i].get(), __va->__rehasher); }, &_va ) : 0;
2604 auto _single_weak_reference = _rehasher ? static_cast<uint64_t>((*_rehasher)(_o->single_weak_reference)) : 0;
2605 auto _vector_of_weak_references = _o->vector_of_weak_references.size() ? _fbb.CreateVector<uint64_t>(_o->vector_of_weak_references.size(), [](size_t i, _VectorArgs *__va) { return __va->__rehasher ? static_cast<uint64_t>((*__va->__rehasher)(__va->__o->vector_of_weak_references[i])) : 0; }, &_va ) : 0;
2606 auto _vector_of_strong_referrables = _o->vector_of_strong_referrables.size() ? _fbb.CreateVector<flatbuffers::Offset<Referrable>> (_o->vector_of_strong_referrables.size(), [](size_t i, _VectorArgs *__va) { return CreateReferrable(*__va->__fbb, __va->__o->vector_of_strong_referrables[i].get(), __va->__rehasher); }, &_va ) : 0;
2607 auto _co_owning_reference = _rehasher ? static_cast<uint64_t>((*_rehasher)(_o->co_owning_reference)) : 0;
2608 auto _vector_of_co_owning_references = _o->vector_of_co_owning_references.size() ? _fbb.CreateVector<uint64_t>(_o->vector_of_co_owning_references.size(), [](size_t i, _VectorArgs *__va) { return __va->__rehasher ? static_cast<uint64_t>((*__va->__rehasher)(__va->__o->vector_of_co_owning_references[i].get())) : 0; }, &_va ) : 0;
2609 auto _non_owning_reference = _rehasher ? static_cast<uint64_t>((*_rehasher)(_o->non_owning_reference)) : 0;
2610 auto _vector_of_non_owning_references = _o->vector_of_non_owning_references.size() ? _fbb.CreateVector<uint64_t>(_o->vector_of_non_owning_references.size(), [](size_t i, _VectorArgs *__va) { return __va->__rehasher ? static_cast<uint64_t>((*__va->__rehasher)(__va->__o->vector_of_non_owning_references[i])) : 0; }, &_va ) : 0;
2611 auto _any_unique_type = _o->any_unique.type;
2612 auto _any_unique = _o->any_unique.Pack(_fbb);
2613 auto _any_ambiguous_type = _o->any_ambiguous.type;
2614 auto _any_ambiguous = _o->any_ambiguous.Pack(_fbb);
2615 auto _vector_of_enums = _o->vector_of_enums.size() ? _fbb.CreateVectorScalarCast<int8_t>(flatbuffers::data(_o->vector_of_enums), _o->vector_of_enums.size()) : 0;
2616 return MyGame::Example::CreateMonster(
2617 _fbb,
2618 _pos,
2619 _mana,
2620 _hp,
2621 _name,
2622 _inventory,
2623 _color,
2624 _test_type,
2625 _test,
2626 _test4,
2627 _testarrayofstring,
2628 _testarrayoftables,
2629 _enemy,
2630 _testnestedflatbuffer,
2631 _testempty,
2632 _testbool,
2633 _testhashs32_fnv1,
2634 _testhashu32_fnv1,
2635 _testhashs64_fnv1,
2636 _testhashu64_fnv1,
2637 _testhashs32_fnv1a,
2638 _testhashu32_fnv1a,
2639 _testhashs64_fnv1a,
2640 _testhashu64_fnv1a,
2641 _testarrayofbools,
2642 _testf,
2643 _testf2,
2644 _testf3,
2645 _testarrayofstring2,
2646 _testarrayofsortedstruct,
2647 _flex,
2648 _test5,
2649 _vector_of_longs,
2650 _vector_of_doubles,
2651 _parent_namespace_test,
2652 _vector_of_referrables,
2653 _single_weak_reference,
2654 _vector_of_weak_references,
2655 _vector_of_strong_referrables,
2656 _co_owning_reference,
2657 _vector_of_co_owning_references,
2658 _non_owning_reference,
2659 _vector_of_non_owning_references,
2660 _any_unique_type,
2661 _any_unique,
2662 _any_ambiguous_type,
2663 _any_ambiguous,
2664 _vector_of_enums);
2665 }
2666
2667 inline TypeAliasesT *TypeAliases::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
2668 auto _o = new TypeAliasesT();
2669 UnPackTo(_o, _resolver);
2670 return _o;
2671 }
2672
2673 inline void TypeAliases::UnPackTo(TypeAliasesT *_o, const flatbuffers::resolver_function_t *_resolver) const {
2674 (void)_o;
2675 (void)_resolver;
2676 { auto _e = i8(); _o->i8 = _e; };
2677 { auto _e = u8(); _o->u8 = _e; };
2678 { auto _e = i16(); _o->i16 = _e; };
2679 { auto _e = u16(); _o->u16 = _e; };
2680 { auto _e = i32(); _o->i32 = _e; };
2681 { auto _e = u32(); _o->u32 = _e; };
2682 { auto _e = i64(); _o->i64 = _e; };
2683 { auto _e = u64(); _o->u64 = _e; };
2684 { auto _e = f32(); _o->f32 = _e; };
2685 { auto _e = f64(); _o->f64 = _e; };
2686 { auto _e = v8(); if (_e) { _o->v8.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->v8[_i] = _e->Get(_i); } } };
2687 { auto _e = vf64(); if (_e) { _o->vf64.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->vf64[_i] = _e->Get(_i); } } };
2688 }
2689
2690 inline flatbuffers::Offset<TypeAliases> TypeAliases::Pack(flatbuffers::FlatBufferBuilder &_fbb, const TypeAliasesT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
2691 return CreateTypeAliases(_fbb, _o, _rehasher);
2692 }
2693
2694 inline flatbuffers::Offset<TypeAliases> CreateTypeAliases(flatbuffers::FlatBufferBuilder &_fbb, const TypeAliasesT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
2695 (void)_rehasher;
2696 (void)_o;
2697 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const TypeAliasesT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
2698 auto _i8 = _o->i8;
2699 auto _u8 = _o->u8;
2700 auto _i16 = _o->i16;
2701 auto _u16 = _o->u16;
2702 auto _i32 = _o->i32;
2703 auto _u32 = _o->u32;
2704 auto _i64 = _o->i64;
2705 auto _u64 = _o->u64;
2706 auto _f32 = _o->f32;
2707 auto _f64 = _o->f64;
2708 auto _v8 = _o->v8.size() ? _fbb.CreateVector(_o->v8) : 0;
2709 auto _vf64 = _o->vf64.size() ? _fbb.CreateVector(_o->vf64) : 0;
2710 return MyGame::Example::CreateTypeAliases(
2711 _fbb,
2712 _i8,
2713 _u8,
2714 _i16,
2715 _u16,
2716 _i32,
2717 _u32,
2718 _i64,
2719 _u64,
2720 _f32,
2721 _f64,
2722 _v8,
2723 _vf64);
2724 }
2725
2726 inline bool VerifyAny(flatbuffers::Verifier &verifier, const void *obj, Any type) {
2727 switch (type) {
2728 case Any_NONE: {
2729 return true;
2730 }
2731 case Any_Monster: {
2732 auto ptr = reinterpret_cast<const Monster *>(obj);
2733 return verifier.VerifyTable(ptr);
2734 }
2735 case Any_TestSimpleTableWithEnum: {
2736 auto ptr = reinterpret_cast<const TestSimpleTableWithEnum *>(obj);
2737 return verifier.VerifyTable(ptr);
2738 }
2739 case Any_MyGame_Example2_Monster: {
2740 auto ptr = reinterpret_cast<const MyGame::Example2::Monster *>(obj);
2741 return verifier.VerifyTable(ptr);
2742 }
2743 default: return false;
2744 }
2745 }
2746
2747 inline bool VerifyAnyVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector<flatbuffers::Offset<void>> *values, const flatbuffers::Vector<uint8_t> *types) {
2748 if (!values || !types) return !values && !types;
2749 if (values->size() != types->size()) return false;
2750 for (flatbuffers::uoffset_t i = 0; i < values->size(); ++i) {
2751 if (!VerifyAny(
2752 verifier, values->Get(i), types->GetEnum<Any>(i))) {
2753 return false;
2754 }
2755 }
2756 return true;
2757 }
2758
2759 inline void *AnyUnion::UnPack(const void *obj, Any type, const flatbuffers::resolver_function_t *resolver) {
2760 switch (type) {
2761 case Any_Monster: {
2762 auto ptr = reinterpret_cast<const Monster *>(obj);
2763 return ptr->UnPack(resolver);
2764 }
2765 case Any_TestSimpleTableWithEnum: {
2766 auto ptr = reinterpret_cast<const TestSimpleTableWithEnum *>(obj);
2767 return ptr->UnPack(resolver);
2768 }
2769 case Any_MyGame_Example2_Monster: {
2770 auto ptr = reinterpret_cast<const MyGame::Example2::Monster *>(obj);
2771 return ptr->UnPack(resolver);
2772 }
2773 default: return nullptr;
2774 }
2775 }
2776
2777 inline flatbuffers::Offset<void> AnyUnion::Pack(flatbuffers::FlatBufferBuilder &_fbb, const flatbuffers::rehasher_function_t *_rehasher) const {
2778 switch (type) {
2779 case Any_Monster: {
2780 auto ptr = reinterpret_cast<const MonsterT *>(value);
2781 return CreateMonster(_fbb, ptr, _rehasher).Union();
2782 }
2783 case Any_TestSimpleTableWithEnum: {
2784 auto ptr = reinterpret_cast<const TestSimpleTableWithEnumT *>(value);
2785 return CreateTestSimpleTableWithEnum(_fbb, ptr, _rehasher).Union();
2786 }
2787 case Any_MyGame_Example2_Monster: {
2788 auto ptr = reinterpret_cast<const MyGame::Example2::MonsterT *>(value);
2789 return CreateMonster(_fbb, ptr, _rehasher).Union();
2790 }
2791 default: return 0;
2792 }
2793 }
2794
2795 inline AnyUnion::AnyUnion(const AnyUnion &u) FLATBUFFERS_NOEXCEPT : type(u.type), value(nullptr) {
2796 switch (type) {
2797 case Any_Monster: {
2798 FLATBUFFERS_ASSERT(false); // MonsterT not copyable.
2799 break;
2800 }
2801 case Any_TestSimpleTableWithEnum: {
2802 value = new TestSimpleTableWithEnumT(*reinterpret_cast<TestSimpleTableWithEnumT *>(u.value));
2803 break;
2804 }
2805 case Any_MyGame_Example2_Monster: {
2806 value = new MyGame::Example2::MonsterT(*reinterpret_cast<MyGame::Example2::MonsterT *>(u.value));
2807 break;
2808 }
2809 default:
2810 break;
2811 }
2812 }
2813
2814 inline void AnyUnion::Reset() {
2815 switch (type) {
2816 case Any_Monster: {
2817 auto ptr = reinterpret_cast<MonsterT *>(value);
2818 delete ptr;
2819 break;
2820 }
2821 case Any_TestSimpleTableWithEnum: {
2822 auto ptr = reinterpret_cast<TestSimpleTableWithEnumT *>(value);
2823 delete ptr;
2824 break;
2825 }
2826 case Any_MyGame_Example2_Monster: {
2827 auto ptr = reinterpret_cast<MyGame::Example2::MonsterT *>(value);
2828 delete ptr;
2829 break;
2830 }
2831 default: break;
2832 }
2833 value = nullptr;
2834 type = Any_NONE;
2835 }
2836
2837 inline bool VerifyAnyUniqueAliases(flatbuffers::Verifier &verifier, const void *obj, AnyUniqueAliases type) {
2838 switch (type) {
2839 case AnyUniqueAliases_NONE: {
2840 return true;
2841 }
2842 case AnyUniqueAliases_M: {
2843 auto ptr = reinterpret_cast<const Monster *>(obj);
2844 return verifier.VerifyTable(ptr);
2845 }
2846 case AnyUniqueAliases_T: {
2847 auto ptr = reinterpret_cast<const TestSimpleTableWithEnum *>(obj);
2848 return verifier.VerifyTable(ptr);
2849 }
2850 case AnyUniqueAliases_M2: {
2851 auto ptr = reinterpret_cast<const MyGame::Example2::Monster *>(obj);
2852 return verifier.VerifyTable(ptr);
2853 }
2854 default: return false;
2855 }
2856 }
2857
2858 inline bool VerifyAnyUniqueAliasesVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector<flatbuffers::Offset<void>> *values, const flatbuffers::Vector<uint8_t> *types) {
2859 if (!values || !types) return !values && !types;
2860 if (values->size() != types->size()) return false;
2861 for (flatbuffers::uoffset_t i = 0; i < values->size(); ++i) {
2862 if (!VerifyAnyUniqueAliases(
2863 verifier, values->Get(i), types->GetEnum<AnyUniqueAliases>(i))) {
2864 return false;
2865 }
2866 }
2867 return true;
2868 }
2869
2870 inline void *AnyUniqueAliasesUnion::UnPack(const void *obj, AnyUniqueAliases type, const flatbuffers::resolver_function_t *resolver) {
2871 switch (type) {
2872 case AnyUniqueAliases_M: {
2873 auto ptr = reinterpret_cast<const Monster *>(obj);
2874 return ptr->UnPack(resolver);
2875 }
2876 case AnyUniqueAliases_T: {
2877 auto ptr = reinterpret_cast<const TestSimpleTableWithEnum *>(obj);
2878 return ptr->UnPack(resolver);
2879 }
2880 case AnyUniqueAliases_M2: {
2881 auto ptr = reinterpret_cast<const MyGame::Example2::Monster *>(obj);
2882 return ptr->UnPack(resolver);
2883 }
2884 default: return nullptr;
2885 }
2886 }
2887
2888 inline flatbuffers::Offset<void> AnyUniqueAliasesUnion::Pack(flatbuffers::FlatBufferBuilder &_fbb, const flatbuffers::rehasher_function_t *_rehasher) const {
2889 switch (type) {
2890 case AnyUniqueAliases_M: {
2891 auto ptr = reinterpret_cast<const MonsterT *>(value);
2892 return CreateMonster(_fbb, ptr, _rehasher).Union();
2893 }
2894 case AnyUniqueAliases_T: {
2895 auto ptr = reinterpret_cast<const TestSimpleTableWithEnumT *>(value);
2896 return CreateTestSimpleTableWithEnum(_fbb, ptr, _rehasher).Union();
2897 }
2898 case AnyUniqueAliases_M2: {
2899 auto ptr = reinterpret_cast<const MyGame::Example2::MonsterT *>(value);
2900 return CreateMonster(_fbb, ptr, _rehasher).Union();
2901 }
2902 default: return 0;
2903 }
2904 }
2905
2906 inline AnyUniqueAliasesUnion::AnyUniqueAliasesUnion(const AnyUniqueAliasesUnion &u) FLATBUFFERS_NOEXCEPT : type(u.type), value(nullptr) {
2907 switch (type) {
2908 case AnyUniqueAliases_M: {
2909 FLATBUFFERS_ASSERT(false); // MonsterT not copyable.
2910 break;
2911 }
2912 case AnyUniqueAliases_T: {
2913 value = new TestSimpleTableWithEnumT(*reinterpret_cast<TestSimpleTableWithEnumT *>(u.value));
2914 break;
2915 }
2916 case AnyUniqueAliases_M2: {
2917 value = new MyGame::Example2::MonsterT(*reinterpret_cast<MyGame::Example2::MonsterT *>(u.value));
2918 break;
2919 }
2920 default:
2921 break;
2922 }
2923 }
2924
2925 inline void AnyUniqueAliasesUnion::Reset() {
2926 switch (type) {
2927 case AnyUniqueAliases_M: {
2928 auto ptr = reinterpret_cast<MonsterT *>(value);
2929 delete ptr;
2930 break;
2931 }
2932 case AnyUniqueAliases_T: {
2933 auto ptr = reinterpret_cast<TestSimpleTableWithEnumT *>(value);
2934 delete ptr;
2935 break;
2936 }
2937 case AnyUniqueAliases_M2: {
2938 auto ptr = reinterpret_cast<MyGame::Example2::MonsterT *>(value);
2939 delete ptr;
2940 break;
2941 }
2942 default: break;
2943 }
2944 value = nullptr;
2945 type = AnyUniqueAliases_NONE;
2946 }
2947
2948 inline bool VerifyAnyAmbiguousAliases(flatbuffers::Verifier &verifier, const void *obj, AnyAmbiguousAliases type) {
2949 switch (type) {
2950 case AnyAmbiguousAliases_NONE: {
2951 return true;
2952 }
2953 case AnyAmbiguousAliases_M1: {
2954 auto ptr = reinterpret_cast<const Monster *>(obj);
2955 return verifier.VerifyTable(ptr);
2956 }
2957 case AnyAmbiguousAliases_M2: {
2958 auto ptr = reinterpret_cast<const Monster *>(obj);
2959 return verifier.VerifyTable(ptr);
2960 }
2961 case AnyAmbiguousAliases_M3: {
2962 auto ptr = reinterpret_cast<const Monster *>(obj);
2963 return verifier.VerifyTable(ptr);
2964 }
2965 default: return false;
2966 }
2967 }
2968
2969 inline bool VerifyAnyAmbiguousAliasesVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector<flatbuffers::Offset<void>> *values, const flatbuffers::Vector<uint8_t> *types) {
2970 if (!values || !types) return !values && !types;
2971 if (values->size() != types->size()) return false;
2972 for (flatbuffers::uoffset_t i = 0; i < values->size(); ++i) {
2973 if (!VerifyAnyAmbiguousAliases(
2974 verifier, values->Get(i), types->GetEnum<AnyAmbiguousAliases>(i))) {
2975 return false;
2976 }
2977 }
2978 return true;
2979 }
2980
2981 inline void *AnyAmbiguousAliasesUnion::UnPack(const void *obj, AnyAmbiguousAliases type, const flatbuffers::resolver_function_t *resolver) {
2982 switch (type) {
2983 case AnyAmbiguousAliases_M1: {
2984 auto ptr = reinterpret_cast<const Monster *>(obj);
2985 return ptr->UnPack(resolver);
2986 }
2987 case AnyAmbiguousAliases_M2: {
2988 auto ptr = reinterpret_cast<const Monster *>(obj);
2989 return ptr->UnPack(resolver);
2990 }
2991 case AnyAmbiguousAliases_M3: {
2992 auto ptr = reinterpret_cast<const Monster *>(obj);
2993 return ptr->UnPack(resolver);
2994 }
2995 default: return nullptr;
2996 }
2997 }
2998
2999 inline flatbuffers::Offset<void> AnyAmbiguousAliasesUnion::Pack(flatbuffers::FlatBufferBuilder &_fbb, const flatbuffers::rehasher_function_t *_rehasher) const {
3000 switch (type) {
3001 case AnyAmbiguousAliases_M1: {
3002 auto ptr = reinterpret_cast<const MonsterT *>(value);
3003 return CreateMonster(_fbb, ptr, _rehasher).Union();
3004 }
3005 case AnyAmbiguousAliases_M2: {
3006 auto ptr = reinterpret_cast<const MonsterT *>(value);
3007 return CreateMonster(_fbb, ptr, _rehasher).Union();
3008 }
3009 case AnyAmbiguousAliases_M3: {
3010 auto ptr = reinterpret_cast<const MonsterT *>(value);
3011 return CreateMonster(_fbb, ptr, _rehasher).Union();
3012 }
3013 default: return 0;
3014 }
3015 }
3016
3017 inline AnyAmbiguousAliasesUnion::AnyAmbiguousAliasesUnion(const AnyAmbiguousAliasesUnion &u) FLATBUFFERS_NOEXCEPT : type(u.type), value(nullptr) {
3018 switch (type) {
3019 case AnyAmbiguousAliases_M1: {
3020 FLATBUFFERS_ASSERT(false); // MonsterT not copyable.
3021 break;
3022 }
3023 case AnyAmbiguousAliases_M2: {
3024 FLATBUFFERS_ASSERT(false); // MonsterT not copyable.
3025 break;
3026 }
3027 case AnyAmbiguousAliases_M3: {
3028 FLATBUFFERS_ASSERT(false); // MonsterT not copyable.
3029 break;
3030 }
3031 default:
3032 break;
3033 }
3034 }
3035
3036 inline void AnyAmbiguousAliasesUnion::Reset() {
3037 switch (type) {
3038 case AnyAmbiguousAliases_M1: {
3039 auto ptr = reinterpret_cast<MonsterT *>(value);
3040 delete ptr;
3041 break;
3042 }
3043 case AnyAmbiguousAliases_M2: {
3044 auto ptr = reinterpret_cast<MonsterT *>(value);
3045 delete ptr;
3046 break;
3047 }
3048 case AnyAmbiguousAliases_M3: {
3049 auto ptr = reinterpret_cast<MonsterT *>(value);
3050 delete ptr;
3051 break;
3052 }
3053 default: break;
3054 }
3055 value = nullptr;
3056 type = AnyAmbiguousAliases_NONE;
3057 }
3058
3059 inline const flatbuffers::TypeTable *ColorTypeTable() {
3060 static const flatbuffers::TypeCode type_codes[] = {
3061 { flatbuffers::ET_CHAR, 0, 0 },
3062 { flatbuffers::ET_CHAR, 0, 0 },
3063 { flatbuffers::ET_CHAR, 0, 0 }
3064 };
3065 static const flatbuffers::TypeFunction type_refs[] = {
3066 ColorTypeTable
3067 };
3068 static const int64_t values[] = { 1, 2, 8 };
3069 static const char * const names[] = {
3070 "Red",
3071 "Green",
3072 "Blue"
3073 };
3074 static const flatbuffers::TypeTable tt = {
3075 flatbuffers::ST_ENUM, 3, type_codes, type_refs, values, names
3076 };
3077 return &tt;
3078 }
3079
3080 inline const flatbuffers::TypeTable *AnyTypeTable() {
3081 static const flatbuffers::TypeCode type_codes[] = {
3082 { flatbuffers::ET_SEQUENCE, 0, -1 },
3083 { flatbuffers::ET_SEQUENCE, 0, 0 },
3084 { flatbuffers::ET_SEQUENCE, 0, 1 },
3085 { flatbuffers::ET_SEQUENCE, 0, 2 }
3086 };
3087 static const flatbuffers::TypeFunction type_refs[] = {
3088 MonsterTypeTable,
3089 TestSimpleTableWithEnumTypeTable,
3090 MyGame::Example2::MonsterTypeTable
3091 };
3092 static const char * const names[] = {
3093 "NONE",
3094 "Monster",
3095 "TestSimpleTableWithEnum",
3096 "MyGame_Example2_Monster"
3097 };
3098 static const flatbuffers::TypeTable tt = {
3099 flatbuffers::ST_UNION, 4, type_codes, type_refs, nullptr, names
3100 };
3101 return &tt;
3102 }
3103
3104 inline const flatbuffers::TypeTable *AnyUniqueAliasesTypeTable() {
3105 static const flatbuffers::TypeCode type_codes[] = {
3106 { flatbuffers::ET_SEQUENCE, 0, -1 },
3107 { flatbuffers::ET_SEQUENCE, 0, 0 },
3108 { flatbuffers::ET_SEQUENCE, 0, 1 },
3109 { flatbuffers::ET_SEQUENCE, 0, 2 }
3110 };
3111 static const flatbuffers::TypeFunction type_refs[] = {
3112 MonsterTypeTable,
3113 TestSimpleTableWithEnumTypeTable,
3114 MyGame::Example2::MonsterTypeTable
3115 };
3116 static const char * const names[] = {
3117 "NONE",
3118 "M",
3119 "T",
3120 "M2"
3121 };
3122 static const flatbuffers::TypeTable tt = {
3123 flatbuffers::ST_UNION, 4, type_codes, type_refs, nullptr, names
3124 };
3125 return &tt;
3126 }
3127
3128 inline const flatbuffers::TypeTable *AnyAmbiguousAliasesTypeTable() {
3129 static const flatbuffers::TypeCode type_codes[] = {
3130 { flatbuffers::ET_SEQUENCE, 0, -1 },
3131 { flatbuffers::ET_SEQUENCE, 0, 0 },
3132 { flatbuffers::ET_SEQUENCE, 0, 0 },
3133 { flatbuffers::ET_SEQUENCE, 0, 0 }
3134 };
3135 static const flatbuffers::TypeFunction type_refs[] = {
3136 MonsterTypeTable
3137 };
3138 static const char * const names[] = {
3139 "NONE",
3140 "M1",
3141 "M2",
3142 "M3"
3143 };
3144 static const flatbuffers::TypeTable tt = {
3145 flatbuffers::ST_UNION, 4, type_codes, type_refs, nullptr, names
3146 };
3147 return &tt;
3148 }
3149
3150 } // namespace Example
3151
3152 inline const flatbuffers::TypeTable *InParentNamespaceTypeTable() {
3153 static const flatbuffers::TypeTable tt = {
3154 flatbuffers::ST_TABLE, 0, nullptr, nullptr, nullptr, nullptr
3155 };
3156 return &tt;
3157 }
3158
3159 namespace Example2 {
3160
3161 inline const flatbuffers::TypeTable *MonsterTypeTable() {
3162 static const flatbuffers::TypeTable tt = {
3163 flatbuffers::ST_TABLE, 0, nullptr, nullptr, nullptr, nullptr
3164 };
3165 return &tt;
3166 }
3167
3168 } // namespace Example2
3169
3170 namespace Example {
3171
3172 inline const flatbuffers::TypeTable *TestTypeTable() {
3173 static const flatbuffers::TypeCode type_codes[] = {
3174 { flatbuffers::ET_SHORT, 0, -1 },
3175 { flatbuffers::ET_CHAR, 0, -1 }
3176 };
3177 static const int64_t values[] = { 0, 2, 4 };
3178 static const char * const names[] = {
3179 "a",
3180 "b"
3181 };
3182 static const flatbuffers::TypeTable tt = {
3183 flatbuffers::ST_STRUCT, 2, type_codes, nullptr, values, names
3184 };
3185 return &tt;
3186 }
3187
3188 inline const flatbuffers::TypeTable *TestSimpleTableWithEnumTypeTable() {
3189 static const flatbuffers::TypeCode type_codes[] = {
3190 { flatbuffers::ET_CHAR, 0, 0 }
3191 };
3192 static const flatbuffers::TypeFunction type_refs[] = {
3193 ColorTypeTable
3194 };
3195 static const char * const names[] = {
3196 "color"
3197 };
3198 static const flatbuffers::TypeTable tt = {
3199 flatbuffers::ST_TABLE, 1, type_codes, type_refs, nullptr, names
3200 };
3201 return &tt;
3202 }
3203
3204 inline const flatbuffers::TypeTable *Vec3TypeTable() {
3205 static const flatbuffers::TypeCode type_codes[] = {
3206 { flatbuffers::ET_FLOAT, 0, -1 },
3207 { flatbuffers::ET_FLOAT, 0, -1 },
3208 { flatbuffers::ET_FLOAT, 0, -1 },
3209 { flatbuffers::ET_DOUBLE, 0, -1 },
3210 { flatbuffers::ET_CHAR, 0, 0 },
3211 { flatbuffers::ET_SEQUENCE, 0, 1 }
3212 };
3213 static const flatbuffers::TypeFunction type_refs[] = {
3214 ColorTypeTable,
3215 TestTypeTable
3216 };
3217 static const int64_t values[] = { 0, 4, 8, 16, 24, 26, 32 };
3218 static const char * const names[] = {
3219 "x",
3220 "y",
3221 "z",
3222 "test1",
3223 "test2",
3224 "test3"
3225 };
3226 static const flatbuffers::TypeTable tt = {
3227 flatbuffers::ST_STRUCT, 6, type_codes, type_refs, values, names
3228 };
3229 return &tt;
3230 }
3231
3232 inline const flatbuffers::TypeTable *AbilityTypeTable() {
3233 static const flatbuffers::TypeCode type_codes[] = {
3234 { flatbuffers::ET_UINT, 0, -1 },
3235 { flatbuffers::ET_UINT, 0, -1 }
3236 };
3237 static const int64_t values[] = { 0, 4, 8 };
3238 static const char * const names[] = {
3239 "id",
3240 "distance"
3241 };
3242 static const flatbuffers::TypeTable tt = {
3243 flatbuffers::ST_STRUCT, 2, type_codes, nullptr, values, names
3244 };
3245 return &tt;
3246 }
3247
3248 inline const flatbuffers::TypeTable *StatTypeTable() {
3249 static const flatbuffers::TypeCode type_codes[] = {
3250 { flatbuffers::ET_STRING, 0, -1 },
3251 { flatbuffers::ET_LONG, 0, -1 },
3252 { flatbuffers::ET_USHORT, 0, -1 }
3253 };
3254 static const char * const names[] = {
3255 "id",
3256 "val",
3257 "count"
3258 };
3259 static const flatbuffers::TypeTable tt = {
3260 flatbuffers::ST_TABLE, 3, type_codes, nullptr, nullptr, names
3261 };
3262 return &tt;
3263 }
3264
3265 inline const flatbuffers::TypeTable *ReferrableTypeTable() {
3266 static const flatbuffers::TypeCode type_codes[] = {
3267 { flatbuffers::ET_ULONG, 0, -1 }
3268 };
3269 static const char * const names[] = {
3270 "id"
3271 };
3272 static const flatbuffers::TypeTable tt = {
3273 flatbuffers::ST_TABLE, 1, type_codes, nullptr, nullptr, names
3274 };
3275 return &tt;
3276 }
3277
3278 inline const flatbuffers::TypeTable *MonsterTypeTable() {
3279 static const flatbuffers::TypeCode type_codes[] = {
3280 { flatbuffers::ET_SEQUENCE, 0, 0 },
3281 { flatbuffers::ET_SHORT, 0, -1 },
3282 { flatbuffers::ET_SHORT, 0, -1 },
3283 { flatbuffers::ET_STRING, 0, -1 },
3284 { flatbuffers::ET_BOOL, 0, -1 },
3285 { flatbuffers::ET_UCHAR, 1, -1 },
3286 { flatbuffers::ET_CHAR, 0, 1 },
3287 { flatbuffers::ET_UTYPE, 0, 2 },
3288 { flatbuffers::ET_SEQUENCE, 0, 2 },
3289 { flatbuffers::ET_SEQUENCE, 1, 3 },
3290 { flatbuffers::ET_STRING, 1, -1 },
3291 { flatbuffers::ET_SEQUENCE, 1, 4 },
3292 { flatbuffers::ET_SEQUENCE, 0, 4 },
3293 { flatbuffers::ET_UCHAR, 1, -1 },
3294 { flatbuffers::ET_SEQUENCE, 0, 5 },
3295 { flatbuffers::ET_BOOL, 0, -1 },
3296 { flatbuffers::ET_INT, 0, -1 },
3297 { flatbuffers::ET_UINT, 0, -1 },
3298 { flatbuffers::ET_LONG, 0, -1 },
3299 { flatbuffers::ET_ULONG, 0, -1 },
3300 { flatbuffers::ET_INT, 0, -1 },
3301 { flatbuffers::ET_UINT, 0, -1 },
3302 { flatbuffers::ET_LONG, 0, -1 },
3303 { flatbuffers::ET_ULONG, 0, -1 },
3304 { flatbuffers::ET_BOOL, 1, -1 },
3305 { flatbuffers::ET_FLOAT, 0, -1 },
3306 { flatbuffers::ET_FLOAT, 0, -1 },
3307 { flatbuffers::ET_FLOAT, 0, -1 },
3308 { flatbuffers::ET_STRING, 1, -1 },
3309 { flatbuffers::ET_SEQUENCE, 1, 6 },
3310 { flatbuffers::ET_UCHAR, 1, -1 },
3311 { flatbuffers::ET_SEQUENCE, 1, 3 },
3312 { flatbuffers::ET_LONG, 1, -1 },
3313 { flatbuffers::ET_DOUBLE, 1, -1 },
3314 { flatbuffers::ET_SEQUENCE, 0, 7 },
3315 { flatbuffers::ET_SEQUENCE, 1, 8 },
3316 { flatbuffers::ET_ULONG, 0, -1 },
3317 { flatbuffers::ET_ULONG, 1, -1 },
3318 { flatbuffers::ET_SEQUENCE, 1, 8 },
3319 { flatbuffers::ET_ULONG, 0, -1 },
3320 { flatbuffers::ET_ULONG, 1, -1 },
3321 { flatbuffers::ET_ULONG, 0, -1 },
3322 { flatbuffers::ET_ULONG, 1, -1 },
3323 { flatbuffers::ET_UTYPE, 0, 9 },
3324 { flatbuffers::ET_SEQUENCE, 0, 9 },
3325 { flatbuffers::ET_UTYPE, 0, 10 },
3326 { flatbuffers::ET_SEQUENCE, 0, 10 },
3327 { flatbuffers::ET_CHAR, 1, 1 }
3328 };
3329 static const flatbuffers::TypeFunction type_refs[] = {
3330 Vec3TypeTable,
3331 ColorTypeTable,
3332 AnyTypeTable,
3333 TestTypeTable,
3334 MonsterTypeTable,
3335 StatTypeTable,
3336 AbilityTypeTable,
3337 MyGame::InParentNamespaceTypeTable,
3338 ReferrableTypeTable,
3339 AnyUniqueAliasesTypeTable,
3340 AnyAmbiguousAliasesTypeTable
3341 };
3342 static const char * const names[] = {
3343 "pos",
3344 "mana",
3345 "hp",
3346 "name",
3347 "friendly",
3348 "inventory",
3349 "color",
3350 "test_type",
3351 "test",
3352 "test4",
3353 "testarrayofstring",
3354 "testarrayoftables",
3355 "enemy",
3356 "testnestedflatbuffer",
3357 "testempty",
3358 "testbool",
3359 "testhashs32_fnv1",
3360 "testhashu32_fnv1",
3361 "testhashs64_fnv1",
3362 "testhashu64_fnv1",
3363 "testhashs32_fnv1a",
3364 "testhashu32_fnv1a",
3365 "testhashs64_fnv1a",
3366 "testhashu64_fnv1a",
3367 "testarrayofbools",
3368 "testf",
3369 "testf2",
3370 "testf3",
3371 "testarrayofstring2",
3372 "testarrayofsortedstruct",
3373 "flex",
3374 "test5",
3375 "vector_of_longs",
3376 "vector_of_doubles",
3377 "parent_namespace_test",
3378 "vector_of_referrables",
3379 "single_weak_reference",
3380 "vector_of_weak_references",
3381 "vector_of_strong_referrables",
3382 "co_owning_reference",
3383 "vector_of_co_owning_references",
3384 "non_owning_reference",
3385 "vector_of_non_owning_references",
3386 "any_unique_type",
3387 "any_unique",
3388 "any_ambiguous_type",
3389 "any_ambiguous",
3390 "vector_of_enums"
3391 };
3392 static const flatbuffers::TypeTable tt = {
3393 flatbuffers::ST_TABLE, 48, type_codes, type_refs, nullptr, names
3394 };
3395 return &tt;
3396 }
3397
3398 inline const flatbuffers::TypeTable *TypeAliasesTypeTable() {
3399 static const flatbuffers::TypeCode type_codes[] = {
3400 { flatbuffers::ET_CHAR, 0, -1 },
3401 { flatbuffers::ET_UCHAR, 0, -1 },
3402 { flatbuffers::ET_SHORT, 0, -1 },
3403 { flatbuffers::ET_USHORT, 0, -1 },
3404 { flatbuffers::ET_INT, 0, -1 },
3405 { flatbuffers::ET_UINT, 0, -1 },
3406 { flatbuffers::ET_LONG, 0, -1 },
3407 { flatbuffers::ET_ULONG, 0, -1 },
3408 { flatbuffers::ET_FLOAT, 0, -1 },
3409 { flatbuffers::ET_DOUBLE, 0, -1 },
3410 { flatbuffers::ET_CHAR, 1, -1 },
3411 { flatbuffers::ET_DOUBLE, 1, -1 }
3412 };
3413 static const char * const names[] = {
3414 "i8",
3415 "u8",
3416 "i16",
3417 "u16",
3418 "i32",
3419 "u32",
3420 "i64",
3421 "u64",
3422 "f32",
3423 "f64",
3424 "v8",
3425 "vf64"
3426 };
3427 static const flatbuffers::TypeTable tt = {
3428 flatbuffers::ST_TABLE, 12, type_codes, nullptr, nullptr, names
3429 };
3430 return &tt;
3431 }
3432
3433 inline const MyGame::Example::Monster *GetMonster(const void *buf) {
3434 return flatbuffers::GetRoot<MyGame::Example::Monster>(buf);
3435 }
3436
3437 inline const MyGame::Example::Monster *GetSizePrefixedMonster(const void *buf) {
3438 return flatbuffers::GetSizePrefixedRoot<MyGame::Example::Monster>(buf);
3439 }
3440
3441 inline Monster *GetMutableMonster(void *buf) {
3442 return flatbuffers::GetMutableRoot<Monster>(buf);
3443 }
3444
3445 inline const char *MonsterIdentifier() {
3446 return "MONS";
3447 }
3448
3449 inline bool MonsterBufferHasIdentifier(const void *buf) {
3450 return flatbuffers::BufferHasIdentifier(
3451 buf, MonsterIdentifier());
3452 }
3453
3454 inline bool VerifyMonsterBuffer(
3455 flatbuffers::Verifier &verifier) {
3456 return verifier.VerifyBuffer<MyGame::Example::Monster>(MonsterIdentifier());
3457 }
3458
3459 inline bool VerifySizePrefixedMonsterBuffer(
3460 flatbuffers::Verifier &verifier) {
3461 return verifier.VerifySizePrefixedBuffer<MyGame::Example::Monster>(MonsterIdentifier());
3462 }
3463
3464 inline const char *MonsterExtension() {
3465 return "mon";
3466 }
3467
3468 inline void FinishMonsterBuffer(
3469 flatbuffers::FlatBufferBuilder &fbb,
3470 flatbuffers::Offset<MyGame::Example::Monster> root) {
3471 fbb.Finish(root, MonsterIdentifier());
3472 }
3473
3474 inline void FinishSizePrefixedMonsterBuffer(
3475 flatbuffers::FlatBufferBuilder &fbb,
3476 flatbuffers::Offset<MyGame::Example::Monster> root) {
3477 fbb.FinishSizePrefixed(root, MonsterIdentifier());
3478 }
3479
3480 inline flatbuffers::unique_ptr<MonsterT> UnPackMonster(
3481 const void *buf,
3482 const flatbuffers::resolver_function_t *res = nullptr) {
3483 return flatbuffers::unique_ptr<MonsterT>(GetMonster(buf)->UnPack(res));
3484 }
3485
3486 } // namespace Example
3487 } // namespace MyGame
3488
3489 #endif // FLATBUFFERS_GENERATED_MONSTERTEST_MYGAME_EXAMPLE_H_
3490