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