Austin Schuh | 2dd86a9 | 2022-09-14 21:19:23 -0700 | [diff] [blame] | 1 | // automatically generated by the FlatBuffers compiler, do not modify |
| 2 | |
| 3 | |
| 4 | #ifndef FLATBUFFERS_GENERATED_NATIVEINLINETABLETEST_H_ |
| 5 | #define FLATBUFFERS_GENERATED_NATIVEINLINETABLETEST_H_ |
| 6 | |
| 7 | #include "flatbuffers/flatbuffers.h" |
| 8 | |
| 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 | |
| 16 | struct NativeInlineTable; |
| 17 | struct NativeInlineTableBuilder; |
| 18 | struct NativeInlineTableT; |
| 19 | |
| 20 | struct TestNativeInlineTable; |
| 21 | struct TestNativeInlineTableBuilder; |
| 22 | struct TestNativeInlineTableT; |
| 23 | |
| 24 | bool operator==(const NativeInlineTableT &lhs, const NativeInlineTableT &rhs); |
| 25 | bool operator!=(const NativeInlineTableT &lhs, const NativeInlineTableT &rhs); |
| 26 | bool operator==(const TestNativeInlineTableT &lhs, const TestNativeInlineTableT &rhs); |
| 27 | bool operator!=(const TestNativeInlineTableT &lhs, const TestNativeInlineTableT &rhs); |
| 28 | |
| 29 | inline const flatbuffers::TypeTable *NativeInlineTableTypeTable(); |
| 30 | |
| 31 | inline const flatbuffers::TypeTable *TestNativeInlineTableTypeTable(); |
| 32 | |
| 33 | struct NativeInlineTableT : public flatbuffers::NativeTable { |
| 34 | typedef NativeInlineTable TableType; |
| 35 | int32_t a = 0; |
| 36 | }; |
| 37 | |
| 38 | struct NativeInlineTable FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 39 | typedef NativeInlineTableT NativeTableType; |
| 40 | typedef NativeInlineTableBuilder Builder; |
| 41 | static const flatbuffers::TypeTable *MiniReflectTypeTable() { |
| 42 | return NativeInlineTableTypeTable(); |
| 43 | } |
| 44 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 45 | VT_A = 4 |
| 46 | }; |
| 47 | int32_t a() const { |
| 48 | return GetField<int32_t>(VT_A, 0); |
| 49 | } |
| 50 | bool mutate_a(int32_t _a = 0) { |
| 51 | return SetField<int32_t>(VT_A, _a, 0); |
| 52 | } |
| 53 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 54 | return VerifyTableStart(verifier) && |
| 55 | VerifyField<int32_t>(verifier, VT_A, 4) && |
| 56 | verifier.EndTable(); |
| 57 | } |
| 58 | NativeInlineTableT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; |
| 59 | void UnPackTo(NativeInlineTableT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; |
| 60 | static flatbuffers::Offset<NativeInlineTable> Pack(flatbuffers::FlatBufferBuilder &_fbb, const NativeInlineTableT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); |
| 61 | }; |
| 62 | |
| 63 | struct NativeInlineTableBuilder { |
| 64 | typedef NativeInlineTable Table; |
| 65 | flatbuffers::FlatBufferBuilder &fbb_; |
| 66 | flatbuffers::uoffset_t start_; |
| 67 | void add_a(int32_t a) { |
| 68 | fbb_.AddElement<int32_t>(NativeInlineTable::VT_A, a, 0); |
| 69 | } |
| 70 | explicit NativeInlineTableBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 71 | : fbb_(_fbb) { |
| 72 | start_ = fbb_.StartTable(); |
| 73 | } |
| 74 | flatbuffers::Offset<NativeInlineTable> Finish() { |
| 75 | const auto end = fbb_.EndTable(start_); |
| 76 | auto o = flatbuffers::Offset<NativeInlineTable>(end); |
| 77 | return o; |
| 78 | } |
| 79 | }; |
| 80 | |
| 81 | inline flatbuffers::Offset<NativeInlineTable> CreateNativeInlineTable( |
| 82 | flatbuffers::FlatBufferBuilder &_fbb, |
| 83 | int32_t a = 0) { |
| 84 | NativeInlineTableBuilder builder_(_fbb); |
| 85 | builder_.add_a(a); |
| 86 | return builder_.Finish(); |
| 87 | } |
| 88 | |
| 89 | flatbuffers::Offset<NativeInlineTable> CreateNativeInlineTable(flatbuffers::FlatBufferBuilder &_fbb, const NativeInlineTableT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); |
| 90 | |
| 91 | struct TestNativeInlineTableT : public flatbuffers::NativeTable { |
| 92 | typedef TestNativeInlineTable TableType; |
| 93 | std::vector<NativeInlineTableT> t{}; |
| 94 | }; |
| 95 | |
| 96 | struct TestNativeInlineTable FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 97 | typedef TestNativeInlineTableT NativeTableType; |
| 98 | typedef TestNativeInlineTableBuilder Builder; |
| 99 | static const flatbuffers::TypeTable *MiniReflectTypeTable() { |
| 100 | return TestNativeInlineTableTypeTable(); |
| 101 | } |
| 102 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 103 | VT_T = 4 |
| 104 | }; |
| 105 | const flatbuffers::Vector<flatbuffers::Offset<NativeInlineTable>> *t() const { |
| 106 | return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<NativeInlineTable>> *>(VT_T); |
| 107 | } |
| 108 | flatbuffers::Vector<flatbuffers::Offset<NativeInlineTable>> *mutable_t() { |
| 109 | return GetPointer<flatbuffers::Vector<flatbuffers::Offset<NativeInlineTable>> *>(VT_T); |
| 110 | } |
| 111 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 112 | return VerifyTableStart(verifier) && |
| 113 | VerifyOffset(verifier, VT_T) && |
| 114 | verifier.VerifyVector(t()) && |
| 115 | verifier.VerifyVectorOfTables(t()) && |
| 116 | verifier.EndTable(); |
| 117 | } |
| 118 | TestNativeInlineTableT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; |
| 119 | void UnPackTo(TestNativeInlineTableT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; |
| 120 | static flatbuffers::Offset<TestNativeInlineTable> Pack(flatbuffers::FlatBufferBuilder &_fbb, const TestNativeInlineTableT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); |
| 121 | }; |
| 122 | |
| 123 | struct TestNativeInlineTableBuilder { |
| 124 | typedef TestNativeInlineTable Table; |
| 125 | flatbuffers::FlatBufferBuilder &fbb_; |
| 126 | flatbuffers::uoffset_t start_; |
| 127 | void add_t(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<NativeInlineTable>>> t) { |
| 128 | fbb_.AddOffset(TestNativeInlineTable::VT_T, t); |
| 129 | } |
| 130 | explicit TestNativeInlineTableBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 131 | : fbb_(_fbb) { |
| 132 | start_ = fbb_.StartTable(); |
| 133 | } |
| 134 | flatbuffers::Offset<TestNativeInlineTable> Finish() { |
| 135 | const auto end = fbb_.EndTable(start_); |
| 136 | auto o = flatbuffers::Offset<TestNativeInlineTable>(end); |
| 137 | return o; |
| 138 | } |
| 139 | }; |
| 140 | |
| 141 | inline flatbuffers::Offset<TestNativeInlineTable> CreateTestNativeInlineTable( |
| 142 | flatbuffers::FlatBufferBuilder &_fbb, |
| 143 | flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<NativeInlineTable>>> t = 0) { |
| 144 | TestNativeInlineTableBuilder builder_(_fbb); |
| 145 | builder_.add_t(t); |
| 146 | return builder_.Finish(); |
| 147 | } |
| 148 | |
| 149 | inline flatbuffers::Offset<TestNativeInlineTable> CreateTestNativeInlineTableDirect( |
| 150 | flatbuffers::FlatBufferBuilder &_fbb, |
| 151 | const std::vector<flatbuffers::Offset<NativeInlineTable>> *t = nullptr) { |
| 152 | auto t__ = t ? _fbb.CreateVector<flatbuffers::Offset<NativeInlineTable>>(*t) : 0; |
| 153 | return CreateTestNativeInlineTable( |
| 154 | _fbb, |
| 155 | t__); |
| 156 | } |
| 157 | |
| 158 | flatbuffers::Offset<TestNativeInlineTable> CreateTestNativeInlineTable(flatbuffers::FlatBufferBuilder &_fbb, const TestNativeInlineTableT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); |
| 159 | |
| 160 | |
| 161 | inline bool operator==(const NativeInlineTableT &lhs, const NativeInlineTableT &rhs) { |
| 162 | return |
| 163 | (lhs.a == rhs.a); |
| 164 | } |
| 165 | |
| 166 | inline bool operator!=(const NativeInlineTableT &lhs, const NativeInlineTableT &rhs) { |
| 167 | return !(lhs == rhs); |
| 168 | } |
| 169 | |
| 170 | |
| 171 | inline NativeInlineTableT *NativeInlineTable::UnPack(const flatbuffers::resolver_function_t *_resolver) const { |
| 172 | auto _o = std::unique_ptr<NativeInlineTableT>(new NativeInlineTableT()); |
| 173 | UnPackTo(_o.get(), _resolver); |
| 174 | return _o.release(); |
| 175 | } |
| 176 | |
| 177 | inline void NativeInlineTable::UnPackTo(NativeInlineTableT *_o, const flatbuffers::resolver_function_t *_resolver) const { |
| 178 | (void)_o; |
| 179 | (void)_resolver; |
| 180 | { auto _e = a(); _o->a = _e; } |
| 181 | } |
| 182 | |
| 183 | inline flatbuffers::Offset<NativeInlineTable> NativeInlineTable::Pack(flatbuffers::FlatBufferBuilder &_fbb, const NativeInlineTableT* _o, const flatbuffers::rehasher_function_t *_rehasher) { |
| 184 | return CreateNativeInlineTable(_fbb, _o, _rehasher); |
| 185 | } |
| 186 | |
| 187 | inline flatbuffers::Offset<NativeInlineTable> CreateNativeInlineTable(flatbuffers::FlatBufferBuilder &_fbb, const NativeInlineTableT *_o, const flatbuffers::rehasher_function_t *_rehasher) { |
| 188 | (void)_rehasher; |
| 189 | (void)_o; |
| 190 | struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const NativeInlineTableT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; |
| 191 | auto _a = _o->a; |
| 192 | return CreateNativeInlineTable( |
| 193 | _fbb, |
| 194 | _a); |
| 195 | } |
| 196 | |
| 197 | |
| 198 | inline bool operator==(const TestNativeInlineTableT &lhs, const TestNativeInlineTableT &rhs) { |
| 199 | return |
| 200 | (lhs.t == rhs.t); |
| 201 | } |
| 202 | |
| 203 | inline bool operator!=(const TestNativeInlineTableT &lhs, const TestNativeInlineTableT &rhs) { |
| 204 | return !(lhs == rhs); |
| 205 | } |
| 206 | |
| 207 | |
| 208 | inline TestNativeInlineTableT *TestNativeInlineTable::UnPack(const flatbuffers::resolver_function_t *_resolver) const { |
| 209 | auto _o = std::unique_ptr<TestNativeInlineTableT>(new TestNativeInlineTableT()); |
| 210 | UnPackTo(_o.get(), _resolver); |
| 211 | return _o.release(); |
| 212 | } |
| 213 | |
| 214 | inline void TestNativeInlineTable::UnPackTo(TestNativeInlineTableT *_o, const flatbuffers::resolver_function_t *_resolver) const { |
| 215 | (void)_o; |
| 216 | (void)_resolver; |
| 217 | { auto _e = t(); if (_e) { _o->t.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->t[_i] = *flatbuffers::unique_ptr<NativeInlineTableT>(_e->Get(_i)->UnPack(_resolver)); } } else { _o->t.resize(0); } } |
| 218 | } |
| 219 | |
| 220 | inline flatbuffers::Offset<TestNativeInlineTable> TestNativeInlineTable::Pack(flatbuffers::FlatBufferBuilder &_fbb, const TestNativeInlineTableT* _o, const flatbuffers::rehasher_function_t *_rehasher) { |
| 221 | return CreateTestNativeInlineTable(_fbb, _o, _rehasher); |
| 222 | } |
| 223 | |
| 224 | inline flatbuffers::Offset<TestNativeInlineTable> CreateTestNativeInlineTable(flatbuffers::FlatBufferBuilder &_fbb, const TestNativeInlineTableT *_o, const flatbuffers::rehasher_function_t *_rehasher) { |
| 225 | (void)_rehasher; |
| 226 | (void)_o; |
| 227 | struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const TestNativeInlineTableT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; |
| 228 | auto _t = _o->t.size() ? _fbb.CreateVector<flatbuffers::Offset<NativeInlineTable>> (_o->t.size(), [](size_t i, _VectorArgs *__va) { return CreateNativeInlineTable(*__va->__fbb, &(__va->__o->t[i]), __va->__rehasher); }, &_va ) : 0; |
| 229 | return CreateTestNativeInlineTable( |
| 230 | _fbb, |
| 231 | _t); |
| 232 | } |
| 233 | |
| 234 | inline const flatbuffers::TypeTable *NativeInlineTableTypeTable() { |
| 235 | static const flatbuffers::TypeCode type_codes[] = { |
| 236 | { flatbuffers::ET_INT, 0, -1 } |
| 237 | }; |
| 238 | static const char * const names[] = { |
| 239 | "a" |
| 240 | }; |
| 241 | static const flatbuffers::TypeTable tt = { |
| 242 | flatbuffers::ST_TABLE, 1, type_codes, nullptr, nullptr, nullptr, names |
| 243 | }; |
| 244 | return &tt; |
| 245 | } |
| 246 | |
| 247 | inline const flatbuffers::TypeTable *TestNativeInlineTableTypeTable() { |
| 248 | static const flatbuffers::TypeCode type_codes[] = { |
| 249 | { flatbuffers::ET_SEQUENCE, 1, 0 } |
| 250 | }; |
| 251 | static const flatbuffers::TypeFunction type_refs[] = { |
| 252 | NativeInlineTableTypeTable |
| 253 | }; |
| 254 | static const char * const names[] = { |
| 255 | "t" |
| 256 | }; |
| 257 | static const flatbuffers::TypeTable tt = { |
| 258 | flatbuffers::ST_TABLE, 1, type_codes, type_refs, nullptr, nullptr, names |
| 259 | }; |
| 260 | return &tt; |
| 261 | } |
| 262 | |
| 263 | #endif // FLATBUFFERS_GENERATED_NATIVEINLINETABLETEST_H_ |