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