• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // automatically generated by the FlatBuffers compiler, do not modify
2 
3 
4 #ifndef FLATBUFFERS_GENERATED_REFLECTION_REFLECTION_H_
5 #define FLATBUFFERS_GENERATED_REFLECTION_REFLECTION_H_
6 
7 #include "flatbuffers/flatbuffers.h"
8 
9 namespace reflection {
10 
11 struct Type;
12 
13 struct KeyValue;
14 
15 struct EnumVal;
16 
17 struct Enum;
18 
19 struct Field;
20 
21 struct Object;
22 
23 struct Schema;
24 
25 enum BaseType {
26   None = 0,
27   UType = 1,
28   Bool = 2,
29   Byte = 3,
30   UByte = 4,
31   Short = 5,
32   UShort = 6,
33   Int = 7,
34   UInt = 8,
35   Long = 9,
36   ULong = 10,
37   Float = 11,
38   Double = 12,
39   String = 13,
40   Vector = 14,
41   Obj = 15,
42   Union = 16
43 };
44 
EnumNamesBaseType()45 inline const char **EnumNamesBaseType() {
46   static const char *names[] = {
47     "None",
48     "UType",
49     "Bool",
50     "Byte",
51     "UByte",
52     "Short",
53     "UShort",
54     "Int",
55     "UInt",
56     "Long",
57     "ULong",
58     "Float",
59     "Double",
60     "String",
61     "Vector",
62     "Obj",
63     "Union",
64     nullptr
65   };
66   return names;
67 }
68 
EnumNameBaseType(BaseType e)69 inline const char *EnumNameBaseType(BaseType e) {
70   const size_t index = static_cast<int>(e);
71   return EnumNamesBaseType()[index];
72 }
73 
74 struct Type FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
75   enum {
76     VT_BASE_TYPE = 4,
77     VT_ELEMENT = 6,
78     VT_INDEX = 8
79   };
base_typeFLATBUFFERS_FINAL_CLASS80   BaseType base_type() const {
81     return static_cast<BaseType>(GetField<int8_t>(VT_BASE_TYPE, 0));
82   }
elementFLATBUFFERS_FINAL_CLASS83   BaseType element() const {
84     return static_cast<BaseType>(GetField<int8_t>(VT_ELEMENT, 0));
85   }
indexFLATBUFFERS_FINAL_CLASS86   int32_t index() const {
87     return GetField<int32_t>(VT_INDEX, -1);
88   }
VerifyFLATBUFFERS_FINAL_CLASS89   bool Verify(flatbuffers::Verifier &verifier) const {
90     return VerifyTableStart(verifier) &&
91            VerifyField<int8_t>(verifier, VT_BASE_TYPE) &&
92            VerifyField<int8_t>(verifier, VT_ELEMENT) &&
93            VerifyField<int32_t>(verifier, VT_INDEX) &&
94            verifier.EndTable();
95   }
96 };
97 
98 struct TypeBuilder {
99   flatbuffers::FlatBufferBuilder &fbb_;
100   flatbuffers::uoffset_t start_;
add_base_typeTypeBuilder101   void add_base_type(BaseType base_type) {
102     fbb_.AddElement<int8_t>(Type::VT_BASE_TYPE, static_cast<int8_t>(base_type), 0);
103   }
add_elementTypeBuilder104   void add_element(BaseType element) {
105     fbb_.AddElement<int8_t>(Type::VT_ELEMENT, static_cast<int8_t>(element), 0);
106   }
add_indexTypeBuilder107   void add_index(int32_t index) {
108     fbb_.AddElement<int32_t>(Type::VT_INDEX, index, -1);
109   }
TypeBuilderTypeBuilder110   TypeBuilder(flatbuffers::FlatBufferBuilder &_fbb)
111         : fbb_(_fbb) {
112     start_ = fbb_.StartTable();
113   }
114   TypeBuilder &operator=(const TypeBuilder &);
FinishTypeBuilder115   flatbuffers::Offset<Type> Finish() {
116     const auto end = fbb_.EndTable(start_, 3);
117     auto o = flatbuffers::Offset<Type>(end);
118     return o;
119   }
120 };
121 
122 inline flatbuffers::Offset<Type> CreateType(
123     flatbuffers::FlatBufferBuilder &_fbb,
124     BaseType base_type = None,
125     BaseType element = None,
126     int32_t index = -1) {
127   TypeBuilder builder_(_fbb);
128   builder_.add_index(index);
129   builder_.add_element(element);
130   builder_.add_base_type(base_type);
131   return builder_.Finish();
132 }
133 
134 struct KeyValue FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
135   enum {
136     VT_KEY = 4,
137     VT_VALUE = 6
138   };
keyFLATBUFFERS_FINAL_CLASS139   const flatbuffers::String *key() const {
140     return GetPointer<const flatbuffers::String *>(VT_KEY);
141   }
KeyCompareLessThanFLATBUFFERS_FINAL_CLASS142   bool KeyCompareLessThan(const KeyValue *o) const {
143     return *key() < *o->key();
144   }
KeyCompareWithValueFLATBUFFERS_FINAL_CLASS145   int KeyCompareWithValue(const char *val) const {
146     return strcmp(key()->c_str(), val);
147   }
valueFLATBUFFERS_FINAL_CLASS148   const flatbuffers::String *value() const {
149     return GetPointer<const flatbuffers::String *>(VT_VALUE);
150   }
VerifyFLATBUFFERS_FINAL_CLASS151   bool Verify(flatbuffers::Verifier &verifier) const {
152     return VerifyTableStart(verifier) &&
153            VerifyFieldRequired<flatbuffers::uoffset_t>(verifier, VT_KEY) &&
154            verifier.Verify(key()) &&
155            VerifyField<flatbuffers::uoffset_t>(verifier, VT_VALUE) &&
156            verifier.Verify(value()) &&
157            verifier.EndTable();
158   }
159 };
160 
161 struct KeyValueBuilder {
162   flatbuffers::FlatBufferBuilder &fbb_;
163   flatbuffers::uoffset_t start_;
add_keyKeyValueBuilder164   void add_key(flatbuffers::Offset<flatbuffers::String> key) {
165     fbb_.AddOffset(KeyValue::VT_KEY, key);
166   }
add_valueKeyValueBuilder167   void add_value(flatbuffers::Offset<flatbuffers::String> value) {
168     fbb_.AddOffset(KeyValue::VT_VALUE, value);
169   }
KeyValueBuilderKeyValueBuilder170   KeyValueBuilder(flatbuffers::FlatBufferBuilder &_fbb)
171         : fbb_(_fbb) {
172     start_ = fbb_.StartTable();
173   }
174   KeyValueBuilder &operator=(const KeyValueBuilder &);
FinishKeyValueBuilder175   flatbuffers::Offset<KeyValue> Finish() {
176     const auto end = fbb_.EndTable(start_, 2);
177     auto o = flatbuffers::Offset<KeyValue>(end);
178     fbb_.Required(o, KeyValue::VT_KEY);
179     return o;
180   }
181 };
182 
183 inline flatbuffers::Offset<KeyValue> CreateKeyValue(
184     flatbuffers::FlatBufferBuilder &_fbb,
185     flatbuffers::Offset<flatbuffers::String> key = 0,
186     flatbuffers::Offset<flatbuffers::String> value = 0) {
187   KeyValueBuilder builder_(_fbb);
188   builder_.add_value(value);
189   builder_.add_key(key);
190   return builder_.Finish();
191 }
192 
193 inline flatbuffers::Offset<KeyValue> CreateKeyValueDirect(
194     flatbuffers::FlatBufferBuilder &_fbb,
195     const char *key = nullptr,
196     const char *value = nullptr) {
197   return reflection::CreateKeyValue(
198       _fbb,
199       key ? _fbb.CreateString(key) : 0,
200       value ? _fbb.CreateString(value) : 0);
201 }
202 
203 struct EnumVal FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
204   enum {
205     VT_NAME = 4,
206     VT_VALUE = 6,
207     VT_OBJECT = 8
208   };
nameFLATBUFFERS_FINAL_CLASS209   const flatbuffers::String *name() const {
210     return GetPointer<const flatbuffers::String *>(VT_NAME);
211   }
valueFLATBUFFERS_FINAL_CLASS212   int64_t value() const {
213     return GetField<int64_t>(VT_VALUE, 0);
214   }
KeyCompareLessThanFLATBUFFERS_FINAL_CLASS215   bool KeyCompareLessThan(const EnumVal *o) const {
216     return value() < o->value();
217   }
KeyCompareWithValueFLATBUFFERS_FINAL_CLASS218   int KeyCompareWithValue(int64_t val) const {
219     const auto key = value();
220     if (key < val) {
221       return -1;
222     } else if (key > val) {
223       return 1;
224     } else {
225       return 0;
226     }
227   }
objectFLATBUFFERS_FINAL_CLASS228   const Object *object() const {
229     return GetPointer<const Object *>(VT_OBJECT);
230   }
VerifyFLATBUFFERS_FINAL_CLASS231   bool Verify(flatbuffers::Verifier &verifier) const {
232     return VerifyTableStart(verifier) &&
233            VerifyFieldRequired<flatbuffers::uoffset_t>(verifier, VT_NAME) &&
234            verifier.Verify(name()) &&
235            VerifyField<int64_t>(verifier, VT_VALUE) &&
236            VerifyField<flatbuffers::uoffset_t>(verifier, VT_OBJECT) &&
237            verifier.VerifyTable(object()) &&
238            verifier.EndTable();
239   }
240 };
241 
242 struct EnumValBuilder {
243   flatbuffers::FlatBufferBuilder &fbb_;
244   flatbuffers::uoffset_t start_;
add_nameEnumValBuilder245   void add_name(flatbuffers::Offset<flatbuffers::String> name) {
246     fbb_.AddOffset(EnumVal::VT_NAME, name);
247   }
add_valueEnumValBuilder248   void add_value(int64_t value) {
249     fbb_.AddElement<int64_t>(EnumVal::VT_VALUE, value, 0);
250   }
add_objectEnumValBuilder251   void add_object(flatbuffers::Offset<Object> object) {
252     fbb_.AddOffset(EnumVal::VT_OBJECT, object);
253   }
EnumValBuilderEnumValBuilder254   EnumValBuilder(flatbuffers::FlatBufferBuilder &_fbb)
255         : fbb_(_fbb) {
256     start_ = fbb_.StartTable();
257   }
258   EnumValBuilder &operator=(const EnumValBuilder &);
FinishEnumValBuilder259   flatbuffers::Offset<EnumVal> Finish() {
260     const auto end = fbb_.EndTable(start_, 3);
261     auto o = flatbuffers::Offset<EnumVal>(end);
262     fbb_.Required(o, EnumVal::VT_NAME);
263     return o;
264   }
265 };
266 
267 inline flatbuffers::Offset<EnumVal> CreateEnumVal(
268     flatbuffers::FlatBufferBuilder &_fbb,
269     flatbuffers::Offset<flatbuffers::String> name = 0,
270     int64_t value = 0,
271     flatbuffers::Offset<Object> object = 0) {
272   EnumValBuilder builder_(_fbb);
273   builder_.add_value(value);
274   builder_.add_object(object);
275   builder_.add_name(name);
276   return builder_.Finish();
277 }
278 
279 inline flatbuffers::Offset<EnumVal> CreateEnumValDirect(
280     flatbuffers::FlatBufferBuilder &_fbb,
281     const char *name = nullptr,
282     int64_t value = 0,
283     flatbuffers::Offset<Object> object = 0) {
284   return reflection::CreateEnumVal(
285       _fbb,
286       name ? _fbb.CreateString(name) : 0,
287       value,
288       object);
289 }
290 
291 struct Enum FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
292   enum {
293     VT_NAME = 4,
294     VT_VALUES = 6,
295     VT_IS_UNION = 8,
296     VT_UNDERLYING_TYPE = 10,
297     VT_ATTRIBUTES = 12,
298     VT_DOCUMENTATION = 14
299   };
nameFLATBUFFERS_FINAL_CLASS300   const flatbuffers::String *name() const {
301     return GetPointer<const flatbuffers::String *>(VT_NAME);
302   }
KeyCompareLessThanFLATBUFFERS_FINAL_CLASS303   bool KeyCompareLessThan(const Enum *o) const {
304     return *name() < *o->name();
305   }
KeyCompareWithValueFLATBUFFERS_FINAL_CLASS306   int KeyCompareWithValue(const char *val) const {
307     return strcmp(name()->c_str(), val);
308   }
valuesFLATBUFFERS_FINAL_CLASS309   const flatbuffers::Vector<flatbuffers::Offset<EnumVal>> *values() const {
310     return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<EnumVal>> *>(VT_VALUES);
311   }
is_unionFLATBUFFERS_FINAL_CLASS312   bool is_union() const {
313     return GetField<uint8_t>(VT_IS_UNION, 0) != 0;
314   }
underlying_typeFLATBUFFERS_FINAL_CLASS315   const Type *underlying_type() const {
316     return GetPointer<const Type *>(VT_UNDERLYING_TYPE);
317   }
attributesFLATBUFFERS_FINAL_CLASS318   const flatbuffers::Vector<flatbuffers::Offset<KeyValue>> *attributes() const {
319     return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<KeyValue>> *>(VT_ATTRIBUTES);
320   }
documentationFLATBUFFERS_FINAL_CLASS321   const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *documentation() const {
322     return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *>(VT_DOCUMENTATION);
323   }
VerifyFLATBUFFERS_FINAL_CLASS324   bool Verify(flatbuffers::Verifier &verifier) const {
325     return VerifyTableStart(verifier) &&
326            VerifyFieldRequired<flatbuffers::uoffset_t>(verifier, VT_NAME) &&
327            verifier.Verify(name()) &&
328            VerifyFieldRequired<flatbuffers::uoffset_t>(verifier, VT_VALUES) &&
329            verifier.Verify(values()) &&
330            verifier.VerifyVectorOfTables(values()) &&
331            VerifyField<uint8_t>(verifier, VT_IS_UNION) &&
332            VerifyFieldRequired<flatbuffers::uoffset_t>(verifier, VT_UNDERLYING_TYPE) &&
333            verifier.VerifyTable(underlying_type()) &&
334            VerifyField<flatbuffers::uoffset_t>(verifier, VT_ATTRIBUTES) &&
335            verifier.Verify(attributes()) &&
336            verifier.VerifyVectorOfTables(attributes()) &&
337            VerifyField<flatbuffers::uoffset_t>(verifier, VT_DOCUMENTATION) &&
338            verifier.Verify(documentation()) &&
339            verifier.VerifyVectorOfStrings(documentation()) &&
340            verifier.EndTable();
341   }
342 };
343 
344 struct EnumBuilder {
345   flatbuffers::FlatBufferBuilder &fbb_;
346   flatbuffers::uoffset_t start_;
add_nameEnumBuilder347   void add_name(flatbuffers::Offset<flatbuffers::String> name) {
348     fbb_.AddOffset(Enum::VT_NAME, name);
349   }
add_valuesEnumBuilder350   void add_values(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<EnumVal>>> values) {
351     fbb_.AddOffset(Enum::VT_VALUES, values);
352   }
add_is_unionEnumBuilder353   void add_is_union(bool is_union) {
354     fbb_.AddElement<uint8_t>(Enum::VT_IS_UNION, static_cast<uint8_t>(is_union), 0);
355   }
add_underlying_typeEnumBuilder356   void add_underlying_type(flatbuffers::Offset<Type> underlying_type) {
357     fbb_.AddOffset(Enum::VT_UNDERLYING_TYPE, underlying_type);
358   }
add_attributesEnumBuilder359   void add_attributes(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<KeyValue>>> attributes) {
360     fbb_.AddOffset(Enum::VT_ATTRIBUTES, attributes);
361   }
add_documentationEnumBuilder362   void add_documentation(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> documentation) {
363     fbb_.AddOffset(Enum::VT_DOCUMENTATION, documentation);
364   }
EnumBuilderEnumBuilder365   EnumBuilder(flatbuffers::FlatBufferBuilder &_fbb)
366         : fbb_(_fbb) {
367     start_ = fbb_.StartTable();
368   }
369   EnumBuilder &operator=(const EnumBuilder &);
FinishEnumBuilder370   flatbuffers::Offset<Enum> Finish() {
371     const auto end = fbb_.EndTable(start_, 6);
372     auto o = flatbuffers::Offset<Enum>(end);
373     fbb_.Required(o, Enum::VT_NAME);
374     fbb_.Required(o, Enum::VT_VALUES);
375     fbb_.Required(o, Enum::VT_UNDERLYING_TYPE);
376     return o;
377   }
378 };
379 
380 inline flatbuffers::Offset<Enum> CreateEnum(
381     flatbuffers::FlatBufferBuilder &_fbb,
382     flatbuffers::Offset<flatbuffers::String> name = 0,
383     flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<EnumVal>>> values = 0,
384     bool is_union = false,
385     flatbuffers::Offset<Type> underlying_type = 0,
386     flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<KeyValue>>> attributes = 0,
387     flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> documentation = 0) {
388   EnumBuilder builder_(_fbb);
389   builder_.add_documentation(documentation);
390   builder_.add_attributes(attributes);
391   builder_.add_underlying_type(underlying_type);
392   builder_.add_values(values);
393   builder_.add_name(name);
394   builder_.add_is_union(is_union);
395   return builder_.Finish();
396 }
397 
398 inline flatbuffers::Offset<Enum> CreateEnumDirect(
399     flatbuffers::FlatBufferBuilder &_fbb,
400     const char *name = nullptr,
401     const std::vector<flatbuffers::Offset<EnumVal>> *values = nullptr,
402     bool is_union = false,
403     flatbuffers::Offset<Type> underlying_type = 0,
404     const std::vector<flatbuffers::Offset<KeyValue>> *attributes = nullptr,
405     const std::vector<flatbuffers::Offset<flatbuffers::String>> *documentation = nullptr) {
406   return reflection::CreateEnum(
407       _fbb,
408       name ? _fbb.CreateString(name) : 0,
409       values ? _fbb.CreateVector<flatbuffers::Offset<EnumVal>>(*values) : 0,
410       is_union,
411       underlying_type,
412       attributes ? _fbb.CreateVector<flatbuffers::Offset<KeyValue>>(*attributes) : 0,
413       documentation ? _fbb.CreateVector<flatbuffers::Offset<flatbuffers::String>>(*documentation) : 0);
414 }
415 
416 struct Field FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
417   enum {
418     VT_NAME = 4,
419     VT_TYPE = 6,
420     VT_ID = 8,
421     VT_OFFSET = 10,
422     VT_DEFAULT_INTEGER = 12,
423     VT_DEFAULT_REAL = 14,
424     VT_DEPRECATED = 16,
425     VT_REQUIRED = 18,
426     VT_KEY = 20,
427     VT_ATTRIBUTES = 22,
428     VT_DOCUMENTATION = 24
429   };
nameFLATBUFFERS_FINAL_CLASS430   const flatbuffers::String *name() const {
431     return GetPointer<const flatbuffers::String *>(VT_NAME);
432   }
KeyCompareLessThanFLATBUFFERS_FINAL_CLASS433   bool KeyCompareLessThan(const Field *o) const {
434     return *name() < *o->name();
435   }
KeyCompareWithValueFLATBUFFERS_FINAL_CLASS436   int KeyCompareWithValue(const char *val) const {
437     return strcmp(name()->c_str(), val);
438   }
typeFLATBUFFERS_FINAL_CLASS439   const Type *type() const {
440     return GetPointer<const Type *>(VT_TYPE);
441   }
idFLATBUFFERS_FINAL_CLASS442   uint16_t id() const {
443     return GetField<uint16_t>(VT_ID, 0);
444   }
offsetFLATBUFFERS_FINAL_CLASS445   uint16_t offset() const {
446     return GetField<uint16_t>(VT_OFFSET, 0);
447   }
default_integerFLATBUFFERS_FINAL_CLASS448   int64_t default_integer() const {
449     return GetField<int64_t>(VT_DEFAULT_INTEGER, 0);
450   }
default_realFLATBUFFERS_FINAL_CLASS451   double default_real() const {
452     return GetField<double>(VT_DEFAULT_REAL, 0.0);
453   }
deprecatedFLATBUFFERS_FINAL_CLASS454   bool deprecated() const {
455     return GetField<uint8_t>(VT_DEPRECATED, 0) != 0;
456   }
requiredFLATBUFFERS_FINAL_CLASS457   bool required() const {
458     return GetField<uint8_t>(VT_REQUIRED, 0) != 0;
459   }
keyFLATBUFFERS_FINAL_CLASS460   bool key() const {
461     return GetField<uint8_t>(VT_KEY, 0) != 0;
462   }
attributesFLATBUFFERS_FINAL_CLASS463   const flatbuffers::Vector<flatbuffers::Offset<KeyValue>> *attributes() const {
464     return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<KeyValue>> *>(VT_ATTRIBUTES);
465   }
documentationFLATBUFFERS_FINAL_CLASS466   const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *documentation() const {
467     return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *>(VT_DOCUMENTATION);
468   }
VerifyFLATBUFFERS_FINAL_CLASS469   bool Verify(flatbuffers::Verifier &verifier) const {
470     return VerifyTableStart(verifier) &&
471            VerifyFieldRequired<flatbuffers::uoffset_t>(verifier, VT_NAME) &&
472            verifier.Verify(name()) &&
473            VerifyFieldRequired<flatbuffers::uoffset_t>(verifier, VT_TYPE) &&
474            verifier.VerifyTable(type()) &&
475            VerifyField<uint16_t>(verifier, VT_ID) &&
476            VerifyField<uint16_t>(verifier, VT_OFFSET) &&
477            VerifyField<int64_t>(verifier, VT_DEFAULT_INTEGER) &&
478            VerifyField<double>(verifier, VT_DEFAULT_REAL) &&
479            VerifyField<uint8_t>(verifier, VT_DEPRECATED) &&
480            VerifyField<uint8_t>(verifier, VT_REQUIRED) &&
481            VerifyField<uint8_t>(verifier, VT_KEY) &&
482            VerifyField<flatbuffers::uoffset_t>(verifier, VT_ATTRIBUTES) &&
483            verifier.Verify(attributes()) &&
484            verifier.VerifyVectorOfTables(attributes()) &&
485            VerifyField<flatbuffers::uoffset_t>(verifier, VT_DOCUMENTATION) &&
486            verifier.Verify(documentation()) &&
487            verifier.VerifyVectorOfStrings(documentation()) &&
488            verifier.EndTable();
489   }
490 };
491 
492 struct FieldBuilder {
493   flatbuffers::FlatBufferBuilder &fbb_;
494   flatbuffers::uoffset_t start_;
add_nameFieldBuilder495   void add_name(flatbuffers::Offset<flatbuffers::String> name) {
496     fbb_.AddOffset(Field::VT_NAME, name);
497   }
add_typeFieldBuilder498   void add_type(flatbuffers::Offset<Type> type) {
499     fbb_.AddOffset(Field::VT_TYPE, type);
500   }
add_idFieldBuilder501   void add_id(uint16_t id) {
502     fbb_.AddElement<uint16_t>(Field::VT_ID, id, 0);
503   }
add_offsetFieldBuilder504   void add_offset(uint16_t offset) {
505     fbb_.AddElement<uint16_t>(Field::VT_OFFSET, offset, 0);
506   }
add_default_integerFieldBuilder507   void add_default_integer(int64_t default_integer) {
508     fbb_.AddElement<int64_t>(Field::VT_DEFAULT_INTEGER, default_integer, 0);
509   }
add_default_realFieldBuilder510   void add_default_real(double default_real) {
511     fbb_.AddElement<double>(Field::VT_DEFAULT_REAL, default_real, 0.0);
512   }
add_deprecatedFieldBuilder513   void add_deprecated(bool deprecated) {
514     fbb_.AddElement<uint8_t>(Field::VT_DEPRECATED, static_cast<uint8_t>(deprecated), 0);
515   }
add_requiredFieldBuilder516   void add_required(bool required) {
517     fbb_.AddElement<uint8_t>(Field::VT_REQUIRED, static_cast<uint8_t>(required), 0);
518   }
add_keyFieldBuilder519   void add_key(bool key) {
520     fbb_.AddElement<uint8_t>(Field::VT_KEY, static_cast<uint8_t>(key), 0);
521   }
add_attributesFieldBuilder522   void add_attributes(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<KeyValue>>> attributes) {
523     fbb_.AddOffset(Field::VT_ATTRIBUTES, attributes);
524   }
add_documentationFieldBuilder525   void add_documentation(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> documentation) {
526     fbb_.AddOffset(Field::VT_DOCUMENTATION, documentation);
527   }
FieldBuilderFieldBuilder528   FieldBuilder(flatbuffers::FlatBufferBuilder &_fbb)
529         : fbb_(_fbb) {
530     start_ = fbb_.StartTable();
531   }
532   FieldBuilder &operator=(const FieldBuilder &);
FinishFieldBuilder533   flatbuffers::Offset<Field> Finish() {
534     const auto end = fbb_.EndTable(start_, 11);
535     auto o = flatbuffers::Offset<Field>(end);
536     fbb_.Required(o, Field::VT_NAME);
537     fbb_.Required(o, Field::VT_TYPE);
538     return o;
539   }
540 };
541 
542 inline flatbuffers::Offset<Field> CreateField(
543     flatbuffers::FlatBufferBuilder &_fbb,
544     flatbuffers::Offset<flatbuffers::String> name = 0,
545     flatbuffers::Offset<Type> type = 0,
546     uint16_t id = 0,
547     uint16_t offset = 0,
548     int64_t default_integer = 0,
549     double default_real = 0.0,
550     bool deprecated = false,
551     bool required = false,
552     bool key = false,
553     flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<KeyValue>>> attributes = 0,
554     flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> documentation = 0) {
555   FieldBuilder builder_(_fbb);
556   builder_.add_default_real(default_real);
557   builder_.add_default_integer(default_integer);
558   builder_.add_documentation(documentation);
559   builder_.add_attributes(attributes);
560   builder_.add_type(type);
561   builder_.add_name(name);
562   builder_.add_offset(offset);
563   builder_.add_id(id);
564   builder_.add_key(key);
565   builder_.add_required(required);
566   builder_.add_deprecated(deprecated);
567   return builder_.Finish();
568 }
569 
570 inline flatbuffers::Offset<Field> CreateFieldDirect(
571     flatbuffers::FlatBufferBuilder &_fbb,
572     const char *name = nullptr,
573     flatbuffers::Offset<Type> type = 0,
574     uint16_t id = 0,
575     uint16_t offset = 0,
576     int64_t default_integer = 0,
577     double default_real = 0.0,
578     bool deprecated = false,
579     bool required = false,
580     bool key = false,
581     const std::vector<flatbuffers::Offset<KeyValue>> *attributes = nullptr,
582     const std::vector<flatbuffers::Offset<flatbuffers::String>> *documentation = nullptr) {
583   return reflection::CreateField(
584       _fbb,
585       name ? _fbb.CreateString(name) : 0,
586       type,
587       id,
588       offset,
589       default_integer,
590       default_real,
591       deprecated,
592       required,
593       key,
594       attributes ? _fbb.CreateVector<flatbuffers::Offset<KeyValue>>(*attributes) : 0,
595       documentation ? _fbb.CreateVector<flatbuffers::Offset<flatbuffers::String>>(*documentation) : 0);
596 }
597 
598 struct Object FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
599   enum {
600     VT_NAME = 4,
601     VT_FIELDS = 6,
602     VT_IS_STRUCT = 8,
603     VT_MINALIGN = 10,
604     VT_BYTESIZE = 12,
605     VT_ATTRIBUTES = 14,
606     VT_DOCUMENTATION = 16
607   };
nameFLATBUFFERS_FINAL_CLASS608   const flatbuffers::String *name() const {
609     return GetPointer<const flatbuffers::String *>(VT_NAME);
610   }
KeyCompareLessThanFLATBUFFERS_FINAL_CLASS611   bool KeyCompareLessThan(const Object *o) const {
612     return *name() < *o->name();
613   }
KeyCompareWithValueFLATBUFFERS_FINAL_CLASS614   int KeyCompareWithValue(const char *val) const {
615     return strcmp(name()->c_str(), val);
616   }
fieldsFLATBUFFERS_FINAL_CLASS617   const flatbuffers::Vector<flatbuffers::Offset<Field>> *fields() const {
618     return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<Field>> *>(VT_FIELDS);
619   }
is_structFLATBUFFERS_FINAL_CLASS620   bool is_struct() const {
621     return GetField<uint8_t>(VT_IS_STRUCT, 0) != 0;
622   }
minalignFLATBUFFERS_FINAL_CLASS623   int32_t minalign() const {
624     return GetField<int32_t>(VT_MINALIGN, 0);
625   }
bytesizeFLATBUFFERS_FINAL_CLASS626   int32_t bytesize() const {
627     return GetField<int32_t>(VT_BYTESIZE, 0);
628   }
attributesFLATBUFFERS_FINAL_CLASS629   const flatbuffers::Vector<flatbuffers::Offset<KeyValue>> *attributes() const {
630     return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<KeyValue>> *>(VT_ATTRIBUTES);
631   }
documentationFLATBUFFERS_FINAL_CLASS632   const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *documentation() const {
633     return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *>(VT_DOCUMENTATION);
634   }
VerifyFLATBUFFERS_FINAL_CLASS635   bool Verify(flatbuffers::Verifier &verifier) const {
636     return VerifyTableStart(verifier) &&
637            VerifyFieldRequired<flatbuffers::uoffset_t>(verifier, VT_NAME) &&
638            verifier.Verify(name()) &&
639            VerifyFieldRequired<flatbuffers::uoffset_t>(verifier, VT_FIELDS) &&
640            verifier.Verify(fields()) &&
641            verifier.VerifyVectorOfTables(fields()) &&
642            VerifyField<uint8_t>(verifier, VT_IS_STRUCT) &&
643            VerifyField<int32_t>(verifier, VT_MINALIGN) &&
644            VerifyField<int32_t>(verifier, VT_BYTESIZE) &&
645            VerifyField<flatbuffers::uoffset_t>(verifier, VT_ATTRIBUTES) &&
646            verifier.Verify(attributes()) &&
647            verifier.VerifyVectorOfTables(attributes()) &&
648            VerifyField<flatbuffers::uoffset_t>(verifier, VT_DOCUMENTATION) &&
649            verifier.Verify(documentation()) &&
650            verifier.VerifyVectorOfStrings(documentation()) &&
651            verifier.EndTable();
652   }
653 };
654 
655 struct ObjectBuilder {
656   flatbuffers::FlatBufferBuilder &fbb_;
657   flatbuffers::uoffset_t start_;
add_nameObjectBuilder658   void add_name(flatbuffers::Offset<flatbuffers::String> name) {
659     fbb_.AddOffset(Object::VT_NAME, name);
660   }
add_fieldsObjectBuilder661   void add_fields(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<Field>>> fields) {
662     fbb_.AddOffset(Object::VT_FIELDS, fields);
663   }
add_is_structObjectBuilder664   void add_is_struct(bool is_struct) {
665     fbb_.AddElement<uint8_t>(Object::VT_IS_STRUCT, static_cast<uint8_t>(is_struct), 0);
666   }
add_minalignObjectBuilder667   void add_minalign(int32_t minalign) {
668     fbb_.AddElement<int32_t>(Object::VT_MINALIGN, minalign, 0);
669   }
add_bytesizeObjectBuilder670   void add_bytesize(int32_t bytesize) {
671     fbb_.AddElement<int32_t>(Object::VT_BYTESIZE, bytesize, 0);
672   }
add_attributesObjectBuilder673   void add_attributes(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<KeyValue>>> attributes) {
674     fbb_.AddOffset(Object::VT_ATTRIBUTES, attributes);
675   }
add_documentationObjectBuilder676   void add_documentation(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> documentation) {
677     fbb_.AddOffset(Object::VT_DOCUMENTATION, documentation);
678   }
ObjectBuilderObjectBuilder679   ObjectBuilder(flatbuffers::FlatBufferBuilder &_fbb)
680         : fbb_(_fbb) {
681     start_ = fbb_.StartTable();
682   }
683   ObjectBuilder &operator=(const ObjectBuilder &);
FinishObjectBuilder684   flatbuffers::Offset<Object> Finish() {
685     const auto end = fbb_.EndTable(start_, 7);
686     auto o = flatbuffers::Offset<Object>(end);
687     fbb_.Required(o, Object::VT_NAME);
688     fbb_.Required(o, Object::VT_FIELDS);
689     return o;
690   }
691 };
692 
693 inline flatbuffers::Offset<Object> CreateObject(
694     flatbuffers::FlatBufferBuilder &_fbb,
695     flatbuffers::Offset<flatbuffers::String> name = 0,
696     flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<Field>>> fields = 0,
697     bool is_struct = false,
698     int32_t minalign = 0,
699     int32_t bytesize = 0,
700     flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<KeyValue>>> attributes = 0,
701     flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> documentation = 0) {
702   ObjectBuilder builder_(_fbb);
703   builder_.add_documentation(documentation);
704   builder_.add_attributes(attributes);
705   builder_.add_bytesize(bytesize);
706   builder_.add_minalign(minalign);
707   builder_.add_fields(fields);
708   builder_.add_name(name);
709   builder_.add_is_struct(is_struct);
710   return builder_.Finish();
711 }
712 
713 inline flatbuffers::Offset<Object> CreateObjectDirect(
714     flatbuffers::FlatBufferBuilder &_fbb,
715     const char *name = nullptr,
716     const std::vector<flatbuffers::Offset<Field>> *fields = nullptr,
717     bool is_struct = false,
718     int32_t minalign = 0,
719     int32_t bytesize = 0,
720     const std::vector<flatbuffers::Offset<KeyValue>> *attributes = nullptr,
721     const std::vector<flatbuffers::Offset<flatbuffers::String>> *documentation = nullptr) {
722   return reflection::CreateObject(
723       _fbb,
724       name ? _fbb.CreateString(name) : 0,
725       fields ? _fbb.CreateVector<flatbuffers::Offset<Field>>(*fields) : 0,
726       is_struct,
727       minalign,
728       bytesize,
729       attributes ? _fbb.CreateVector<flatbuffers::Offset<KeyValue>>(*attributes) : 0,
730       documentation ? _fbb.CreateVector<flatbuffers::Offset<flatbuffers::String>>(*documentation) : 0);
731 }
732 
733 struct Schema FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
734   enum {
735     VT_OBJECTS = 4,
736     VT_ENUMS = 6,
737     VT_FILE_IDENT = 8,
738     VT_FILE_EXT = 10,
739     VT_ROOT_TABLE = 12
740   };
objectsFLATBUFFERS_FINAL_CLASS741   const flatbuffers::Vector<flatbuffers::Offset<Object>> *objects() const {
742     return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<Object>> *>(VT_OBJECTS);
743   }
enumsFLATBUFFERS_FINAL_CLASS744   const flatbuffers::Vector<flatbuffers::Offset<Enum>> *enums() const {
745     return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<Enum>> *>(VT_ENUMS);
746   }
file_identFLATBUFFERS_FINAL_CLASS747   const flatbuffers::String *file_ident() const {
748     return GetPointer<const flatbuffers::String *>(VT_FILE_IDENT);
749   }
file_extFLATBUFFERS_FINAL_CLASS750   const flatbuffers::String *file_ext() const {
751     return GetPointer<const flatbuffers::String *>(VT_FILE_EXT);
752   }
root_tableFLATBUFFERS_FINAL_CLASS753   const Object *root_table() const {
754     return GetPointer<const Object *>(VT_ROOT_TABLE);
755   }
VerifyFLATBUFFERS_FINAL_CLASS756   bool Verify(flatbuffers::Verifier &verifier) const {
757     return VerifyTableStart(verifier) &&
758            VerifyFieldRequired<flatbuffers::uoffset_t>(verifier, VT_OBJECTS) &&
759            verifier.Verify(objects()) &&
760            verifier.VerifyVectorOfTables(objects()) &&
761            VerifyFieldRequired<flatbuffers::uoffset_t>(verifier, VT_ENUMS) &&
762            verifier.Verify(enums()) &&
763            verifier.VerifyVectorOfTables(enums()) &&
764            VerifyField<flatbuffers::uoffset_t>(verifier, VT_FILE_IDENT) &&
765            verifier.Verify(file_ident()) &&
766            VerifyField<flatbuffers::uoffset_t>(verifier, VT_FILE_EXT) &&
767            verifier.Verify(file_ext()) &&
768            VerifyField<flatbuffers::uoffset_t>(verifier, VT_ROOT_TABLE) &&
769            verifier.VerifyTable(root_table()) &&
770            verifier.EndTable();
771   }
772 };
773 
774 struct SchemaBuilder {
775   flatbuffers::FlatBufferBuilder &fbb_;
776   flatbuffers::uoffset_t start_;
add_objectsSchemaBuilder777   void add_objects(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<Object>>> objects) {
778     fbb_.AddOffset(Schema::VT_OBJECTS, objects);
779   }
add_enumsSchemaBuilder780   void add_enums(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<Enum>>> enums) {
781     fbb_.AddOffset(Schema::VT_ENUMS, enums);
782   }
add_file_identSchemaBuilder783   void add_file_ident(flatbuffers::Offset<flatbuffers::String> file_ident) {
784     fbb_.AddOffset(Schema::VT_FILE_IDENT, file_ident);
785   }
add_file_extSchemaBuilder786   void add_file_ext(flatbuffers::Offset<flatbuffers::String> file_ext) {
787     fbb_.AddOffset(Schema::VT_FILE_EXT, file_ext);
788   }
add_root_tableSchemaBuilder789   void add_root_table(flatbuffers::Offset<Object> root_table) {
790     fbb_.AddOffset(Schema::VT_ROOT_TABLE, root_table);
791   }
SchemaBuilderSchemaBuilder792   SchemaBuilder(flatbuffers::FlatBufferBuilder &_fbb)
793         : fbb_(_fbb) {
794     start_ = fbb_.StartTable();
795   }
796   SchemaBuilder &operator=(const SchemaBuilder &);
FinishSchemaBuilder797   flatbuffers::Offset<Schema> Finish() {
798     const auto end = fbb_.EndTable(start_, 5);
799     auto o = flatbuffers::Offset<Schema>(end);
800     fbb_.Required(o, Schema::VT_OBJECTS);
801     fbb_.Required(o, Schema::VT_ENUMS);
802     return o;
803   }
804 };
805 
806 inline flatbuffers::Offset<Schema> CreateSchema(
807     flatbuffers::FlatBufferBuilder &_fbb,
808     flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<Object>>> objects = 0,
809     flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<Enum>>> enums = 0,
810     flatbuffers::Offset<flatbuffers::String> file_ident = 0,
811     flatbuffers::Offset<flatbuffers::String> file_ext = 0,
812     flatbuffers::Offset<Object> root_table = 0) {
813   SchemaBuilder builder_(_fbb);
814   builder_.add_root_table(root_table);
815   builder_.add_file_ext(file_ext);
816   builder_.add_file_ident(file_ident);
817   builder_.add_enums(enums);
818   builder_.add_objects(objects);
819   return builder_.Finish();
820 }
821 
822 inline flatbuffers::Offset<Schema> CreateSchemaDirect(
823     flatbuffers::FlatBufferBuilder &_fbb,
824     const std::vector<flatbuffers::Offset<Object>> *objects = nullptr,
825     const std::vector<flatbuffers::Offset<Enum>> *enums = nullptr,
826     const char *file_ident = nullptr,
827     const char *file_ext = nullptr,
828     flatbuffers::Offset<Object> root_table = 0) {
829   return reflection::CreateSchema(
830       _fbb,
831       objects ? _fbb.CreateVector<flatbuffers::Offset<Object>>(*objects) : 0,
832       enums ? _fbb.CreateVector<flatbuffers::Offset<Enum>>(*enums) : 0,
833       file_ident ? _fbb.CreateString(file_ident) : 0,
834       file_ext ? _fbb.CreateString(file_ext) : 0,
835       root_table);
836 }
837 
GetSchema(const void * buf)838 inline const reflection::Schema *GetSchema(const void *buf) {
839   return flatbuffers::GetRoot<reflection::Schema>(buf);
840 }
841 
SchemaIdentifier()842 inline const char *SchemaIdentifier() {
843   return "BFBS";
844 }
845 
SchemaBufferHasIdentifier(const void * buf)846 inline bool SchemaBufferHasIdentifier(const void *buf) {
847   return flatbuffers::BufferHasIdentifier(
848       buf, SchemaIdentifier());
849 }
850 
VerifySchemaBuffer(flatbuffers::Verifier & verifier)851 inline bool VerifySchemaBuffer(
852     flatbuffers::Verifier &verifier) {
853   return verifier.VerifyBuffer<reflection::Schema>(SchemaIdentifier());
854 }
855 
SchemaExtension()856 inline const char *SchemaExtension() {
857   return "bfbs";
858 }
859 
FinishSchemaBuffer(flatbuffers::FlatBufferBuilder & fbb,flatbuffers::Offset<reflection::Schema> root)860 inline void FinishSchemaBuffer(
861     flatbuffers::FlatBufferBuilder &fbb,
862     flatbuffers::Offset<reflection::Schema> root) {
863   fbb.Finish(root, SchemaIdentifier());
864 }
865 
866 }  // namespace reflection
867 
868 #endif  // FLATBUFFERS_GENERATED_REFLECTION_REFLECTION_H_
869