blob: daaf7ae4446df05127694c966983a1fd702771ee [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;
13
14struct StructInNestedNS;
15
16inline const flatbuffers::TypeTable *TableInNestedNSTypeTable();
17
18inline const flatbuffers::TypeTable *StructInNestedNSTypeTable();
19
20enum EnumInNestedNS {
21 EnumInNestedNS_A = 0,
22 EnumInNestedNS_B = 1,
23 EnumInNestedNS_C = 2,
24 EnumInNestedNS_MIN = EnumInNestedNS_A,
25 EnumInNestedNS_MAX = EnumInNestedNS_C
26};
27
28inline const EnumInNestedNS (&EnumValuesEnumInNestedNS())[3] {
29 static const EnumInNestedNS values[] = {
30 EnumInNestedNS_A,
31 EnumInNestedNS_B,
32 EnumInNestedNS_C
33 };
34 return values;
35}
36
37inline const char * const *EnumNamesEnumInNestedNS() {
38 static const char * const names[4] = {
39 "A",
40 "B",
41 "C",
42 nullptr
43 };
44 return names;
45}
46
47inline const char *EnumNameEnumInNestedNS(EnumInNestedNS e) {
48 if (e < EnumInNestedNS_A || e > EnumInNestedNS_C) return "";
49 const size_t index = static_cast<size_t>(e);
50 return EnumNamesEnumInNestedNS()[index];
51}
52
53FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) StructInNestedNS FLATBUFFERS_FINAL_CLASS {
54 private:
55 int32_t a_;
56 int32_t b_;
57
58 public:
59 static const flatbuffers::TypeTable *MiniReflectTypeTable() {
60 return StructInNestedNSTypeTable();
61 }
62 StructInNestedNS() {
63 memset(static_cast<void *>(this), 0, sizeof(StructInNestedNS));
64 }
65 StructInNestedNS(int32_t _a, int32_t _b)
66 : a_(flatbuffers::EndianScalar(_a)),
67 b_(flatbuffers::EndianScalar(_b)) {
68 }
69 int32_t a() const {
70 return flatbuffers::EndianScalar(a_);
71 }
72 void mutate_a(int32_t _a) {
73 flatbuffers::WriteScalar(&a_, _a);
74 }
75 int32_t b() const {
76 return flatbuffers::EndianScalar(b_);
77 }
78 void mutate_b(int32_t _b) {
79 flatbuffers::WriteScalar(&b_, _b);
80 }
81};
82FLATBUFFERS_STRUCT_END(StructInNestedNS, 8);
83
84struct TableInNestedNS FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
85 static const flatbuffers::TypeTable *MiniReflectTypeTable() {
86 return TableInNestedNSTypeTable();
87 }
88 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
89 VT_FOO = 4
90 };
91 int32_t foo() const {
92 return GetField<int32_t>(VT_FOO, 0);
93 }
94 bool mutate_foo(int32_t _foo) {
95 return SetField<int32_t>(VT_FOO, _foo, 0);
96 }
97 bool Verify(flatbuffers::Verifier &verifier) const {
98 return VerifyTableStart(verifier) &&
99 VerifyField<int32_t>(verifier, VT_FOO) &&
100 verifier.EndTable();
101 }
102};
103
104struct TableInNestedNSBuilder {
105 flatbuffers::FlatBufferBuilder &fbb_;
106 flatbuffers::uoffset_t start_;
107 void add_foo(int32_t foo) {
108 fbb_.AddElement<int32_t>(TableInNestedNS::VT_FOO, foo, 0);
109 }
110 explicit TableInNestedNSBuilder(flatbuffers::FlatBufferBuilder &_fbb)
111 : fbb_(_fbb) {
112 start_ = fbb_.StartTable();
113 }
114 TableInNestedNSBuilder &operator=(const TableInNestedNSBuilder &);
115 flatbuffers::Offset<TableInNestedNS> Finish() {
116 const auto end = fbb_.EndTable(start_);
117 auto o = flatbuffers::Offset<TableInNestedNS>(end);
118 return o;
119 }
120};
121
122inline flatbuffers::Offset<TableInNestedNS> CreateTableInNestedNS(
123 flatbuffers::FlatBufferBuilder &_fbb,
124 int32_t foo = 0) {
125 TableInNestedNSBuilder builder_(_fbb);
126 builder_.add_foo(foo);
127 return builder_.Finish();
128}
129
130inline const flatbuffers::TypeTable *EnumInNestedNSTypeTable() {
131 static const flatbuffers::TypeCode type_codes[] = {
132 { flatbuffers::ET_CHAR, 0, 0 },
133 { flatbuffers::ET_CHAR, 0, 0 },
134 { flatbuffers::ET_CHAR, 0, 0 }
135 };
136 static const flatbuffers::TypeFunction type_refs[] = {
137 NamespaceA::NamespaceB::EnumInNestedNSTypeTable
138 };
139 static const char * const names[] = {
140 "A",
141 "B",
142 "C"
143 };
144 static const flatbuffers::TypeTable tt = {
145 flatbuffers::ST_ENUM, 3, type_codes, type_refs, nullptr, names
146 };
147 return &tt;
148}
149
150inline const flatbuffers::TypeTable *TableInNestedNSTypeTable() {
151 static const flatbuffers::TypeCode type_codes[] = {
152 { flatbuffers::ET_INT, 0, -1 }
153 };
154 static const char * const names[] = {
155 "foo"
156 };
157 static const flatbuffers::TypeTable tt = {
158 flatbuffers::ST_TABLE, 1, type_codes, nullptr, nullptr, names
159 };
160 return &tt;
161}
162
163inline const flatbuffers::TypeTable *StructInNestedNSTypeTable() {
164 static const flatbuffers::TypeCode type_codes[] = {
165 { flatbuffers::ET_INT, 0, -1 },
166 { flatbuffers::ET_INT, 0, -1 }
167 };
168 static const int64_t values[] = { 0, 4, 8 };
169 static const char * const names[] = {
170 "a",
171 "b"
172 };
173 static const flatbuffers::TypeTable tt = {
174 flatbuffers::ST_STRUCT, 2, type_codes, nullptr, values, names
175 };
176 return &tt;
177}
178
179} // namespace NamespaceB
180} // namespace NamespaceA
181
182#endif // FLATBUFFERS_GENERATED_NAMESPACETEST1_NAMESPACEA_NAMESPACEB_H_