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