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