blob: bb822369e7f1b2cc1c3809db58581aedfa709adc [file] [log] [blame]
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001// 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
9namespace NamespaceA {
10namespace NamespaceB {
11
12struct TableInNestedNS;
Austin Schuh272c6132020-11-14 16:37:52 -080013struct TableInNestedNSBuilder;
14struct TableInNestedNST;
Austin Schuhe89fa2d2019-08-14 20:24:23 -070015
16struct StructInNestedNS;
17
Austin Schuh272c6132020-11-14 16:37:52 -080018bool operator==(const TableInNestedNST &lhs, const TableInNestedNST &rhs);
19bool operator!=(const TableInNestedNST &lhs, const TableInNestedNST &rhs);
20bool operator==(const StructInNestedNS &lhs, const StructInNestedNS &rhs);
21bool operator!=(const StructInNestedNS &lhs, const StructInNestedNS &rhs);
22
Austin Schuhe89fa2d2019-08-14 20:24:23 -070023inline const flatbuffers::TypeTable *TableInNestedNSTypeTable();
24
25inline const flatbuffers::TypeTable *StructInNestedNSTypeTable();
26
James Kuszmaul8e62b022022-03-22 09:33:25 -070027enum UnionInNestedNS : uint8_t {
28 UnionInNestedNS_NONE = 0,
29 UnionInNestedNS_TableInNestedNS = 1,
30 UnionInNestedNS_MIN = UnionInNestedNS_NONE,
31 UnionInNestedNS_MAX = UnionInNestedNS_TableInNestedNS
32};
33
34inline const UnionInNestedNS (&EnumValuesUnionInNestedNS())[2] {
35 static const UnionInNestedNS values[] = {
36 UnionInNestedNS_NONE,
37 UnionInNestedNS_TableInNestedNS
38 };
39 return values;
40}
41
42inline const char * const *EnumNamesUnionInNestedNS() {
43 static const char * const names[3] = {
44 "NONE",
45 "TableInNestedNS",
46 nullptr
47 };
48 return names;
49}
50
51inline 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
57template<typename T> struct UnionInNestedNSTraits {
58 static const UnionInNestedNS enum_value = UnionInNestedNS_NONE;
59};
60
61template<> struct UnionInNestedNSTraits<NamespaceA::NamespaceB::TableInNestedNS> {
62 static const UnionInNestedNS enum_value = UnionInNestedNS_TableInNestedNS;
63};
64
65template<typename T> struct UnionInNestedNSUnionTraits {
66 static const UnionInNestedNS enum_value = UnionInNestedNS_NONE;
67};
68
69template<> struct UnionInNestedNSUnionTraits<NamespaceA::NamespaceB::TableInNestedNST> {
70 static const UnionInNestedNS enum_value = UnionInNestedNS_TableInNestedNS;
71};
72
73struct 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
114inline 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
130inline bool operator!=(const UnionInNestedNSUnion &lhs, const UnionInNestedNSUnion &rhs) {
131 return !(lhs == rhs);
132}
133
134bool VerifyUnionInNestedNS(flatbuffers::Verifier &verifier, const void *obj, UnionInNestedNS type);
135bool VerifyUnionInNestedNSVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector<flatbuffers::Offset<void>> *values, const flatbuffers::Vector<uint8_t> *types);
136
137enum EnumInNestedNS : int8_t {
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700138 EnumInNestedNS_A = 0,
139 EnumInNestedNS_B = 1,
140 EnumInNestedNS_C = 2,
141 EnumInNestedNS_MIN = EnumInNestedNS_A,
142 EnumInNestedNS_MAX = EnumInNestedNS_C
143};
144
145inline const EnumInNestedNS (&EnumValuesEnumInNestedNS())[3] {
146 static const EnumInNestedNS values[] = {
147 EnumInNestedNS_A,
148 EnumInNestedNS_B,
149 EnumInNestedNS_C
150 };
151 return values;
152}
153
154inline 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
164inline const char *EnumNameEnumInNestedNS(EnumInNestedNS e) {
Austin Schuh272c6132020-11-14 16:37:52 -0800165 if (flatbuffers::IsOutRange(e, EnumInNestedNS_A, EnumInNestedNS_C)) return "";
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700166 const size_t index = static_cast<size_t>(e);
167 return EnumNamesEnumInNestedNS()[index];
168}
169
170FLATBUFFERS_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 Kuszmaul8e62b022022-03-22 09:33:25 -0700179 static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() {
Austin Schuh272c6132020-11-14 16:37:52 -0800180 return "NamespaceA.NamespaceB.StructInNestedNS";
181 }
182 StructInNestedNS()
183 : a_(0),
184 b_(0) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700185 }
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};
203FLATBUFFERS_STRUCT_END(StructInNestedNS, 8);
204
Austin Schuh272c6132020-11-14 16:37:52 -0800205inline bool operator==(const StructInNestedNS &lhs, const StructInNestedNS &rhs) {
206 return
207 (lhs.a() == rhs.a()) &&
208 (lhs.b() == rhs.b());
209}
210
211inline bool operator!=(const StructInNestedNS &lhs, const StructInNestedNS &rhs) {
212 return !(lhs == rhs);
213}
214
215
216struct TableInNestedNST : public flatbuffers::NativeTable {
217 typedef TableInNestedNS TableType;
James Kuszmaul8e62b022022-03-22 09:33:25 -0700218 static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() {
Austin Schuh272c6132020-11-14 16:37:52 -0800219 return "NamespaceA.NamespaceB.TableInNestedNST";
220 }
James Kuszmaul8e62b022022-03-22 09:33:25 -0700221 int32_t foo = 0;
Austin Schuh272c6132020-11-14 16:37:52 -0800222};
223
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700224struct TableInNestedNS FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
Austin Schuh272c6132020-11-14 16:37:52 -0800225 typedef TableInNestedNST NativeTableType;
226 typedef TableInNestedNSBuilder Builder;
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700227 static const flatbuffers::TypeTable *MiniReflectTypeTable() {
228 return TableInNestedNSTypeTable();
229 }
James Kuszmaul8e62b022022-03-22 09:33:25 -0700230 static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() {
Austin Schuh272c6132020-11-14 16:37:52 -0800231 return "NamespaceA.NamespaceB.TableInNestedNS";
232 }
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700233 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 Kuszmaul8e62b022022-03-22 09:33:25 -0700239 bool mutate_foo(int32_t _foo = 0) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700240 return SetField<int32_t>(VT_FOO, _foo, 0);
241 }
242 bool Verify(flatbuffers::Verifier &verifier) const {
243 return VerifyTableStart(verifier) &&
James Kuszmaul8e62b022022-03-22 09:33:25 -0700244 VerifyField<int32_t>(verifier, VT_FOO, 4) &&
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700245 verifier.EndTable();
246 }
Austin Schuh272c6132020-11-14 16:37:52 -0800247 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 Schuhe89fa2d2019-08-14 20:24:23 -0700250};
251
252struct TableInNestedNSBuilder {
Austin Schuh272c6132020-11-14 16:37:52 -0800253 typedef TableInNestedNS Table;
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700254 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 Schuhe89fa2d2019-08-14 20:24:23 -0700263 flatbuffers::Offset<TableInNestedNS> Finish() {
264 const auto end = fbb_.EndTable(start_);
265 auto o = flatbuffers::Offset<TableInNestedNS>(end);
266 return o;
267 }
268};
269
270inline 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 Schuh272c6132020-11-14 16:37:52 -0800278flatbuffers::Offset<TableInNestedNS> CreateTableInNestedNS(flatbuffers::FlatBufferBuilder &_fbb, const TableInNestedNST *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
279
James Kuszmaul8e62b022022-03-22 09:33:25 -0700280
281inline bool operator==(const TableInNestedNST &lhs, const TableInNestedNST &rhs) {
282 return
283 (lhs.foo == rhs.foo);
284}
285
286inline bool operator!=(const TableInNestedNST &lhs, const TableInNestedNST &rhs) {
287 return !(lhs == rhs);
288}
289
290
Austin Schuh272c6132020-11-14 16:37:52 -0800291inline TableInNestedNST *TableInNestedNS::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
James Kuszmaul8e62b022022-03-22 09:33:25 -0700292 auto _o = std::unique_ptr<TableInNestedNST>(new TableInNestedNST());
Austin Schuh272c6132020-11-14 16:37:52 -0800293 UnPackTo(_o.get(), _resolver);
294 return _o.release();
295}
296
297inline 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
303inline 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
307inline 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 Kuszmaul8e62b022022-03-22 09:33:25 -0700317inline 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
330inline 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
342inline 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
353inline 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
364inline 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
375inline 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
388inline 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 Schuhe89fa2d2019-08-14 20:24:23 -0700406inline 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 Schuh272c6132020-11-14 16:37:52 -0800421 flatbuffers::ST_ENUM, 3, type_codes, type_refs, nullptr, nullptr, names
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700422 };
423 return &tt;
424}
425
426inline 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 Schuh272c6132020-11-14 16:37:52 -0800434 flatbuffers::ST_TABLE, 1, type_codes, nullptr, nullptr, nullptr, names
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700435 };
436 return &tt;
437}
438
439inline 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 Schuh272c6132020-11-14 16:37:52 -0800450 flatbuffers::ST_STRUCT, 2, type_codes, nullptr, nullptr, values, names
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700451 };
452 return &tt;
453}
454
455} // namespace NamespaceB
456} // namespace NamespaceA
457
458#endif // FLATBUFFERS_GENERATED_NAMESPACETEST1_NAMESPACEA_NAMESPACEB_H_