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_NAMESPACETEST1_NAMESPACEA_NAMESPACEB_H_ |
| 5 | #define FLATBUFFERS_GENERATED_NAMESPACETEST1_NAMESPACEA_NAMESPACEB_H_ |
| 6 | |
| 7 | #include "flatbuffers/flatbuffers.h" |
| 8 | |
| 9 | namespace NamespaceA { |
| 10 | namespace NamespaceB { |
| 11 | |
| 12 | struct TableInNestedNS; |
Austin Schuh | 272c613 | 2020-11-14 16:37:52 -0800 | [diff] [blame] | 13 | struct TableInNestedNSBuilder; |
| 14 | struct TableInNestedNST; |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 15 | |
| 16 | struct StructInNestedNS; |
| 17 | |
Austin Schuh | 272c613 | 2020-11-14 16:37:52 -0800 | [diff] [blame] | 18 | bool operator==(const TableInNestedNST &lhs, const TableInNestedNST &rhs); |
| 19 | bool operator!=(const TableInNestedNST &lhs, const TableInNestedNST &rhs); |
| 20 | bool operator==(const StructInNestedNS &lhs, const StructInNestedNS &rhs); |
| 21 | bool operator!=(const StructInNestedNS &lhs, const StructInNestedNS &rhs); |
| 22 | |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 23 | inline const flatbuffers::TypeTable *TableInNestedNSTypeTable(); |
| 24 | |
| 25 | inline const flatbuffers::TypeTable *StructInNestedNSTypeTable(); |
| 26 | |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame^] | 27 | enum UnionInNestedNS : uint8_t { |
| 28 | UnionInNestedNS_NONE = 0, |
| 29 | UnionInNestedNS_TableInNestedNS = 1, |
| 30 | UnionInNestedNS_MIN = UnionInNestedNS_NONE, |
| 31 | UnionInNestedNS_MAX = UnionInNestedNS_TableInNestedNS |
| 32 | }; |
| 33 | |
| 34 | inline const UnionInNestedNS (&EnumValuesUnionInNestedNS())[2] { |
| 35 | static const UnionInNestedNS values[] = { |
| 36 | UnionInNestedNS_NONE, |
| 37 | UnionInNestedNS_TableInNestedNS |
| 38 | }; |
| 39 | return values; |
| 40 | } |
| 41 | |
| 42 | inline const char * const *EnumNamesUnionInNestedNS() { |
| 43 | static const char * const names[3] = { |
| 44 | "NONE", |
| 45 | "TableInNestedNS", |
| 46 | nullptr |
| 47 | }; |
| 48 | return names; |
| 49 | } |
| 50 | |
| 51 | inline const char *EnumNameUnionInNestedNS(UnionInNestedNS e) { |
| 52 | if (flatbuffers::IsOutRange(e, UnionInNestedNS_NONE, UnionInNestedNS_TableInNestedNS)) return ""; |
| 53 | const size_t index = static_cast<size_t>(e); |
| 54 | return EnumNamesUnionInNestedNS()[index]; |
| 55 | } |
| 56 | |
| 57 | template<typename T> struct UnionInNestedNSTraits { |
| 58 | static const UnionInNestedNS enum_value = UnionInNestedNS_NONE; |
| 59 | }; |
| 60 | |
| 61 | template<> struct UnionInNestedNSTraits<NamespaceA::NamespaceB::TableInNestedNS> { |
| 62 | static const UnionInNestedNS enum_value = UnionInNestedNS_TableInNestedNS; |
| 63 | }; |
| 64 | |
| 65 | template<typename T> struct UnionInNestedNSUnionTraits { |
| 66 | static const UnionInNestedNS enum_value = UnionInNestedNS_NONE; |
| 67 | }; |
| 68 | |
| 69 | template<> struct UnionInNestedNSUnionTraits<NamespaceA::NamespaceB::TableInNestedNST> { |
| 70 | static const UnionInNestedNS enum_value = UnionInNestedNS_TableInNestedNS; |
| 71 | }; |
| 72 | |
| 73 | struct UnionInNestedNSUnion { |
| 74 | UnionInNestedNS type; |
| 75 | void *value; |
| 76 | |
| 77 | UnionInNestedNSUnion() : type(UnionInNestedNS_NONE), value(nullptr) {} |
| 78 | UnionInNestedNSUnion(UnionInNestedNSUnion&& u) FLATBUFFERS_NOEXCEPT : |
| 79 | type(UnionInNestedNS_NONE), value(nullptr) |
| 80 | { std::swap(type, u.type); std::swap(value, u.value); } |
| 81 | UnionInNestedNSUnion(const UnionInNestedNSUnion &); |
| 82 | UnionInNestedNSUnion &operator=(const UnionInNestedNSUnion &u) |
| 83 | { UnionInNestedNSUnion t(u); std::swap(type, t.type); std::swap(value, t.value); return *this; } |
| 84 | UnionInNestedNSUnion &operator=(UnionInNestedNSUnion &&u) FLATBUFFERS_NOEXCEPT |
| 85 | { std::swap(type, u.type); std::swap(value, u.value); return *this; } |
| 86 | ~UnionInNestedNSUnion() { Reset(); } |
| 87 | |
| 88 | void Reset(); |
| 89 | |
| 90 | template <typename T> |
| 91 | void Set(T&& val) { |
| 92 | typedef typename std::remove_reference<T>::type RT; |
| 93 | Reset(); |
| 94 | type = UnionInNestedNSUnionTraits<RT>::enum_value; |
| 95 | if (type != UnionInNestedNS_NONE) { |
| 96 | value = new RT(std::forward<T>(val)); |
| 97 | } |
| 98 | } |
| 99 | |
| 100 | static void *UnPack(const void *obj, UnionInNestedNS type, const flatbuffers::resolver_function_t *resolver); |
| 101 | flatbuffers::Offset<void> Pack(flatbuffers::FlatBufferBuilder &_fbb, const flatbuffers::rehasher_function_t *_rehasher = nullptr) const; |
| 102 | |
| 103 | NamespaceA::NamespaceB::TableInNestedNST *AsTableInNestedNS() { |
| 104 | return type == UnionInNestedNS_TableInNestedNS ? |
| 105 | reinterpret_cast<NamespaceA::NamespaceB::TableInNestedNST *>(value) : nullptr; |
| 106 | } |
| 107 | const NamespaceA::NamespaceB::TableInNestedNST *AsTableInNestedNS() const { |
| 108 | return type == UnionInNestedNS_TableInNestedNS ? |
| 109 | reinterpret_cast<const NamespaceA::NamespaceB::TableInNestedNST *>(value) : nullptr; |
| 110 | } |
| 111 | }; |
| 112 | |
| 113 | |
| 114 | inline bool operator==(const UnionInNestedNSUnion &lhs, const UnionInNestedNSUnion &rhs) { |
| 115 | if (lhs.type != rhs.type) return false; |
| 116 | switch (lhs.type) { |
| 117 | case UnionInNestedNS_NONE: { |
| 118 | return true; |
| 119 | } |
| 120 | case UnionInNestedNS_TableInNestedNS: { |
| 121 | return *(reinterpret_cast<const NamespaceA::NamespaceB::TableInNestedNST *>(lhs.value)) == |
| 122 | *(reinterpret_cast<const NamespaceA::NamespaceB::TableInNestedNST *>(rhs.value)); |
| 123 | } |
| 124 | default: { |
| 125 | return false; |
| 126 | } |
| 127 | } |
| 128 | } |
| 129 | |
| 130 | inline bool operator!=(const UnionInNestedNSUnion &lhs, const UnionInNestedNSUnion &rhs) { |
| 131 | return !(lhs == rhs); |
| 132 | } |
| 133 | |
| 134 | bool VerifyUnionInNestedNS(flatbuffers::Verifier &verifier, const void *obj, UnionInNestedNS type); |
| 135 | bool VerifyUnionInNestedNSVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector<flatbuffers::Offset<void>> *values, const flatbuffers::Vector<uint8_t> *types); |
| 136 | |
| 137 | enum EnumInNestedNS : int8_t { |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 138 | EnumInNestedNS_A = 0, |
| 139 | EnumInNestedNS_B = 1, |
| 140 | EnumInNestedNS_C = 2, |
| 141 | EnumInNestedNS_MIN = EnumInNestedNS_A, |
| 142 | EnumInNestedNS_MAX = EnumInNestedNS_C |
| 143 | }; |
| 144 | |
| 145 | inline const EnumInNestedNS (&EnumValuesEnumInNestedNS())[3] { |
| 146 | static const EnumInNestedNS values[] = { |
| 147 | EnumInNestedNS_A, |
| 148 | EnumInNestedNS_B, |
| 149 | EnumInNestedNS_C |
| 150 | }; |
| 151 | return values; |
| 152 | } |
| 153 | |
| 154 | inline const char * const *EnumNamesEnumInNestedNS() { |
| 155 | static const char * const names[4] = { |
| 156 | "A", |
| 157 | "B", |
| 158 | "C", |
| 159 | nullptr |
| 160 | }; |
| 161 | return names; |
| 162 | } |
| 163 | |
| 164 | inline const char *EnumNameEnumInNestedNS(EnumInNestedNS e) { |
Austin Schuh | 272c613 | 2020-11-14 16:37:52 -0800 | [diff] [blame] | 165 | if (flatbuffers::IsOutRange(e, EnumInNestedNS_A, EnumInNestedNS_C)) return ""; |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 166 | const size_t index = static_cast<size_t>(e); |
| 167 | return EnumNamesEnumInNestedNS()[index]; |
| 168 | } |
| 169 | |
| 170 | FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) StructInNestedNS FLATBUFFERS_FINAL_CLASS { |
| 171 | private: |
| 172 | int32_t a_; |
| 173 | int32_t b_; |
| 174 | |
| 175 | public: |
| 176 | static const flatbuffers::TypeTable *MiniReflectTypeTable() { |
| 177 | return StructInNestedNSTypeTable(); |
| 178 | } |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame^] | 179 | static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { |
Austin Schuh | 272c613 | 2020-11-14 16:37:52 -0800 | [diff] [blame] | 180 | return "NamespaceA.NamespaceB.StructInNestedNS"; |
| 181 | } |
| 182 | StructInNestedNS() |
| 183 | : a_(0), |
| 184 | b_(0) { |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 185 | } |
| 186 | StructInNestedNS(int32_t _a, int32_t _b) |
| 187 | : a_(flatbuffers::EndianScalar(_a)), |
| 188 | b_(flatbuffers::EndianScalar(_b)) { |
| 189 | } |
| 190 | int32_t a() const { |
| 191 | return flatbuffers::EndianScalar(a_); |
| 192 | } |
| 193 | void mutate_a(int32_t _a) { |
| 194 | flatbuffers::WriteScalar(&a_, _a); |
| 195 | } |
| 196 | int32_t b() const { |
| 197 | return flatbuffers::EndianScalar(b_); |
| 198 | } |
| 199 | void mutate_b(int32_t _b) { |
| 200 | flatbuffers::WriteScalar(&b_, _b); |
| 201 | } |
| 202 | }; |
| 203 | FLATBUFFERS_STRUCT_END(StructInNestedNS, 8); |
| 204 | |
Austin Schuh | 272c613 | 2020-11-14 16:37:52 -0800 | [diff] [blame] | 205 | inline bool operator==(const StructInNestedNS &lhs, const StructInNestedNS &rhs) { |
| 206 | return |
| 207 | (lhs.a() == rhs.a()) && |
| 208 | (lhs.b() == rhs.b()); |
| 209 | } |
| 210 | |
| 211 | inline bool operator!=(const StructInNestedNS &lhs, const StructInNestedNS &rhs) { |
| 212 | return !(lhs == rhs); |
| 213 | } |
| 214 | |
| 215 | |
| 216 | struct TableInNestedNST : public flatbuffers::NativeTable { |
| 217 | typedef TableInNestedNS TableType; |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame^] | 218 | static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { |
Austin Schuh | 272c613 | 2020-11-14 16:37:52 -0800 | [diff] [blame] | 219 | return "NamespaceA.NamespaceB.TableInNestedNST"; |
| 220 | } |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame^] | 221 | int32_t foo = 0; |
Austin Schuh | 272c613 | 2020-11-14 16:37:52 -0800 | [diff] [blame] | 222 | }; |
| 223 | |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 224 | struct TableInNestedNS FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
Austin Schuh | 272c613 | 2020-11-14 16:37:52 -0800 | [diff] [blame] | 225 | typedef TableInNestedNST NativeTableType; |
| 226 | typedef TableInNestedNSBuilder Builder; |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 227 | static const flatbuffers::TypeTable *MiniReflectTypeTable() { |
| 228 | return TableInNestedNSTypeTable(); |
| 229 | } |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame^] | 230 | static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { |
Austin Schuh | 272c613 | 2020-11-14 16:37:52 -0800 | [diff] [blame] | 231 | return "NamespaceA.NamespaceB.TableInNestedNS"; |
| 232 | } |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 233 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 234 | VT_FOO = 4 |
| 235 | }; |
| 236 | int32_t foo() const { |
| 237 | return GetField<int32_t>(VT_FOO, 0); |
| 238 | } |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame^] | 239 | bool mutate_foo(int32_t _foo = 0) { |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 240 | return SetField<int32_t>(VT_FOO, _foo, 0); |
| 241 | } |
| 242 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 243 | return VerifyTableStart(verifier) && |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame^] | 244 | VerifyField<int32_t>(verifier, VT_FOO, 4) && |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 245 | verifier.EndTable(); |
| 246 | } |
Austin Schuh | 272c613 | 2020-11-14 16:37:52 -0800 | [diff] [blame] | 247 | TableInNestedNST *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; |
| 248 | void UnPackTo(TableInNestedNST *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; |
| 249 | static flatbuffers::Offset<TableInNestedNS> Pack(flatbuffers::FlatBufferBuilder &_fbb, const TableInNestedNST* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 250 | }; |
| 251 | |
| 252 | struct TableInNestedNSBuilder { |
Austin Schuh | 272c613 | 2020-11-14 16:37:52 -0800 | [diff] [blame] | 253 | typedef TableInNestedNS Table; |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 254 | flatbuffers::FlatBufferBuilder &fbb_; |
| 255 | flatbuffers::uoffset_t start_; |
| 256 | void add_foo(int32_t foo) { |
| 257 | fbb_.AddElement<int32_t>(TableInNestedNS::VT_FOO, foo, 0); |
| 258 | } |
| 259 | explicit TableInNestedNSBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 260 | : fbb_(_fbb) { |
| 261 | start_ = fbb_.StartTable(); |
| 262 | } |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 263 | flatbuffers::Offset<TableInNestedNS> Finish() { |
| 264 | const auto end = fbb_.EndTable(start_); |
| 265 | auto o = flatbuffers::Offset<TableInNestedNS>(end); |
| 266 | return o; |
| 267 | } |
| 268 | }; |
| 269 | |
| 270 | inline flatbuffers::Offset<TableInNestedNS> CreateTableInNestedNS( |
| 271 | flatbuffers::FlatBufferBuilder &_fbb, |
| 272 | int32_t foo = 0) { |
| 273 | TableInNestedNSBuilder builder_(_fbb); |
| 274 | builder_.add_foo(foo); |
| 275 | return builder_.Finish(); |
| 276 | } |
| 277 | |
Austin Schuh | 272c613 | 2020-11-14 16:37:52 -0800 | [diff] [blame] | 278 | flatbuffers::Offset<TableInNestedNS> CreateTableInNestedNS(flatbuffers::FlatBufferBuilder &_fbb, const TableInNestedNST *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); |
| 279 | |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame^] | 280 | |
| 281 | inline bool operator==(const TableInNestedNST &lhs, const TableInNestedNST &rhs) { |
| 282 | return |
| 283 | (lhs.foo == rhs.foo); |
| 284 | } |
| 285 | |
| 286 | inline bool operator!=(const TableInNestedNST &lhs, const TableInNestedNST &rhs) { |
| 287 | return !(lhs == rhs); |
| 288 | } |
| 289 | |
| 290 | |
Austin Schuh | 272c613 | 2020-11-14 16:37:52 -0800 | [diff] [blame] | 291 | inline TableInNestedNST *TableInNestedNS::UnPack(const flatbuffers::resolver_function_t *_resolver) const { |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame^] | 292 | auto _o = std::unique_ptr<TableInNestedNST>(new TableInNestedNST()); |
Austin Schuh | 272c613 | 2020-11-14 16:37:52 -0800 | [diff] [blame] | 293 | UnPackTo(_o.get(), _resolver); |
| 294 | return _o.release(); |
| 295 | } |
| 296 | |
| 297 | inline void TableInNestedNS::UnPackTo(TableInNestedNST *_o, const flatbuffers::resolver_function_t *_resolver) const { |
| 298 | (void)_o; |
| 299 | (void)_resolver; |
| 300 | { auto _e = foo(); _o->foo = _e; } |
| 301 | } |
| 302 | |
| 303 | inline flatbuffers::Offset<TableInNestedNS> TableInNestedNS::Pack(flatbuffers::FlatBufferBuilder &_fbb, const TableInNestedNST* _o, const flatbuffers::rehasher_function_t *_rehasher) { |
| 304 | return CreateTableInNestedNS(_fbb, _o, _rehasher); |
| 305 | } |
| 306 | |
| 307 | inline flatbuffers::Offset<TableInNestedNS> CreateTableInNestedNS(flatbuffers::FlatBufferBuilder &_fbb, const TableInNestedNST *_o, const flatbuffers::rehasher_function_t *_rehasher) { |
| 308 | (void)_rehasher; |
| 309 | (void)_o; |
| 310 | struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const TableInNestedNST* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; |
| 311 | auto _foo = _o->foo; |
| 312 | return NamespaceA::NamespaceB::CreateTableInNestedNS( |
| 313 | _fbb, |
| 314 | _foo); |
| 315 | } |
| 316 | |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame^] | 317 | inline bool VerifyUnionInNestedNS(flatbuffers::Verifier &verifier, const void *obj, UnionInNestedNS type) { |
| 318 | switch (type) { |
| 319 | case UnionInNestedNS_NONE: { |
| 320 | return true; |
| 321 | } |
| 322 | case UnionInNestedNS_TableInNestedNS: { |
| 323 | auto ptr = reinterpret_cast<const NamespaceA::NamespaceB::TableInNestedNS *>(obj); |
| 324 | return verifier.VerifyTable(ptr); |
| 325 | } |
| 326 | default: return true; |
| 327 | } |
| 328 | } |
| 329 | |
| 330 | inline bool VerifyUnionInNestedNSVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector<flatbuffers::Offset<void>> *values, const flatbuffers::Vector<uint8_t> *types) { |
| 331 | if (!values || !types) return !values && !types; |
| 332 | if (values->size() != types->size()) return false; |
| 333 | for (flatbuffers::uoffset_t i = 0; i < values->size(); ++i) { |
| 334 | if (!VerifyUnionInNestedNS( |
| 335 | verifier, values->Get(i), types->GetEnum<UnionInNestedNS>(i))) { |
| 336 | return false; |
| 337 | } |
| 338 | } |
| 339 | return true; |
| 340 | } |
| 341 | |
| 342 | inline void *UnionInNestedNSUnion::UnPack(const void *obj, UnionInNestedNS type, const flatbuffers::resolver_function_t *resolver) { |
| 343 | (void)resolver; |
| 344 | switch (type) { |
| 345 | case UnionInNestedNS_TableInNestedNS: { |
| 346 | auto ptr = reinterpret_cast<const NamespaceA::NamespaceB::TableInNestedNS *>(obj); |
| 347 | return ptr->UnPack(resolver); |
| 348 | } |
| 349 | default: return nullptr; |
| 350 | } |
| 351 | } |
| 352 | |
| 353 | inline flatbuffers::Offset<void> UnionInNestedNSUnion::Pack(flatbuffers::FlatBufferBuilder &_fbb, const flatbuffers::rehasher_function_t *_rehasher) const { |
| 354 | (void)_rehasher; |
| 355 | switch (type) { |
| 356 | case UnionInNestedNS_TableInNestedNS: { |
| 357 | auto ptr = reinterpret_cast<const NamespaceA::NamespaceB::TableInNestedNST *>(value); |
| 358 | return CreateTableInNestedNS(_fbb, ptr, _rehasher).Union(); |
| 359 | } |
| 360 | default: return 0; |
| 361 | } |
| 362 | } |
| 363 | |
| 364 | inline UnionInNestedNSUnion::UnionInNestedNSUnion(const UnionInNestedNSUnion &u) : type(u.type), value(nullptr) { |
| 365 | switch (type) { |
| 366 | case UnionInNestedNS_TableInNestedNS: { |
| 367 | value = new NamespaceA::NamespaceB::TableInNestedNST(*reinterpret_cast<NamespaceA::NamespaceB::TableInNestedNST *>(u.value)); |
| 368 | break; |
| 369 | } |
| 370 | default: |
| 371 | break; |
| 372 | } |
| 373 | } |
| 374 | |
| 375 | inline void UnionInNestedNSUnion::Reset() { |
| 376 | switch (type) { |
| 377 | case UnionInNestedNS_TableInNestedNS: { |
| 378 | auto ptr = reinterpret_cast<NamespaceA::NamespaceB::TableInNestedNST *>(value); |
| 379 | delete ptr; |
| 380 | break; |
| 381 | } |
| 382 | default: break; |
| 383 | } |
| 384 | value = nullptr; |
| 385 | type = UnionInNestedNS_NONE; |
| 386 | } |
| 387 | |
| 388 | inline const flatbuffers::TypeTable *UnionInNestedNSTypeTable() { |
| 389 | static const flatbuffers::TypeCode type_codes[] = { |
| 390 | { flatbuffers::ET_SEQUENCE, 0, -1 }, |
| 391 | { flatbuffers::ET_SEQUENCE, 0, 0 } |
| 392 | }; |
| 393 | static const flatbuffers::TypeFunction type_refs[] = { |
| 394 | NamespaceA::NamespaceB::TableInNestedNSTypeTable |
| 395 | }; |
| 396 | static const char * const names[] = { |
| 397 | "NONE", |
| 398 | "TableInNestedNS" |
| 399 | }; |
| 400 | static const flatbuffers::TypeTable tt = { |
| 401 | flatbuffers::ST_UNION, 2, type_codes, type_refs, nullptr, nullptr, names |
| 402 | }; |
| 403 | return &tt; |
| 404 | } |
| 405 | |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 406 | inline const flatbuffers::TypeTable *EnumInNestedNSTypeTable() { |
| 407 | static const flatbuffers::TypeCode type_codes[] = { |
| 408 | { flatbuffers::ET_CHAR, 0, 0 }, |
| 409 | { flatbuffers::ET_CHAR, 0, 0 }, |
| 410 | { flatbuffers::ET_CHAR, 0, 0 } |
| 411 | }; |
| 412 | static const flatbuffers::TypeFunction type_refs[] = { |
| 413 | NamespaceA::NamespaceB::EnumInNestedNSTypeTable |
| 414 | }; |
| 415 | static const char * const names[] = { |
| 416 | "A", |
| 417 | "B", |
| 418 | "C" |
| 419 | }; |
| 420 | static const flatbuffers::TypeTable tt = { |
Austin Schuh | 272c613 | 2020-11-14 16:37:52 -0800 | [diff] [blame] | 421 | flatbuffers::ST_ENUM, 3, type_codes, type_refs, nullptr, nullptr, names |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 422 | }; |
| 423 | return &tt; |
| 424 | } |
| 425 | |
| 426 | inline const flatbuffers::TypeTable *TableInNestedNSTypeTable() { |
| 427 | static const flatbuffers::TypeCode type_codes[] = { |
| 428 | { flatbuffers::ET_INT, 0, -1 } |
| 429 | }; |
| 430 | static const char * const names[] = { |
| 431 | "foo" |
| 432 | }; |
| 433 | static const flatbuffers::TypeTable tt = { |
Austin Schuh | 272c613 | 2020-11-14 16:37:52 -0800 | [diff] [blame] | 434 | flatbuffers::ST_TABLE, 1, type_codes, nullptr, nullptr, nullptr, names |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 435 | }; |
| 436 | return &tt; |
| 437 | } |
| 438 | |
| 439 | inline const flatbuffers::TypeTable *StructInNestedNSTypeTable() { |
| 440 | static const flatbuffers::TypeCode type_codes[] = { |
| 441 | { flatbuffers::ET_INT, 0, -1 }, |
| 442 | { flatbuffers::ET_INT, 0, -1 } |
| 443 | }; |
| 444 | static const int64_t values[] = { 0, 4, 8 }; |
| 445 | static const char * const names[] = { |
| 446 | "a", |
| 447 | "b" |
| 448 | }; |
| 449 | static const flatbuffers::TypeTable tt = { |
Austin Schuh | 272c613 | 2020-11-14 16:37:52 -0800 | [diff] [blame] | 450 | flatbuffers::ST_STRUCT, 2, type_codes, nullptr, nullptr, values, names |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 451 | }; |
| 452 | return &tt; |
| 453 | } |
| 454 | |
| 455 | } // namespace NamespaceB |
| 456 | } // namespace NamespaceA |
| 457 | |
| 458 | #endif // FLATBUFFERS_GENERATED_NAMESPACETEST1_NAMESPACEA_NAMESPACEB_H_ |