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