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