blob: dcb0f7e05e656e20d1a5664491f8bc54178ec7fc [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_REFLECTION_REFLECTION_H_
5#define FLATBUFFERS_GENERATED_REFLECTION_REFLECTION_H_
6
7#include "flatbuffers/flatbuffers.h"
8
9namespace reflection {
10
11struct Type;
Austin Schuh272c6132020-11-14 16:37:52 -080012struct TypeBuilder;
Austin Schuhe89fa2d2019-08-14 20:24:23 -070013
14struct KeyValue;
Austin Schuh272c6132020-11-14 16:37:52 -080015struct KeyValueBuilder;
Austin Schuhe89fa2d2019-08-14 20:24:23 -070016
17struct EnumVal;
Austin Schuh272c6132020-11-14 16:37:52 -080018struct EnumValBuilder;
Austin Schuhe89fa2d2019-08-14 20:24:23 -070019
20struct Enum;
Austin Schuh272c6132020-11-14 16:37:52 -080021struct EnumBuilder;
Austin Schuhe89fa2d2019-08-14 20:24:23 -070022
23struct Field;
Austin Schuh272c6132020-11-14 16:37:52 -080024struct FieldBuilder;
Austin Schuhe89fa2d2019-08-14 20:24:23 -070025
26struct Object;
Austin Schuh272c6132020-11-14 16:37:52 -080027struct ObjectBuilder;
Austin Schuhe89fa2d2019-08-14 20:24:23 -070028
29struct RPCCall;
Austin Schuh272c6132020-11-14 16:37:52 -080030struct RPCCallBuilder;
Austin Schuhe89fa2d2019-08-14 20:24:23 -070031
32struct Service;
Austin Schuh272c6132020-11-14 16:37:52 -080033struct ServiceBuilder;
Austin Schuhe89fa2d2019-08-14 20:24:23 -070034
James Kuszmaul8e62b022022-03-22 09:33:25 -070035struct SchemaFile;
36struct SchemaFileBuilder;
37
Austin Schuhe89fa2d2019-08-14 20:24:23 -070038struct Schema;
Austin Schuh272c6132020-11-14 16:37:52 -080039struct SchemaBuilder;
Austin Schuhe89fa2d2019-08-14 20:24:23 -070040
41enum BaseType {
42 None = 0,
43 UType = 1,
44 Bool = 2,
45 Byte = 3,
46 UByte = 4,
47 Short = 5,
48 UShort = 6,
49 Int = 7,
50 UInt = 8,
51 Long = 9,
52 ULong = 10,
53 Float = 11,
54 Double = 12,
55 String = 13,
56 Vector = 14,
57 Obj = 15,
58 Union = 16,
Austin Schuh272c6132020-11-14 16:37:52 -080059 Array = 17,
60 MaxBaseType = 18
Austin Schuhe89fa2d2019-08-14 20:24:23 -070061};
62
Austin Schuh272c6132020-11-14 16:37:52 -080063inline const BaseType (&EnumValuesBaseType())[19] {
Austin Schuhe89fa2d2019-08-14 20:24:23 -070064 static const BaseType values[] = {
65 None,
66 UType,
67 Bool,
68 Byte,
69 UByte,
70 Short,
71 UShort,
72 Int,
73 UInt,
74 Long,
75 ULong,
76 Float,
77 Double,
78 String,
79 Vector,
80 Obj,
81 Union,
Austin Schuh272c6132020-11-14 16:37:52 -080082 Array,
83 MaxBaseType
Austin Schuhe89fa2d2019-08-14 20:24:23 -070084 };
85 return values;
86}
87
88inline const char * const *EnumNamesBaseType() {
Austin Schuh272c6132020-11-14 16:37:52 -080089 static const char * const names[20] = {
Austin Schuhe89fa2d2019-08-14 20:24:23 -070090 "None",
91 "UType",
92 "Bool",
93 "Byte",
94 "UByte",
95 "Short",
96 "UShort",
97 "Int",
98 "UInt",
99 "Long",
100 "ULong",
101 "Float",
102 "Double",
103 "String",
104 "Vector",
105 "Obj",
106 "Union",
107 "Array",
Austin Schuh272c6132020-11-14 16:37:52 -0800108 "MaxBaseType",
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700109 nullptr
110 };
111 return names;
112}
113
114inline const char *EnumNameBaseType(BaseType e) {
Austin Schuh272c6132020-11-14 16:37:52 -0800115 if (flatbuffers::IsOutRange(e, None, MaxBaseType)) return "";
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700116 const size_t index = static_cast<size_t>(e);
117 return EnumNamesBaseType()[index];
118}
119
James Kuszmaul8e62b022022-03-22 09:33:25 -0700120/// New schema language features that are not supported by old code generators.
121enum AdvancedFeatures {
122 AdvancedArrayFeatures = 1ULL,
123 AdvancedUnionFeatures = 2ULL,
124 OptionalScalars = 4ULL,
125 DefaultVectorsAndStrings = 8ULL
126};
127
128inline const AdvancedFeatures (&EnumValuesAdvancedFeatures())[4] {
129 static const AdvancedFeatures values[] = {
130 AdvancedArrayFeatures,
131 AdvancedUnionFeatures,
132 OptionalScalars,
133 DefaultVectorsAndStrings
134 };
135 return values;
136}
137
138inline const char * const *EnumNamesAdvancedFeatures() {
139 static const char * const names[9] = {
140 "AdvancedArrayFeatures",
141 "AdvancedUnionFeatures",
142 "",
143 "OptionalScalars",
144 "",
145 "",
146 "",
147 "DefaultVectorsAndStrings",
148 nullptr
149 };
150 return names;
151}
152
153inline const char *EnumNameAdvancedFeatures(AdvancedFeatures e) {
154 if (flatbuffers::IsOutRange(e, AdvancedArrayFeatures, DefaultVectorsAndStrings)) return "";
155 const size_t index = static_cast<size_t>(e) - static_cast<size_t>(AdvancedArrayFeatures);
156 return EnumNamesAdvancedFeatures()[index];
157}
158
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700159struct Type FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
Austin Schuh272c6132020-11-14 16:37:52 -0800160 typedef TypeBuilder Builder;
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700161 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
162 VT_BASE_TYPE = 4,
163 VT_ELEMENT = 6,
164 VT_INDEX = 8,
James Kuszmaul8e62b022022-03-22 09:33:25 -0700165 VT_FIXED_LENGTH = 10,
166 VT_BASE_SIZE = 12,
167 VT_ELEMENT_SIZE = 14
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700168 };
169 reflection::BaseType base_type() const {
170 return static_cast<reflection::BaseType>(GetField<int8_t>(VT_BASE_TYPE, 0));
171 }
172 reflection::BaseType element() const {
173 return static_cast<reflection::BaseType>(GetField<int8_t>(VT_ELEMENT, 0));
174 }
175 int32_t index() const {
176 return GetField<int32_t>(VT_INDEX, -1);
177 }
178 uint16_t fixed_length() const {
179 return GetField<uint16_t>(VT_FIXED_LENGTH, 0);
180 }
James Kuszmaul8e62b022022-03-22 09:33:25 -0700181 /// The size (octets) of the `base_type` field.
182 uint32_t base_size() const {
183 return GetField<uint32_t>(VT_BASE_SIZE, 4);
184 }
185 /// The size (octets) of the `element` field, if present.
186 uint32_t element_size() const {
187 return GetField<uint32_t>(VT_ELEMENT_SIZE, 0);
188 }
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700189 bool Verify(flatbuffers::Verifier &verifier) const {
190 return VerifyTableStart(verifier) &&
James Kuszmaul8e62b022022-03-22 09:33:25 -0700191 VerifyField<int8_t>(verifier, VT_BASE_TYPE, 1) &&
192 VerifyField<int8_t>(verifier, VT_ELEMENT, 1) &&
193 VerifyField<int32_t>(verifier, VT_INDEX, 4) &&
194 VerifyField<uint16_t>(verifier, VT_FIXED_LENGTH, 2) &&
195 VerifyField<uint32_t>(verifier, VT_BASE_SIZE, 4) &&
196 VerifyField<uint32_t>(verifier, VT_ELEMENT_SIZE, 4) &&
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700197 verifier.EndTable();
198 }
199};
200
201struct TypeBuilder {
Austin Schuh272c6132020-11-14 16:37:52 -0800202 typedef Type Table;
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700203 flatbuffers::FlatBufferBuilder &fbb_;
204 flatbuffers::uoffset_t start_;
205 void add_base_type(reflection::BaseType base_type) {
206 fbb_.AddElement<int8_t>(Type::VT_BASE_TYPE, static_cast<int8_t>(base_type), 0);
207 }
208 void add_element(reflection::BaseType element) {
209 fbb_.AddElement<int8_t>(Type::VT_ELEMENT, static_cast<int8_t>(element), 0);
210 }
211 void add_index(int32_t index) {
212 fbb_.AddElement<int32_t>(Type::VT_INDEX, index, -1);
213 }
214 void add_fixed_length(uint16_t fixed_length) {
215 fbb_.AddElement<uint16_t>(Type::VT_FIXED_LENGTH, fixed_length, 0);
216 }
James Kuszmaul8e62b022022-03-22 09:33:25 -0700217 void add_base_size(uint32_t base_size) {
218 fbb_.AddElement<uint32_t>(Type::VT_BASE_SIZE, base_size, 4);
219 }
220 void add_element_size(uint32_t element_size) {
221 fbb_.AddElement<uint32_t>(Type::VT_ELEMENT_SIZE, element_size, 0);
222 }
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700223 explicit TypeBuilder(flatbuffers::FlatBufferBuilder &_fbb)
224 : fbb_(_fbb) {
225 start_ = fbb_.StartTable();
226 }
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700227 flatbuffers::Offset<Type> Finish() {
228 const auto end = fbb_.EndTable(start_);
229 auto o = flatbuffers::Offset<Type>(end);
230 return o;
231 }
232};
233
234inline flatbuffers::Offset<Type> CreateType(
235 flatbuffers::FlatBufferBuilder &_fbb,
236 reflection::BaseType base_type = reflection::None,
237 reflection::BaseType element = reflection::None,
238 int32_t index = -1,
James Kuszmaul8e62b022022-03-22 09:33:25 -0700239 uint16_t fixed_length = 0,
240 uint32_t base_size = 4,
241 uint32_t element_size = 0) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700242 TypeBuilder builder_(_fbb);
James Kuszmaul8e62b022022-03-22 09:33:25 -0700243 builder_.add_element_size(element_size);
244 builder_.add_base_size(base_size);
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700245 builder_.add_index(index);
246 builder_.add_fixed_length(fixed_length);
247 builder_.add_element(element);
248 builder_.add_base_type(base_type);
249 return builder_.Finish();
250}
251
252struct KeyValue FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
Austin Schuh272c6132020-11-14 16:37:52 -0800253 typedef KeyValueBuilder Builder;
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700254 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
255 VT_KEY = 4,
256 VT_VALUE = 6
257 };
258 const flatbuffers::String *key() const {
259 return GetPointer<const flatbuffers::String *>(VT_KEY);
260 }
261 bool KeyCompareLessThan(const KeyValue *o) const {
262 return *key() < *o->key();
263 }
James Kuszmaul8e62b022022-03-22 09:33:25 -0700264 int KeyCompareWithValue(const char *_key) const {
265 return strcmp(key()->c_str(), _key);
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700266 }
267 const flatbuffers::String *value() const {
268 return GetPointer<const flatbuffers::String *>(VT_VALUE);
269 }
270 bool Verify(flatbuffers::Verifier &verifier) const {
271 return VerifyTableStart(verifier) &&
272 VerifyOffsetRequired(verifier, VT_KEY) &&
273 verifier.VerifyString(key()) &&
274 VerifyOffset(verifier, VT_VALUE) &&
275 verifier.VerifyString(value()) &&
276 verifier.EndTable();
277 }
278};
279
280struct KeyValueBuilder {
Austin Schuh272c6132020-11-14 16:37:52 -0800281 typedef KeyValue Table;
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700282 flatbuffers::FlatBufferBuilder &fbb_;
283 flatbuffers::uoffset_t start_;
284 void add_key(flatbuffers::Offset<flatbuffers::String> key) {
285 fbb_.AddOffset(KeyValue::VT_KEY, key);
286 }
287 void add_value(flatbuffers::Offset<flatbuffers::String> value) {
288 fbb_.AddOffset(KeyValue::VT_VALUE, value);
289 }
290 explicit KeyValueBuilder(flatbuffers::FlatBufferBuilder &_fbb)
291 : fbb_(_fbb) {
292 start_ = fbb_.StartTable();
293 }
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700294 flatbuffers::Offset<KeyValue> Finish() {
295 const auto end = fbb_.EndTable(start_);
296 auto o = flatbuffers::Offset<KeyValue>(end);
297 fbb_.Required(o, KeyValue::VT_KEY);
298 return o;
299 }
300};
301
302inline flatbuffers::Offset<KeyValue> CreateKeyValue(
303 flatbuffers::FlatBufferBuilder &_fbb,
304 flatbuffers::Offset<flatbuffers::String> key = 0,
305 flatbuffers::Offset<flatbuffers::String> value = 0) {
306 KeyValueBuilder builder_(_fbb);
307 builder_.add_value(value);
308 builder_.add_key(key);
309 return builder_.Finish();
310}
311
312inline flatbuffers::Offset<KeyValue> CreateKeyValueDirect(
313 flatbuffers::FlatBufferBuilder &_fbb,
314 const char *key = nullptr,
315 const char *value = nullptr) {
316 auto key__ = key ? _fbb.CreateString(key) : 0;
317 auto value__ = value ? _fbb.CreateString(value) : 0;
318 return reflection::CreateKeyValue(
319 _fbb,
320 key__,
321 value__);
322}
323
324struct EnumVal FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
Austin Schuh272c6132020-11-14 16:37:52 -0800325 typedef EnumValBuilder Builder;
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700326 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
327 VT_NAME = 4,
328 VT_VALUE = 6,
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700329 VT_UNION_TYPE = 10,
330 VT_DOCUMENTATION = 12
331 };
332 const flatbuffers::String *name() const {
333 return GetPointer<const flatbuffers::String *>(VT_NAME);
334 }
335 int64_t value() const {
336 return GetField<int64_t>(VT_VALUE, 0);
337 }
338 bool KeyCompareLessThan(const EnumVal *o) const {
339 return value() < o->value();
340 }
James Kuszmaul8e62b022022-03-22 09:33:25 -0700341 int KeyCompareWithValue(int64_t _value) const {
342 return static_cast<int>(value() > _value) - static_cast<int>(value() < _value);
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700343 }
344 const reflection::Type *union_type() const {
345 return GetPointer<const reflection::Type *>(VT_UNION_TYPE);
346 }
347 const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *documentation() const {
348 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *>(VT_DOCUMENTATION);
349 }
350 bool Verify(flatbuffers::Verifier &verifier) const {
351 return VerifyTableStart(verifier) &&
352 VerifyOffsetRequired(verifier, VT_NAME) &&
353 verifier.VerifyString(name()) &&
James Kuszmaul8e62b022022-03-22 09:33:25 -0700354 VerifyField<int64_t>(verifier, VT_VALUE, 8) &&
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700355 VerifyOffset(verifier, VT_UNION_TYPE) &&
356 verifier.VerifyTable(union_type()) &&
357 VerifyOffset(verifier, VT_DOCUMENTATION) &&
358 verifier.VerifyVector(documentation()) &&
359 verifier.VerifyVectorOfStrings(documentation()) &&
360 verifier.EndTable();
361 }
362};
363
364struct EnumValBuilder {
Austin Schuh272c6132020-11-14 16:37:52 -0800365 typedef EnumVal Table;
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700366 flatbuffers::FlatBufferBuilder &fbb_;
367 flatbuffers::uoffset_t start_;
368 void add_name(flatbuffers::Offset<flatbuffers::String> name) {
369 fbb_.AddOffset(EnumVal::VT_NAME, name);
370 }
371 void add_value(int64_t value) {
372 fbb_.AddElement<int64_t>(EnumVal::VT_VALUE, value, 0);
373 }
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700374 void add_union_type(flatbuffers::Offset<reflection::Type> union_type) {
375 fbb_.AddOffset(EnumVal::VT_UNION_TYPE, union_type);
376 }
377 void add_documentation(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> documentation) {
378 fbb_.AddOffset(EnumVal::VT_DOCUMENTATION, documentation);
379 }
380 explicit EnumValBuilder(flatbuffers::FlatBufferBuilder &_fbb)
381 : fbb_(_fbb) {
382 start_ = fbb_.StartTable();
383 }
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700384 flatbuffers::Offset<EnumVal> Finish() {
385 const auto end = fbb_.EndTable(start_);
386 auto o = flatbuffers::Offset<EnumVal>(end);
387 fbb_.Required(o, EnumVal::VT_NAME);
388 return o;
389 }
390};
391
392inline flatbuffers::Offset<EnumVal> CreateEnumVal(
393 flatbuffers::FlatBufferBuilder &_fbb,
394 flatbuffers::Offset<flatbuffers::String> name = 0,
395 int64_t value = 0,
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700396 flatbuffers::Offset<reflection::Type> union_type = 0,
397 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> documentation = 0) {
398 EnumValBuilder builder_(_fbb);
399 builder_.add_value(value);
400 builder_.add_documentation(documentation);
401 builder_.add_union_type(union_type);
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700402 builder_.add_name(name);
403 return builder_.Finish();
404}
405
406inline flatbuffers::Offset<EnumVal> CreateEnumValDirect(
407 flatbuffers::FlatBufferBuilder &_fbb,
408 const char *name = nullptr,
409 int64_t value = 0,
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700410 flatbuffers::Offset<reflection::Type> union_type = 0,
411 const std::vector<flatbuffers::Offset<flatbuffers::String>> *documentation = nullptr) {
412 auto name__ = name ? _fbb.CreateString(name) : 0;
413 auto documentation__ = documentation ? _fbb.CreateVector<flatbuffers::Offset<flatbuffers::String>>(*documentation) : 0;
414 return reflection::CreateEnumVal(
415 _fbb,
416 name__,
417 value,
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700418 union_type,
419 documentation__);
420}
421
422struct Enum FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
Austin Schuh272c6132020-11-14 16:37:52 -0800423 typedef EnumBuilder Builder;
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700424 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
425 VT_NAME = 4,
426 VT_VALUES = 6,
427 VT_IS_UNION = 8,
428 VT_UNDERLYING_TYPE = 10,
429 VT_ATTRIBUTES = 12,
James Kuszmaul8e62b022022-03-22 09:33:25 -0700430 VT_DOCUMENTATION = 14,
431 VT_DECLARATION_FILE = 16
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700432 };
433 const flatbuffers::String *name() const {
434 return GetPointer<const flatbuffers::String *>(VT_NAME);
435 }
436 bool KeyCompareLessThan(const Enum *o) const {
437 return *name() < *o->name();
438 }
James Kuszmaul8e62b022022-03-22 09:33:25 -0700439 int KeyCompareWithValue(const char *_name) const {
440 return strcmp(name()->c_str(), _name);
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700441 }
442 const flatbuffers::Vector<flatbuffers::Offset<reflection::EnumVal>> *values() const {
443 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<reflection::EnumVal>> *>(VT_VALUES);
444 }
445 bool is_union() const {
446 return GetField<uint8_t>(VT_IS_UNION, 0) != 0;
447 }
448 const reflection::Type *underlying_type() const {
449 return GetPointer<const reflection::Type *>(VT_UNDERLYING_TYPE);
450 }
451 const flatbuffers::Vector<flatbuffers::Offset<reflection::KeyValue>> *attributes() const {
452 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<reflection::KeyValue>> *>(VT_ATTRIBUTES);
453 }
454 const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *documentation() const {
455 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *>(VT_DOCUMENTATION);
456 }
James Kuszmaul8e62b022022-03-22 09:33:25 -0700457 /// File that this Enum is declared in.
458 const flatbuffers::String *declaration_file() const {
459 return GetPointer<const flatbuffers::String *>(VT_DECLARATION_FILE);
460 }
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700461 bool Verify(flatbuffers::Verifier &verifier) const {
462 return VerifyTableStart(verifier) &&
463 VerifyOffsetRequired(verifier, VT_NAME) &&
464 verifier.VerifyString(name()) &&
465 VerifyOffsetRequired(verifier, VT_VALUES) &&
466 verifier.VerifyVector(values()) &&
467 verifier.VerifyVectorOfTables(values()) &&
James Kuszmaul8e62b022022-03-22 09:33:25 -0700468 VerifyField<uint8_t>(verifier, VT_IS_UNION, 1) &&
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700469 VerifyOffsetRequired(verifier, VT_UNDERLYING_TYPE) &&
470 verifier.VerifyTable(underlying_type()) &&
471 VerifyOffset(verifier, VT_ATTRIBUTES) &&
472 verifier.VerifyVector(attributes()) &&
473 verifier.VerifyVectorOfTables(attributes()) &&
474 VerifyOffset(verifier, VT_DOCUMENTATION) &&
475 verifier.VerifyVector(documentation()) &&
476 verifier.VerifyVectorOfStrings(documentation()) &&
James Kuszmaul8e62b022022-03-22 09:33:25 -0700477 VerifyOffset(verifier, VT_DECLARATION_FILE) &&
478 verifier.VerifyString(declaration_file()) &&
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700479 verifier.EndTable();
480 }
481};
482
483struct EnumBuilder {
Austin Schuh272c6132020-11-14 16:37:52 -0800484 typedef Enum Table;
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700485 flatbuffers::FlatBufferBuilder &fbb_;
486 flatbuffers::uoffset_t start_;
487 void add_name(flatbuffers::Offset<flatbuffers::String> name) {
488 fbb_.AddOffset(Enum::VT_NAME, name);
489 }
490 void add_values(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<reflection::EnumVal>>> values) {
491 fbb_.AddOffset(Enum::VT_VALUES, values);
492 }
493 void add_is_union(bool is_union) {
494 fbb_.AddElement<uint8_t>(Enum::VT_IS_UNION, static_cast<uint8_t>(is_union), 0);
495 }
496 void add_underlying_type(flatbuffers::Offset<reflection::Type> underlying_type) {
497 fbb_.AddOffset(Enum::VT_UNDERLYING_TYPE, underlying_type);
498 }
499 void add_attributes(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<reflection::KeyValue>>> attributes) {
500 fbb_.AddOffset(Enum::VT_ATTRIBUTES, attributes);
501 }
502 void add_documentation(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> documentation) {
503 fbb_.AddOffset(Enum::VT_DOCUMENTATION, documentation);
504 }
James Kuszmaul8e62b022022-03-22 09:33:25 -0700505 void add_declaration_file(flatbuffers::Offset<flatbuffers::String> declaration_file) {
506 fbb_.AddOffset(Enum::VT_DECLARATION_FILE, declaration_file);
507 }
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700508 explicit EnumBuilder(flatbuffers::FlatBufferBuilder &_fbb)
509 : fbb_(_fbb) {
510 start_ = fbb_.StartTable();
511 }
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700512 flatbuffers::Offset<Enum> Finish() {
513 const auto end = fbb_.EndTable(start_);
514 auto o = flatbuffers::Offset<Enum>(end);
515 fbb_.Required(o, Enum::VT_NAME);
516 fbb_.Required(o, Enum::VT_VALUES);
517 fbb_.Required(o, Enum::VT_UNDERLYING_TYPE);
518 return o;
519 }
520};
521
522inline flatbuffers::Offset<Enum> CreateEnum(
523 flatbuffers::FlatBufferBuilder &_fbb,
524 flatbuffers::Offset<flatbuffers::String> name = 0,
525 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<reflection::EnumVal>>> values = 0,
526 bool is_union = false,
527 flatbuffers::Offset<reflection::Type> underlying_type = 0,
528 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<reflection::KeyValue>>> attributes = 0,
James Kuszmaul8e62b022022-03-22 09:33:25 -0700529 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> documentation = 0,
530 flatbuffers::Offset<flatbuffers::String> declaration_file = 0) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700531 EnumBuilder builder_(_fbb);
James Kuszmaul8e62b022022-03-22 09:33:25 -0700532 builder_.add_declaration_file(declaration_file);
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700533 builder_.add_documentation(documentation);
534 builder_.add_attributes(attributes);
535 builder_.add_underlying_type(underlying_type);
536 builder_.add_values(values);
537 builder_.add_name(name);
538 builder_.add_is_union(is_union);
539 return builder_.Finish();
540}
541
542inline flatbuffers::Offset<Enum> CreateEnumDirect(
543 flatbuffers::FlatBufferBuilder &_fbb,
544 const char *name = nullptr,
Austin Schuh272c6132020-11-14 16:37:52 -0800545 std::vector<flatbuffers::Offset<reflection::EnumVal>> *values = nullptr,
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700546 bool is_union = false,
547 flatbuffers::Offset<reflection::Type> underlying_type = 0,
Austin Schuh272c6132020-11-14 16:37:52 -0800548 std::vector<flatbuffers::Offset<reflection::KeyValue>> *attributes = nullptr,
James Kuszmaul8e62b022022-03-22 09:33:25 -0700549 const std::vector<flatbuffers::Offset<flatbuffers::String>> *documentation = nullptr,
550 const char *declaration_file = nullptr) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700551 auto name__ = name ? _fbb.CreateString(name) : 0;
Austin Schuh272c6132020-11-14 16:37:52 -0800552 auto values__ = values ? _fbb.CreateVectorOfSortedTables<reflection::EnumVal>(values) : 0;
553 auto attributes__ = attributes ? _fbb.CreateVectorOfSortedTables<reflection::KeyValue>(attributes) : 0;
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700554 auto documentation__ = documentation ? _fbb.CreateVector<flatbuffers::Offset<flatbuffers::String>>(*documentation) : 0;
James Kuszmaul8e62b022022-03-22 09:33:25 -0700555 auto declaration_file__ = declaration_file ? _fbb.CreateString(declaration_file) : 0;
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700556 return reflection::CreateEnum(
557 _fbb,
558 name__,
559 values__,
560 is_union,
561 underlying_type,
562 attributes__,
James Kuszmaul8e62b022022-03-22 09:33:25 -0700563 documentation__,
564 declaration_file__);
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700565}
566
567struct Field FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
Austin Schuh272c6132020-11-14 16:37:52 -0800568 typedef FieldBuilder Builder;
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700569 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
570 VT_NAME = 4,
571 VT_TYPE = 6,
572 VT_ID = 8,
573 VT_OFFSET = 10,
574 VT_DEFAULT_INTEGER = 12,
575 VT_DEFAULT_REAL = 14,
576 VT_DEPRECATED = 16,
577 VT_REQUIRED = 18,
578 VT_KEY = 20,
579 VT_ATTRIBUTES = 22,
Austin Schuh272c6132020-11-14 16:37:52 -0800580 VT_DOCUMENTATION = 24,
James Kuszmaul8e62b022022-03-22 09:33:25 -0700581 VT_OPTIONAL = 26,
582 VT_PADDING = 28
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700583 };
584 const flatbuffers::String *name() const {
585 return GetPointer<const flatbuffers::String *>(VT_NAME);
586 }
587 bool KeyCompareLessThan(const Field *o) const {
588 return *name() < *o->name();
589 }
James Kuszmaul8e62b022022-03-22 09:33:25 -0700590 int KeyCompareWithValue(const char *_name) const {
591 return strcmp(name()->c_str(), _name);
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700592 }
593 const reflection::Type *type() const {
594 return GetPointer<const reflection::Type *>(VT_TYPE);
595 }
596 uint16_t id() const {
597 return GetField<uint16_t>(VT_ID, 0);
598 }
599 uint16_t offset() const {
600 return GetField<uint16_t>(VT_OFFSET, 0);
601 }
602 int64_t default_integer() const {
603 return GetField<int64_t>(VT_DEFAULT_INTEGER, 0);
604 }
605 double default_real() const {
606 return GetField<double>(VT_DEFAULT_REAL, 0.0);
607 }
608 bool deprecated() const {
609 return GetField<uint8_t>(VT_DEPRECATED, 0) != 0;
610 }
611 bool required() const {
612 return GetField<uint8_t>(VT_REQUIRED, 0) != 0;
613 }
614 bool key() const {
615 return GetField<uint8_t>(VT_KEY, 0) != 0;
616 }
617 const flatbuffers::Vector<flatbuffers::Offset<reflection::KeyValue>> *attributes() const {
618 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<reflection::KeyValue>> *>(VT_ATTRIBUTES);
619 }
620 const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *documentation() const {
621 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *>(VT_DOCUMENTATION);
622 }
Austin Schuh272c6132020-11-14 16:37:52 -0800623 bool optional() const {
624 return GetField<uint8_t>(VT_OPTIONAL, 0) != 0;
625 }
James Kuszmaul8e62b022022-03-22 09:33:25 -0700626 /// Number of padding octets to always add after this field. Structs only.
627 uint16_t padding() const {
628 return GetField<uint16_t>(VT_PADDING, 0);
629 }
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700630 bool Verify(flatbuffers::Verifier &verifier) const {
631 return VerifyTableStart(verifier) &&
632 VerifyOffsetRequired(verifier, VT_NAME) &&
633 verifier.VerifyString(name()) &&
634 VerifyOffsetRequired(verifier, VT_TYPE) &&
635 verifier.VerifyTable(type()) &&
James Kuszmaul8e62b022022-03-22 09:33:25 -0700636 VerifyField<uint16_t>(verifier, VT_ID, 2) &&
637 VerifyField<uint16_t>(verifier, VT_OFFSET, 2) &&
638 VerifyField<int64_t>(verifier, VT_DEFAULT_INTEGER, 8) &&
639 VerifyField<double>(verifier, VT_DEFAULT_REAL, 8) &&
640 VerifyField<uint8_t>(verifier, VT_DEPRECATED, 1) &&
641 VerifyField<uint8_t>(verifier, VT_REQUIRED, 1) &&
642 VerifyField<uint8_t>(verifier, VT_KEY, 1) &&
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700643 VerifyOffset(verifier, VT_ATTRIBUTES) &&
644 verifier.VerifyVector(attributes()) &&
645 verifier.VerifyVectorOfTables(attributes()) &&
646 VerifyOffset(verifier, VT_DOCUMENTATION) &&
647 verifier.VerifyVector(documentation()) &&
648 verifier.VerifyVectorOfStrings(documentation()) &&
James Kuszmaul8e62b022022-03-22 09:33:25 -0700649 VerifyField<uint8_t>(verifier, VT_OPTIONAL, 1) &&
650 VerifyField<uint16_t>(verifier, VT_PADDING, 2) &&
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700651 verifier.EndTable();
652 }
653};
654
655struct FieldBuilder {
Austin Schuh272c6132020-11-14 16:37:52 -0800656 typedef Field Table;
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700657 flatbuffers::FlatBufferBuilder &fbb_;
658 flatbuffers::uoffset_t start_;
659 void add_name(flatbuffers::Offset<flatbuffers::String> name) {
660 fbb_.AddOffset(Field::VT_NAME, name);
661 }
662 void add_type(flatbuffers::Offset<reflection::Type> type) {
663 fbb_.AddOffset(Field::VT_TYPE, type);
664 }
665 void add_id(uint16_t id) {
666 fbb_.AddElement<uint16_t>(Field::VT_ID, id, 0);
667 }
668 void add_offset(uint16_t offset) {
669 fbb_.AddElement<uint16_t>(Field::VT_OFFSET, offset, 0);
670 }
671 void add_default_integer(int64_t default_integer) {
672 fbb_.AddElement<int64_t>(Field::VT_DEFAULT_INTEGER, default_integer, 0);
673 }
674 void add_default_real(double default_real) {
675 fbb_.AddElement<double>(Field::VT_DEFAULT_REAL, default_real, 0.0);
676 }
677 void add_deprecated(bool deprecated) {
678 fbb_.AddElement<uint8_t>(Field::VT_DEPRECATED, static_cast<uint8_t>(deprecated), 0);
679 }
680 void add_required(bool required) {
681 fbb_.AddElement<uint8_t>(Field::VT_REQUIRED, static_cast<uint8_t>(required), 0);
682 }
683 void add_key(bool key) {
684 fbb_.AddElement<uint8_t>(Field::VT_KEY, static_cast<uint8_t>(key), 0);
685 }
686 void add_attributes(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<reflection::KeyValue>>> attributes) {
687 fbb_.AddOffset(Field::VT_ATTRIBUTES, attributes);
688 }
689 void add_documentation(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> documentation) {
690 fbb_.AddOffset(Field::VT_DOCUMENTATION, documentation);
691 }
Austin Schuh272c6132020-11-14 16:37:52 -0800692 void add_optional(bool optional) {
693 fbb_.AddElement<uint8_t>(Field::VT_OPTIONAL, static_cast<uint8_t>(optional), 0);
694 }
James Kuszmaul8e62b022022-03-22 09:33:25 -0700695 void add_padding(uint16_t padding) {
696 fbb_.AddElement<uint16_t>(Field::VT_PADDING, padding, 0);
697 }
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700698 explicit FieldBuilder(flatbuffers::FlatBufferBuilder &_fbb)
699 : fbb_(_fbb) {
700 start_ = fbb_.StartTable();
701 }
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700702 flatbuffers::Offset<Field> Finish() {
703 const auto end = fbb_.EndTable(start_);
704 auto o = flatbuffers::Offset<Field>(end);
705 fbb_.Required(o, Field::VT_NAME);
706 fbb_.Required(o, Field::VT_TYPE);
707 return o;
708 }
709};
710
711inline flatbuffers::Offset<Field> CreateField(
712 flatbuffers::FlatBufferBuilder &_fbb,
713 flatbuffers::Offset<flatbuffers::String> name = 0,
714 flatbuffers::Offset<reflection::Type> type = 0,
715 uint16_t id = 0,
716 uint16_t offset = 0,
717 int64_t default_integer = 0,
718 double default_real = 0.0,
719 bool deprecated = false,
720 bool required = false,
721 bool key = false,
722 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<reflection::KeyValue>>> attributes = 0,
Austin Schuh272c6132020-11-14 16:37:52 -0800723 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> documentation = 0,
James Kuszmaul8e62b022022-03-22 09:33:25 -0700724 bool optional = false,
725 uint16_t padding = 0) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700726 FieldBuilder builder_(_fbb);
727 builder_.add_default_real(default_real);
728 builder_.add_default_integer(default_integer);
729 builder_.add_documentation(documentation);
730 builder_.add_attributes(attributes);
731 builder_.add_type(type);
732 builder_.add_name(name);
James Kuszmaul8e62b022022-03-22 09:33:25 -0700733 builder_.add_padding(padding);
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700734 builder_.add_offset(offset);
735 builder_.add_id(id);
Austin Schuh272c6132020-11-14 16:37:52 -0800736 builder_.add_optional(optional);
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700737 builder_.add_key(key);
738 builder_.add_required(required);
739 builder_.add_deprecated(deprecated);
740 return builder_.Finish();
741}
742
743inline flatbuffers::Offset<Field> CreateFieldDirect(
744 flatbuffers::FlatBufferBuilder &_fbb,
745 const char *name = nullptr,
746 flatbuffers::Offset<reflection::Type> type = 0,
747 uint16_t id = 0,
748 uint16_t offset = 0,
749 int64_t default_integer = 0,
750 double default_real = 0.0,
751 bool deprecated = false,
752 bool required = false,
753 bool key = false,
Austin Schuh272c6132020-11-14 16:37:52 -0800754 std::vector<flatbuffers::Offset<reflection::KeyValue>> *attributes = nullptr,
755 const std::vector<flatbuffers::Offset<flatbuffers::String>> *documentation = nullptr,
James Kuszmaul8e62b022022-03-22 09:33:25 -0700756 bool optional = false,
757 uint16_t padding = 0) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700758 auto name__ = name ? _fbb.CreateString(name) : 0;
Austin Schuh272c6132020-11-14 16:37:52 -0800759 auto attributes__ = attributes ? _fbb.CreateVectorOfSortedTables<reflection::KeyValue>(attributes) : 0;
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700760 auto documentation__ = documentation ? _fbb.CreateVector<flatbuffers::Offset<flatbuffers::String>>(*documentation) : 0;
761 return reflection::CreateField(
762 _fbb,
763 name__,
764 type,
765 id,
766 offset,
767 default_integer,
768 default_real,
769 deprecated,
770 required,
771 key,
772 attributes__,
Austin Schuh272c6132020-11-14 16:37:52 -0800773 documentation__,
James Kuszmaul8e62b022022-03-22 09:33:25 -0700774 optional,
775 padding);
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700776}
777
778struct Object FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
Austin Schuh272c6132020-11-14 16:37:52 -0800779 typedef ObjectBuilder Builder;
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700780 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
781 VT_NAME = 4,
782 VT_FIELDS = 6,
783 VT_IS_STRUCT = 8,
784 VT_MINALIGN = 10,
785 VT_BYTESIZE = 12,
786 VT_ATTRIBUTES = 14,
James Kuszmaul8e62b022022-03-22 09:33:25 -0700787 VT_DOCUMENTATION = 16,
788 VT_DECLARATION_FILE = 18
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700789 };
790 const flatbuffers::String *name() const {
791 return GetPointer<const flatbuffers::String *>(VT_NAME);
792 }
793 bool KeyCompareLessThan(const Object *o) const {
794 return *name() < *o->name();
795 }
James Kuszmaul8e62b022022-03-22 09:33:25 -0700796 int KeyCompareWithValue(const char *_name) const {
797 return strcmp(name()->c_str(), _name);
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700798 }
799 const flatbuffers::Vector<flatbuffers::Offset<reflection::Field>> *fields() const {
800 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<reflection::Field>> *>(VT_FIELDS);
801 }
802 bool is_struct() const {
803 return GetField<uint8_t>(VT_IS_STRUCT, 0) != 0;
804 }
805 int32_t minalign() const {
806 return GetField<int32_t>(VT_MINALIGN, 0);
807 }
808 int32_t bytesize() const {
809 return GetField<int32_t>(VT_BYTESIZE, 0);
810 }
811 const flatbuffers::Vector<flatbuffers::Offset<reflection::KeyValue>> *attributes() const {
812 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<reflection::KeyValue>> *>(VT_ATTRIBUTES);
813 }
814 const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *documentation() const {
815 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *>(VT_DOCUMENTATION);
816 }
James Kuszmaul8e62b022022-03-22 09:33:25 -0700817 /// File that this Object is declared in.
818 const flatbuffers::String *declaration_file() const {
819 return GetPointer<const flatbuffers::String *>(VT_DECLARATION_FILE);
820 }
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700821 bool Verify(flatbuffers::Verifier &verifier) const {
822 return VerifyTableStart(verifier) &&
823 VerifyOffsetRequired(verifier, VT_NAME) &&
824 verifier.VerifyString(name()) &&
825 VerifyOffsetRequired(verifier, VT_FIELDS) &&
826 verifier.VerifyVector(fields()) &&
827 verifier.VerifyVectorOfTables(fields()) &&
James Kuszmaul8e62b022022-03-22 09:33:25 -0700828 VerifyField<uint8_t>(verifier, VT_IS_STRUCT, 1) &&
829 VerifyField<int32_t>(verifier, VT_MINALIGN, 4) &&
830 VerifyField<int32_t>(verifier, VT_BYTESIZE, 4) &&
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700831 VerifyOffset(verifier, VT_ATTRIBUTES) &&
832 verifier.VerifyVector(attributes()) &&
833 verifier.VerifyVectorOfTables(attributes()) &&
834 VerifyOffset(verifier, VT_DOCUMENTATION) &&
835 verifier.VerifyVector(documentation()) &&
836 verifier.VerifyVectorOfStrings(documentation()) &&
James Kuszmaul8e62b022022-03-22 09:33:25 -0700837 VerifyOffset(verifier, VT_DECLARATION_FILE) &&
838 verifier.VerifyString(declaration_file()) &&
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700839 verifier.EndTable();
840 }
841};
842
843struct ObjectBuilder {
Austin Schuh272c6132020-11-14 16:37:52 -0800844 typedef Object Table;
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700845 flatbuffers::FlatBufferBuilder &fbb_;
846 flatbuffers::uoffset_t start_;
847 void add_name(flatbuffers::Offset<flatbuffers::String> name) {
848 fbb_.AddOffset(Object::VT_NAME, name);
849 }
850 void add_fields(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<reflection::Field>>> fields) {
851 fbb_.AddOffset(Object::VT_FIELDS, fields);
852 }
853 void add_is_struct(bool is_struct) {
854 fbb_.AddElement<uint8_t>(Object::VT_IS_STRUCT, static_cast<uint8_t>(is_struct), 0);
855 }
856 void add_minalign(int32_t minalign) {
857 fbb_.AddElement<int32_t>(Object::VT_MINALIGN, minalign, 0);
858 }
859 void add_bytesize(int32_t bytesize) {
860 fbb_.AddElement<int32_t>(Object::VT_BYTESIZE, bytesize, 0);
861 }
862 void add_attributes(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<reflection::KeyValue>>> attributes) {
863 fbb_.AddOffset(Object::VT_ATTRIBUTES, attributes);
864 }
865 void add_documentation(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> documentation) {
866 fbb_.AddOffset(Object::VT_DOCUMENTATION, documentation);
867 }
James Kuszmaul8e62b022022-03-22 09:33:25 -0700868 void add_declaration_file(flatbuffers::Offset<flatbuffers::String> declaration_file) {
869 fbb_.AddOffset(Object::VT_DECLARATION_FILE, declaration_file);
870 }
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700871 explicit ObjectBuilder(flatbuffers::FlatBufferBuilder &_fbb)
872 : fbb_(_fbb) {
873 start_ = fbb_.StartTable();
874 }
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700875 flatbuffers::Offset<Object> Finish() {
876 const auto end = fbb_.EndTable(start_);
877 auto o = flatbuffers::Offset<Object>(end);
878 fbb_.Required(o, Object::VT_NAME);
879 fbb_.Required(o, Object::VT_FIELDS);
880 return o;
881 }
882};
883
884inline flatbuffers::Offset<Object> CreateObject(
885 flatbuffers::FlatBufferBuilder &_fbb,
886 flatbuffers::Offset<flatbuffers::String> name = 0,
887 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<reflection::Field>>> fields = 0,
888 bool is_struct = false,
889 int32_t minalign = 0,
890 int32_t bytesize = 0,
891 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<reflection::KeyValue>>> attributes = 0,
James Kuszmaul8e62b022022-03-22 09:33:25 -0700892 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> documentation = 0,
893 flatbuffers::Offset<flatbuffers::String> declaration_file = 0) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700894 ObjectBuilder builder_(_fbb);
James Kuszmaul8e62b022022-03-22 09:33:25 -0700895 builder_.add_declaration_file(declaration_file);
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700896 builder_.add_documentation(documentation);
897 builder_.add_attributes(attributes);
898 builder_.add_bytesize(bytesize);
899 builder_.add_minalign(minalign);
900 builder_.add_fields(fields);
901 builder_.add_name(name);
902 builder_.add_is_struct(is_struct);
903 return builder_.Finish();
904}
905
906inline flatbuffers::Offset<Object> CreateObjectDirect(
907 flatbuffers::FlatBufferBuilder &_fbb,
908 const char *name = nullptr,
Austin Schuh272c6132020-11-14 16:37:52 -0800909 std::vector<flatbuffers::Offset<reflection::Field>> *fields = nullptr,
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700910 bool is_struct = false,
911 int32_t minalign = 0,
912 int32_t bytesize = 0,
Austin Schuh272c6132020-11-14 16:37:52 -0800913 std::vector<flatbuffers::Offset<reflection::KeyValue>> *attributes = nullptr,
James Kuszmaul8e62b022022-03-22 09:33:25 -0700914 const std::vector<flatbuffers::Offset<flatbuffers::String>> *documentation = nullptr,
915 const char *declaration_file = nullptr) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700916 auto name__ = name ? _fbb.CreateString(name) : 0;
Austin Schuh272c6132020-11-14 16:37:52 -0800917 auto fields__ = fields ? _fbb.CreateVectorOfSortedTables<reflection::Field>(fields) : 0;
918 auto attributes__ = attributes ? _fbb.CreateVectorOfSortedTables<reflection::KeyValue>(attributes) : 0;
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700919 auto documentation__ = documentation ? _fbb.CreateVector<flatbuffers::Offset<flatbuffers::String>>(*documentation) : 0;
James Kuszmaul8e62b022022-03-22 09:33:25 -0700920 auto declaration_file__ = declaration_file ? _fbb.CreateString(declaration_file) : 0;
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700921 return reflection::CreateObject(
922 _fbb,
923 name__,
924 fields__,
925 is_struct,
926 minalign,
927 bytesize,
928 attributes__,
James Kuszmaul8e62b022022-03-22 09:33:25 -0700929 documentation__,
930 declaration_file__);
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700931}
932
933struct RPCCall FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
Austin Schuh272c6132020-11-14 16:37:52 -0800934 typedef RPCCallBuilder Builder;
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700935 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
936 VT_NAME = 4,
937 VT_REQUEST = 6,
938 VT_RESPONSE = 8,
939 VT_ATTRIBUTES = 10,
940 VT_DOCUMENTATION = 12
941 };
942 const flatbuffers::String *name() const {
943 return GetPointer<const flatbuffers::String *>(VT_NAME);
944 }
945 bool KeyCompareLessThan(const RPCCall *o) const {
946 return *name() < *o->name();
947 }
James Kuszmaul8e62b022022-03-22 09:33:25 -0700948 int KeyCompareWithValue(const char *_name) const {
949 return strcmp(name()->c_str(), _name);
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700950 }
951 const reflection::Object *request() const {
952 return GetPointer<const reflection::Object *>(VT_REQUEST);
953 }
954 const reflection::Object *response() const {
955 return GetPointer<const reflection::Object *>(VT_RESPONSE);
956 }
957 const flatbuffers::Vector<flatbuffers::Offset<reflection::KeyValue>> *attributes() const {
958 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<reflection::KeyValue>> *>(VT_ATTRIBUTES);
959 }
960 const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *documentation() const {
961 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *>(VT_DOCUMENTATION);
962 }
963 bool Verify(flatbuffers::Verifier &verifier) const {
964 return VerifyTableStart(verifier) &&
965 VerifyOffsetRequired(verifier, VT_NAME) &&
966 verifier.VerifyString(name()) &&
967 VerifyOffsetRequired(verifier, VT_REQUEST) &&
968 verifier.VerifyTable(request()) &&
969 VerifyOffsetRequired(verifier, VT_RESPONSE) &&
970 verifier.VerifyTable(response()) &&
971 VerifyOffset(verifier, VT_ATTRIBUTES) &&
972 verifier.VerifyVector(attributes()) &&
973 verifier.VerifyVectorOfTables(attributes()) &&
974 VerifyOffset(verifier, VT_DOCUMENTATION) &&
975 verifier.VerifyVector(documentation()) &&
976 verifier.VerifyVectorOfStrings(documentation()) &&
977 verifier.EndTable();
978 }
979};
980
981struct RPCCallBuilder {
Austin Schuh272c6132020-11-14 16:37:52 -0800982 typedef RPCCall Table;
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700983 flatbuffers::FlatBufferBuilder &fbb_;
984 flatbuffers::uoffset_t start_;
985 void add_name(flatbuffers::Offset<flatbuffers::String> name) {
986 fbb_.AddOffset(RPCCall::VT_NAME, name);
987 }
988 void add_request(flatbuffers::Offset<reflection::Object> request) {
989 fbb_.AddOffset(RPCCall::VT_REQUEST, request);
990 }
991 void add_response(flatbuffers::Offset<reflection::Object> response) {
992 fbb_.AddOffset(RPCCall::VT_RESPONSE, response);
993 }
994 void add_attributes(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<reflection::KeyValue>>> attributes) {
995 fbb_.AddOffset(RPCCall::VT_ATTRIBUTES, attributes);
996 }
997 void add_documentation(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> documentation) {
998 fbb_.AddOffset(RPCCall::VT_DOCUMENTATION, documentation);
999 }
1000 explicit RPCCallBuilder(flatbuffers::FlatBufferBuilder &_fbb)
1001 : fbb_(_fbb) {
1002 start_ = fbb_.StartTable();
1003 }
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001004 flatbuffers::Offset<RPCCall> Finish() {
1005 const auto end = fbb_.EndTable(start_);
1006 auto o = flatbuffers::Offset<RPCCall>(end);
1007 fbb_.Required(o, RPCCall::VT_NAME);
1008 fbb_.Required(o, RPCCall::VT_REQUEST);
1009 fbb_.Required(o, RPCCall::VT_RESPONSE);
1010 return o;
1011 }
1012};
1013
1014inline flatbuffers::Offset<RPCCall> CreateRPCCall(
1015 flatbuffers::FlatBufferBuilder &_fbb,
1016 flatbuffers::Offset<flatbuffers::String> name = 0,
1017 flatbuffers::Offset<reflection::Object> request = 0,
1018 flatbuffers::Offset<reflection::Object> response = 0,
1019 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<reflection::KeyValue>>> attributes = 0,
1020 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> documentation = 0) {
1021 RPCCallBuilder builder_(_fbb);
1022 builder_.add_documentation(documentation);
1023 builder_.add_attributes(attributes);
1024 builder_.add_response(response);
1025 builder_.add_request(request);
1026 builder_.add_name(name);
1027 return builder_.Finish();
1028}
1029
1030inline flatbuffers::Offset<RPCCall> CreateRPCCallDirect(
1031 flatbuffers::FlatBufferBuilder &_fbb,
1032 const char *name = nullptr,
1033 flatbuffers::Offset<reflection::Object> request = 0,
1034 flatbuffers::Offset<reflection::Object> response = 0,
Austin Schuh272c6132020-11-14 16:37:52 -08001035 std::vector<flatbuffers::Offset<reflection::KeyValue>> *attributes = nullptr,
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001036 const std::vector<flatbuffers::Offset<flatbuffers::String>> *documentation = nullptr) {
1037 auto name__ = name ? _fbb.CreateString(name) : 0;
Austin Schuh272c6132020-11-14 16:37:52 -08001038 auto attributes__ = attributes ? _fbb.CreateVectorOfSortedTables<reflection::KeyValue>(attributes) : 0;
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001039 auto documentation__ = documentation ? _fbb.CreateVector<flatbuffers::Offset<flatbuffers::String>>(*documentation) : 0;
1040 return reflection::CreateRPCCall(
1041 _fbb,
1042 name__,
1043 request,
1044 response,
1045 attributes__,
1046 documentation__);
1047}
1048
1049struct Service FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
Austin Schuh272c6132020-11-14 16:37:52 -08001050 typedef ServiceBuilder Builder;
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001051 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
1052 VT_NAME = 4,
1053 VT_CALLS = 6,
1054 VT_ATTRIBUTES = 8,
James Kuszmaul8e62b022022-03-22 09:33:25 -07001055 VT_DOCUMENTATION = 10,
1056 VT_DECLARATION_FILE = 12
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001057 };
1058 const flatbuffers::String *name() const {
1059 return GetPointer<const flatbuffers::String *>(VT_NAME);
1060 }
1061 bool KeyCompareLessThan(const Service *o) const {
1062 return *name() < *o->name();
1063 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07001064 int KeyCompareWithValue(const char *_name) const {
1065 return strcmp(name()->c_str(), _name);
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001066 }
1067 const flatbuffers::Vector<flatbuffers::Offset<reflection::RPCCall>> *calls() const {
1068 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<reflection::RPCCall>> *>(VT_CALLS);
1069 }
1070 const flatbuffers::Vector<flatbuffers::Offset<reflection::KeyValue>> *attributes() const {
1071 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<reflection::KeyValue>> *>(VT_ATTRIBUTES);
1072 }
1073 const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *documentation() const {
1074 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *>(VT_DOCUMENTATION);
1075 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07001076 /// File that this Service is declared in.
1077 const flatbuffers::String *declaration_file() const {
1078 return GetPointer<const flatbuffers::String *>(VT_DECLARATION_FILE);
1079 }
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001080 bool Verify(flatbuffers::Verifier &verifier) const {
1081 return VerifyTableStart(verifier) &&
1082 VerifyOffsetRequired(verifier, VT_NAME) &&
1083 verifier.VerifyString(name()) &&
1084 VerifyOffset(verifier, VT_CALLS) &&
1085 verifier.VerifyVector(calls()) &&
1086 verifier.VerifyVectorOfTables(calls()) &&
1087 VerifyOffset(verifier, VT_ATTRIBUTES) &&
1088 verifier.VerifyVector(attributes()) &&
1089 verifier.VerifyVectorOfTables(attributes()) &&
1090 VerifyOffset(verifier, VT_DOCUMENTATION) &&
1091 verifier.VerifyVector(documentation()) &&
1092 verifier.VerifyVectorOfStrings(documentation()) &&
James Kuszmaul8e62b022022-03-22 09:33:25 -07001093 VerifyOffset(verifier, VT_DECLARATION_FILE) &&
1094 verifier.VerifyString(declaration_file()) &&
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001095 verifier.EndTable();
1096 }
1097};
1098
1099struct ServiceBuilder {
Austin Schuh272c6132020-11-14 16:37:52 -08001100 typedef Service Table;
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001101 flatbuffers::FlatBufferBuilder &fbb_;
1102 flatbuffers::uoffset_t start_;
1103 void add_name(flatbuffers::Offset<flatbuffers::String> name) {
1104 fbb_.AddOffset(Service::VT_NAME, name);
1105 }
1106 void add_calls(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<reflection::RPCCall>>> calls) {
1107 fbb_.AddOffset(Service::VT_CALLS, calls);
1108 }
1109 void add_attributes(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<reflection::KeyValue>>> attributes) {
1110 fbb_.AddOffset(Service::VT_ATTRIBUTES, attributes);
1111 }
1112 void add_documentation(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> documentation) {
1113 fbb_.AddOffset(Service::VT_DOCUMENTATION, documentation);
1114 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07001115 void add_declaration_file(flatbuffers::Offset<flatbuffers::String> declaration_file) {
1116 fbb_.AddOffset(Service::VT_DECLARATION_FILE, declaration_file);
1117 }
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001118 explicit ServiceBuilder(flatbuffers::FlatBufferBuilder &_fbb)
1119 : fbb_(_fbb) {
1120 start_ = fbb_.StartTable();
1121 }
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001122 flatbuffers::Offset<Service> Finish() {
1123 const auto end = fbb_.EndTable(start_);
1124 auto o = flatbuffers::Offset<Service>(end);
1125 fbb_.Required(o, Service::VT_NAME);
1126 return o;
1127 }
1128};
1129
1130inline flatbuffers::Offset<Service> CreateService(
1131 flatbuffers::FlatBufferBuilder &_fbb,
1132 flatbuffers::Offset<flatbuffers::String> name = 0,
1133 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<reflection::RPCCall>>> calls = 0,
1134 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<reflection::KeyValue>>> attributes = 0,
James Kuszmaul8e62b022022-03-22 09:33:25 -07001135 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> documentation = 0,
1136 flatbuffers::Offset<flatbuffers::String> declaration_file = 0) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001137 ServiceBuilder builder_(_fbb);
James Kuszmaul8e62b022022-03-22 09:33:25 -07001138 builder_.add_declaration_file(declaration_file);
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001139 builder_.add_documentation(documentation);
1140 builder_.add_attributes(attributes);
1141 builder_.add_calls(calls);
1142 builder_.add_name(name);
1143 return builder_.Finish();
1144}
1145
1146inline flatbuffers::Offset<Service> CreateServiceDirect(
1147 flatbuffers::FlatBufferBuilder &_fbb,
1148 const char *name = nullptr,
Austin Schuh272c6132020-11-14 16:37:52 -08001149 std::vector<flatbuffers::Offset<reflection::RPCCall>> *calls = nullptr,
1150 std::vector<flatbuffers::Offset<reflection::KeyValue>> *attributes = nullptr,
James Kuszmaul8e62b022022-03-22 09:33:25 -07001151 const std::vector<flatbuffers::Offset<flatbuffers::String>> *documentation = nullptr,
1152 const char *declaration_file = nullptr) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001153 auto name__ = name ? _fbb.CreateString(name) : 0;
Austin Schuh272c6132020-11-14 16:37:52 -08001154 auto calls__ = calls ? _fbb.CreateVectorOfSortedTables<reflection::RPCCall>(calls) : 0;
1155 auto attributes__ = attributes ? _fbb.CreateVectorOfSortedTables<reflection::KeyValue>(attributes) : 0;
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001156 auto documentation__ = documentation ? _fbb.CreateVector<flatbuffers::Offset<flatbuffers::String>>(*documentation) : 0;
James Kuszmaul8e62b022022-03-22 09:33:25 -07001157 auto declaration_file__ = declaration_file ? _fbb.CreateString(declaration_file) : 0;
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001158 return reflection::CreateService(
1159 _fbb,
1160 name__,
1161 calls__,
1162 attributes__,
James Kuszmaul8e62b022022-03-22 09:33:25 -07001163 documentation__,
1164 declaration_file__);
1165}
1166
1167/// File specific information.
1168/// Symbols declared within a file may be recovered by iterating over all
1169/// symbols and examining the `declaration_file` field.
1170struct SchemaFile FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
1171 typedef SchemaFileBuilder Builder;
1172 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
1173 VT_FILENAME = 4,
1174 VT_INCLUDED_FILENAMES = 6
1175 };
1176 /// Filename, relative to project root.
1177 const flatbuffers::String *filename() const {
1178 return GetPointer<const flatbuffers::String *>(VT_FILENAME);
1179 }
1180 bool KeyCompareLessThan(const SchemaFile *o) const {
1181 return *filename() < *o->filename();
1182 }
1183 int KeyCompareWithValue(const char *_filename) const {
1184 return strcmp(filename()->c_str(), _filename);
1185 }
1186 /// Names of included files, relative to project root.
1187 const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *included_filenames() const {
1188 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *>(VT_INCLUDED_FILENAMES);
1189 }
1190 bool Verify(flatbuffers::Verifier &verifier) const {
1191 return VerifyTableStart(verifier) &&
1192 VerifyOffsetRequired(verifier, VT_FILENAME) &&
1193 verifier.VerifyString(filename()) &&
1194 VerifyOffset(verifier, VT_INCLUDED_FILENAMES) &&
1195 verifier.VerifyVector(included_filenames()) &&
1196 verifier.VerifyVectorOfStrings(included_filenames()) &&
1197 verifier.EndTable();
1198 }
1199};
1200
1201struct SchemaFileBuilder {
1202 typedef SchemaFile Table;
1203 flatbuffers::FlatBufferBuilder &fbb_;
1204 flatbuffers::uoffset_t start_;
1205 void add_filename(flatbuffers::Offset<flatbuffers::String> filename) {
1206 fbb_.AddOffset(SchemaFile::VT_FILENAME, filename);
1207 }
1208 void add_included_filenames(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> included_filenames) {
1209 fbb_.AddOffset(SchemaFile::VT_INCLUDED_FILENAMES, included_filenames);
1210 }
1211 explicit SchemaFileBuilder(flatbuffers::FlatBufferBuilder &_fbb)
1212 : fbb_(_fbb) {
1213 start_ = fbb_.StartTable();
1214 }
1215 flatbuffers::Offset<SchemaFile> Finish() {
1216 const auto end = fbb_.EndTable(start_);
1217 auto o = flatbuffers::Offset<SchemaFile>(end);
1218 fbb_.Required(o, SchemaFile::VT_FILENAME);
1219 return o;
1220 }
1221};
1222
1223inline flatbuffers::Offset<SchemaFile> CreateSchemaFile(
1224 flatbuffers::FlatBufferBuilder &_fbb,
1225 flatbuffers::Offset<flatbuffers::String> filename = 0,
1226 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> included_filenames = 0) {
1227 SchemaFileBuilder builder_(_fbb);
1228 builder_.add_included_filenames(included_filenames);
1229 builder_.add_filename(filename);
1230 return builder_.Finish();
1231}
1232
1233inline flatbuffers::Offset<SchemaFile> CreateSchemaFileDirect(
1234 flatbuffers::FlatBufferBuilder &_fbb,
1235 const char *filename = nullptr,
1236 const std::vector<flatbuffers::Offset<flatbuffers::String>> *included_filenames = nullptr) {
1237 auto filename__ = filename ? _fbb.CreateString(filename) : 0;
1238 auto included_filenames__ = included_filenames ? _fbb.CreateVector<flatbuffers::Offset<flatbuffers::String>>(*included_filenames) : 0;
1239 return reflection::CreateSchemaFile(
1240 _fbb,
1241 filename__,
1242 included_filenames__);
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001243}
1244
1245struct Schema FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
Austin Schuh272c6132020-11-14 16:37:52 -08001246 typedef SchemaBuilder Builder;
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001247 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
1248 VT_OBJECTS = 4,
1249 VT_ENUMS = 6,
1250 VT_FILE_IDENT = 8,
1251 VT_FILE_EXT = 10,
1252 VT_ROOT_TABLE = 12,
James Kuszmaul8e62b022022-03-22 09:33:25 -07001253 VT_SERVICES = 14,
1254 VT_ADVANCED_FEATURES = 16,
1255 VT_FBS_FILES = 18
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001256 };
1257 const flatbuffers::Vector<flatbuffers::Offset<reflection::Object>> *objects() const {
1258 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<reflection::Object>> *>(VT_OBJECTS);
1259 }
1260 const flatbuffers::Vector<flatbuffers::Offset<reflection::Enum>> *enums() const {
1261 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<reflection::Enum>> *>(VT_ENUMS);
1262 }
1263 const flatbuffers::String *file_ident() const {
1264 return GetPointer<const flatbuffers::String *>(VT_FILE_IDENT);
1265 }
1266 const flatbuffers::String *file_ext() const {
1267 return GetPointer<const flatbuffers::String *>(VT_FILE_EXT);
1268 }
1269 const reflection::Object *root_table() const {
1270 return GetPointer<const reflection::Object *>(VT_ROOT_TABLE);
1271 }
1272 const flatbuffers::Vector<flatbuffers::Offset<reflection::Service>> *services() const {
1273 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<reflection::Service>> *>(VT_SERVICES);
1274 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07001275 reflection::AdvancedFeatures advanced_features() const {
1276 return static_cast<reflection::AdvancedFeatures>(GetField<uint64_t>(VT_ADVANCED_FEATURES, 0));
1277 }
1278 /// All the files used in this compilation. Files are relative to where
1279 /// flatc was invoked.
1280 const flatbuffers::Vector<flatbuffers::Offset<reflection::SchemaFile>> *fbs_files() const {
1281 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<reflection::SchemaFile>> *>(VT_FBS_FILES);
1282 }
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001283 bool Verify(flatbuffers::Verifier &verifier) const {
1284 return VerifyTableStart(verifier) &&
1285 VerifyOffsetRequired(verifier, VT_OBJECTS) &&
1286 verifier.VerifyVector(objects()) &&
1287 verifier.VerifyVectorOfTables(objects()) &&
1288 VerifyOffsetRequired(verifier, VT_ENUMS) &&
1289 verifier.VerifyVector(enums()) &&
1290 verifier.VerifyVectorOfTables(enums()) &&
1291 VerifyOffset(verifier, VT_FILE_IDENT) &&
1292 verifier.VerifyString(file_ident()) &&
1293 VerifyOffset(verifier, VT_FILE_EXT) &&
1294 verifier.VerifyString(file_ext()) &&
1295 VerifyOffset(verifier, VT_ROOT_TABLE) &&
1296 verifier.VerifyTable(root_table()) &&
1297 VerifyOffset(verifier, VT_SERVICES) &&
1298 verifier.VerifyVector(services()) &&
1299 verifier.VerifyVectorOfTables(services()) &&
James Kuszmaul8e62b022022-03-22 09:33:25 -07001300 VerifyField<uint64_t>(verifier, VT_ADVANCED_FEATURES, 8) &&
1301 VerifyOffset(verifier, VT_FBS_FILES) &&
1302 verifier.VerifyVector(fbs_files()) &&
1303 verifier.VerifyVectorOfTables(fbs_files()) &&
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001304 verifier.EndTable();
1305 }
1306};
1307
1308struct SchemaBuilder {
Austin Schuh272c6132020-11-14 16:37:52 -08001309 typedef Schema Table;
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001310 flatbuffers::FlatBufferBuilder &fbb_;
1311 flatbuffers::uoffset_t start_;
1312 void add_objects(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<reflection::Object>>> objects) {
1313 fbb_.AddOffset(Schema::VT_OBJECTS, objects);
1314 }
1315 void add_enums(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<reflection::Enum>>> enums) {
1316 fbb_.AddOffset(Schema::VT_ENUMS, enums);
1317 }
1318 void add_file_ident(flatbuffers::Offset<flatbuffers::String> file_ident) {
1319 fbb_.AddOffset(Schema::VT_FILE_IDENT, file_ident);
1320 }
1321 void add_file_ext(flatbuffers::Offset<flatbuffers::String> file_ext) {
1322 fbb_.AddOffset(Schema::VT_FILE_EXT, file_ext);
1323 }
1324 void add_root_table(flatbuffers::Offset<reflection::Object> root_table) {
1325 fbb_.AddOffset(Schema::VT_ROOT_TABLE, root_table);
1326 }
1327 void add_services(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<reflection::Service>>> services) {
1328 fbb_.AddOffset(Schema::VT_SERVICES, services);
1329 }
James Kuszmaul8e62b022022-03-22 09:33:25 -07001330 void add_advanced_features(reflection::AdvancedFeatures advanced_features) {
1331 fbb_.AddElement<uint64_t>(Schema::VT_ADVANCED_FEATURES, static_cast<uint64_t>(advanced_features), 0);
1332 }
1333 void add_fbs_files(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<reflection::SchemaFile>>> fbs_files) {
1334 fbb_.AddOffset(Schema::VT_FBS_FILES, fbs_files);
1335 }
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001336 explicit SchemaBuilder(flatbuffers::FlatBufferBuilder &_fbb)
1337 : fbb_(_fbb) {
1338 start_ = fbb_.StartTable();
1339 }
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001340 flatbuffers::Offset<Schema> Finish() {
1341 const auto end = fbb_.EndTable(start_);
1342 auto o = flatbuffers::Offset<Schema>(end);
1343 fbb_.Required(o, Schema::VT_OBJECTS);
1344 fbb_.Required(o, Schema::VT_ENUMS);
1345 return o;
1346 }
1347};
1348
1349inline flatbuffers::Offset<Schema> CreateSchema(
1350 flatbuffers::FlatBufferBuilder &_fbb,
1351 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<reflection::Object>>> objects = 0,
1352 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<reflection::Enum>>> enums = 0,
1353 flatbuffers::Offset<flatbuffers::String> file_ident = 0,
1354 flatbuffers::Offset<flatbuffers::String> file_ext = 0,
1355 flatbuffers::Offset<reflection::Object> root_table = 0,
James Kuszmaul8e62b022022-03-22 09:33:25 -07001356 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<reflection::Service>>> services = 0,
1357 reflection::AdvancedFeatures advanced_features = static_cast<reflection::AdvancedFeatures>(0),
1358 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<reflection::SchemaFile>>> fbs_files = 0) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001359 SchemaBuilder builder_(_fbb);
James Kuszmaul8e62b022022-03-22 09:33:25 -07001360 builder_.add_advanced_features(advanced_features);
1361 builder_.add_fbs_files(fbs_files);
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001362 builder_.add_services(services);
1363 builder_.add_root_table(root_table);
1364 builder_.add_file_ext(file_ext);
1365 builder_.add_file_ident(file_ident);
1366 builder_.add_enums(enums);
1367 builder_.add_objects(objects);
1368 return builder_.Finish();
1369}
1370
1371inline flatbuffers::Offset<Schema> CreateSchemaDirect(
1372 flatbuffers::FlatBufferBuilder &_fbb,
Austin Schuh272c6132020-11-14 16:37:52 -08001373 std::vector<flatbuffers::Offset<reflection::Object>> *objects = nullptr,
1374 std::vector<flatbuffers::Offset<reflection::Enum>> *enums = nullptr,
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001375 const char *file_ident = nullptr,
1376 const char *file_ext = nullptr,
1377 flatbuffers::Offset<reflection::Object> root_table = 0,
James Kuszmaul8e62b022022-03-22 09:33:25 -07001378 std::vector<flatbuffers::Offset<reflection::Service>> *services = nullptr,
1379 reflection::AdvancedFeatures advanced_features = static_cast<reflection::AdvancedFeatures>(0),
1380 std::vector<flatbuffers::Offset<reflection::SchemaFile>> *fbs_files = nullptr) {
Austin Schuh272c6132020-11-14 16:37:52 -08001381 auto objects__ = objects ? _fbb.CreateVectorOfSortedTables<reflection::Object>(objects) : 0;
1382 auto enums__ = enums ? _fbb.CreateVectorOfSortedTables<reflection::Enum>(enums) : 0;
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001383 auto file_ident__ = file_ident ? _fbb.CreateString(file_ident) : 0;
1384 auto file_ext__ = file_ext ? _fbb.CreateString(file_ext) : 0;
Austin Schuh272c6132020-11-14 16:37:52 -08001385 auto services__ = services ? _fbb.CreateVectorOfSortedTables<reflection::Service>(services) : 0;
James Kuszmaul8e62b022022-03-22 09:33:25 -07001386 auto fbs_files__ = fbs_files ? _fbb.CreateVectorOfSortedTables<reflection::SchemaFile>(fbs_files) : 0;
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001387 return reflection::CreateSchema(
1388 _fbb,
1389 objects__,
1390 enums__,
1391 file_ident__,
1392 file_ext__,
1393 root_table,
James Kuszmaul8e62b022022-03-22 09:33:25 -07001394 services__,
1395 advanced_features,
1396 fbs_files__);
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001397}
1398
1399inline const reflection::Schema *GetSchema(const void *buf) {
1400 return flatbuffers::GetRoot<reflection::Schema>(buf);
1401}
1402
1403inline const reflection::Schema *GetSizePrefixedSchema(const void *buf) {
1404 return flatbuffers::GetSizePrefixedRoot<reflection::Schema>(buf);
1405}
1406
1407inline const char *SchemaIdentifier() {
1408 return "BFBS";
1409}
1410
1411inline bool SchemaBufferHasIdentifier(const void *buf) {
1412 return flatbuffers::BufferHasIdentifier(
1413 buf, SchemaIdentifier());
1414}
1415
James Kuszmaul8e62b022022-03-22 09:33:25 -07001416inline bool SizePrefixedSchemaBufferHasIdentifier(const void *buf) {
1417 return flatbuffers::BufferHasIdentifier(
1418 buf, SchemaIdentifier(), true);
1419}
1420
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001421inline bool VerifySchemaBuffer(
1422 flatbuffers::Verifier &verifier) {
1423 return verifier.VerifyBuffer<reflection::Schema>(SchemaIdentifier());
1424}
1425
1426inline bool VerifySizePrefixedSchemaBuffer(
1427 flatbuffers::Verifier &verifier) {
1428 return verifier.VerifySizePrefixedBuffer<reflection::Schema>(SchemaIdentifier());
1429}
1430
1431inline const char *SchemaExtension() {
1432 return "bfbs";
1433}
1434
1435inline void FinishSchemaBuffer(
1436 flatbuffers::FlatBufferBuilder &fbb,
1437 flatbuffers::Offset<reflection::Schema> root) {
1438 fbb.Finish(root, SchemaIdentifier());
1439}
1440
1441inline void FinishSizePrefixedSchemaBuffer(
1442 flatbuffers::FlatBufferBuilder &fbb,
1443 flatbuffers::Offset<reflection::Schema> root) {
1444 fbb.FinishSizePrefixed(root, SchemaIdentifier());
1445}
1446
1447} // namespace reflection
1448
1449#endif // FLATBUFFERS_GENERATED_REFLECTION_REFLECTION_H_