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 RPCCall; 24 25 struct Service; 26 27 struct Schema; 28 29 enum BaseType { 30 None = 0, 31 UType = 1, 32 Bool = 2, 33 Byte = 3, 34 UByte = 4, 35 Short = 5, 36 UShort = 6, 37 Int = 7, 38 UInt = 8, 39 Long = 9, 40 ULong = 10, 41 Float = 11, 42 Double = 12, 43 String = 13, 44 Vector = 14, 45 Obj = 15, 46 Union = 16 47 }; 48 49 inline const BaseType (&EnumValuesBaseType())[17] { 50 static const BaseType values[] = { 51 None, 52 UType, 53 Bool, 54 Byte, 55 UByte, 56 Short, 57 UShort, 58 Int, 59 UInt, 60 Long, 61 ULong, 62 Float, 63 Double, 64 String, 65 Vector, 66 Obj, 67 Union 68 }; 69 return values; 70 } 71 72 inline const char * const *EnumNamesBaseType() { 73 static const char * const names[] = { 74 "None", 75 "UType", 76 "Bool", 77 "Byte", 78 "UByte", 79 "Short", 80 "UShort", 81 "Int", 82 "UInt", 83 "Long", 84 "ULong", 85 "Float", 86 "Double", 87 "String", 88 "Vector", 89 "Obj", 90 "Union", 91 nullptr 92 }; 93 return names; 94 } 95 96 inline const char *EnumNameBaseType(BaseType e) { 97 if (e < None || e > Union) return ""; 98 const size_t index = static_cast<int>(e); 99 return EnumNamesBaseType()[index]; 100 } 101 102 struct Type FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { 103 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { 104 VT_BASE_TYPE = 4, 105 VT_ELEMENT = 6, 106 VT_INDEX = 8 107 }; 108 BaseType base_type() const { 109 return static_cast<BaseType>(GetField<int8_t>(VT_BASE_TYPE, 0)); 110 } 111 BaseType element() const { 112 return static_cast<BaseType>(GetField<int8_t>(VT_ELEMENT, 0)); 113 } 114 int32_t index() const { 115 return GetField<int32_t>(VT_INDEX, -1); 116 } 117 bool Verify(flatbuffers::Verifier &verifier) const { 118 return VerifyTableStart(verifier) && 119 VerifyField<int8_t>(verifier, VT_BASE_TYPE) && 120 VerifyField<int8_t>(verifier, VT_ELEMENT) && 121 VerifyField<int32_t>(verifier, VT_INDEX) && 122 verifier.EndTable(); 123 } 124 }; 125 126 struct TypeBuilder { 127 flatbuffers::FlatBufferBuilder &fbb_; 128 flatbuffers::uoffset_t start_; 129 void add_base_type(BaseType base_type) { 130 fbb_.AddElement<int8_t>(Type::VT_BASE_TYPE, static_cast<int8_t>(base_type), 0); 131 } 132 void add_element(BaseType element) { 133 fbb_.AddElement<int8_t>(Type::VT_ELEMENT, static_cast<int8_t>(element), 0); 134 } 135 void add_index(int32_t index) { 136 fbb_.AddElement<int32_t>(Type::VT_INDEX, index, -1); 137 } 138 explicit TypeBuilder(flatbuffers::FlatBufferBuilder &_fbb) 139 : fbb_(_fbb) { 140 start_ = fbb_.StartTable(); 141 } 142 TypeBuilder &operator=(const TypeBuilder &); 143 flatbuffers::Offset<Type> Finish() { 144 const auto end = fbb_.EndTable(start_); 145 auto o = flatbuffers::Offset<Type>(end); 146 return o; 147 } 148 }; 149 150 inline flatbuffers::Offset<Type> CreateType( 151 flatbuffers::FlatBufferBuilder &_fbb, 152 BaseType base_type = None, 153 BaseType element = None, 154 int32_t index = -1) { 155 TypeBuilder builder_(_fbb); 156 builder_.add_index(index); 157 builder_.add_element(element); 158 builder_.add_base_type(base_type); 159 return builder_.Finish(); 160 } 161 162 struct KeyValue FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { 163 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { 164 VT_KEY = 4, 165 VT_VALUE = 6 166 }; 167 const flatbuffers::String *key() const { 168 return GetPointer<const flatbuffers::String *>(VT_KEY); 169 } 170 bool KeyCompareLessThan(const KeyValue *o) const { 171 return *key() < *o->key(); 172 } 173 int KeyCompareWithValue(const char *val) const { 174 return strcmp(key()->c_str(), val); 175 } 176 const flatbuffers::String *value() const { 177 return GetPointer<const flatbuffers::String *>(VT_VALUE); 178 } 179 bool Verify(flatbuffers::Verifier &verifier) const { 180 return VerifyTableStart(verifier) && 181 VerifyOffsetRequired(verifier, VT_KEY) && 182 verifier.VerifyString(key()) && 183 VerifyOffset(verifier, VT_VALUE) && 184 verifier.VerifyString(value()) && 185 verifier.EndTable(); 186 } 187 }; 188 189 struct KeyValueBuilder { 190 flatbuffers::FlatBufferBuilder &fbb_; 191 flatbuffers::uoffset_t start_; 192 void add_key(flatbuffers::Offset<flatbuffers::String> key) { 193 fbb_.AddOffset(KeyValue::VT_KEY, key); 194 } 195 void add_value(flatbuffers::Offset<flatbuffers::String> value) { 196 fbb_.AddOffset(KeyValue::VT_VALUE, value); 197 } 198 explicit KeyValueBuilder(flatbuffers::FlatBufferBuilder &_fbb) 199 : fbb_(_fbb) { 200 start_ = fbb_.StartTable(); 201 } 202 KeyValueBuilder &operator=(const KeyValueBuilder &); 203 flatbuffers::Offset<KeyValue> Finish() { 204 const auto end = fbb_.EndTable(start_); 205 auto o = flatbuffers::Offset<KeyValue>(end); 206 fbb_.Required(o, KeyValue::VT_KEY); 207 return o; 208 } 209 }; 210 211 inline flatbuffers::Offset<KeyValue> CreateKeyValue( 212 flatbuffers::FlatBufferBuilder &_fbb, 213 flatbuffers::Offset<flatbuffers::String> key = 0, 214 flatbuffers::Offset<flatbuffers::String> value = 0) { 215 KeyValueBuilder builder_(_fbb); 216 builder_.add_value(value); 217 builder_.add_key(key); 218 return builder_.Finish(); 219 } 220 221 inline flatbuffers::Offset<KeyValue> CreateKeyValueDirect( 222 flatbuffers::FlatBufferBuilder &_fbb, 223 const char *key = nullptr, 224 const char *value = nullptr) { 225 auto key__ = key ? _fbb.CreateString(key) : 0; 226 auto value__ = value ? _fbb.CreateString(value) : 0; 227 return reflection::CreateKeyValue( 228 _fbb, 229 key__, 230 value__); 231 } 232 233 struct EnumVal FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { 234 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { 235 VT_NAME = 4, 236 VT_VALUE = 6, 237 VT_OBJECT = 8, 238 VT_UNION_TYPE = 10, 239 VT_DOCUMENTATION = 12 240 }; 241 const flatbuffers::String *name() const { 242 return GetPointer<const flatbuffers::String *>(VT_NAME); 243 } 244 int64_t value() const { 245 return GetField<int64_t>(VT_VALUE, 0); 246 } 247 bool KeyCompareLessThan(const EnumVal *o) const { 248 return value() < o->value(); 249 } 250 int KeyCompareWithValue(int64_t val) const { 251 return static_cast<int>(value() > val) - static_cast<int>(value() < val); 252 } 253 const Object *object() const { 254 return GetPointer<const Object *>(VT_OBJECT); 255 } 256 const Type *union_type() const { 257 return GetPointer<const Type *>(VT_UNION_TYPE); 258 } 259 const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *documentation() const { 260 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *>(VT_DOCUMENTATION); 261 } 262 bool Verify(flatbuffers::Verifier &verifier) const { 263 return VerifyTableStart(verifier) && 264 VerifyOffsetRequired(verifier, VT_NAME) && 265 verifier.VerifyString(name()) && 266 VerifyField<int64_t>(verifier, VT_VALUE) && 267 VerifyOffset(verifier, VT_OBJECT) && 268 verifier.VerifyTable(object()) && 269 VerifyOffset(verifier, VT_UNION_TYPE) && 270 verifier.VerifyTable(union_type()) && 271 VerifyOffset(verifier, VT_DOCUMENTATION) && 272 verifier.VerifyVector(documentation()) && 273 verifier.VerifyVectorOfStrings(documentation()) && 274 verifier.EndTable(); 275 } 276 }; 277 278 struct EnumValBuilder { 279 flatbuffers::FlatBufferBuilder &fbb_; 280 flatbuffers::uoffset_t start_; 281 void add_name(flatbuffers::Offset<flatbuffers::String> name) { 282 fbb_.AddOffset(EnumVal::VT_NAME, name); 283 } 284 void add_value(int64_t value) { 285 fbb_.AddElement<int64_t>(EnumVal::VT_VALUE, value, 0); 286 } 287 void add_object(flatbuffers::Offset<Object> object) { 288 fbb_.AddOffset(EnumVal::VT_OBJECT, object); 289 } 290 void add_union_type(flatbuffers::Offset<Type> union_type) { 291 fbb_.AddOffset(EnumVal::VT_UNION_TYPE, union_type); 292 } 293 void add_documentation(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> documentation) { 294 fbb_.AddOffset(EnumVal::VT_DOCUMENTATION, documentation); 295 } 296 explicit EnumValBuilder(flatbuffers::FlatBufferBuilder &_fbb) 297 : fbb_(_fbb) { 298 start_ = fbb_.StartTable(); 299 } 300 EnumValBuilder &operator=(const EnumValBuilder &); 301 flatbuffers::Offset<EnumVal> Finish() { 302 const auto end = fbb_.EndTable(start_); 303 auto o = flatbuffers::Offset<EnumVal>(end); 304 fbb_.Required(o, EnumVal::VT_NAME); 305 return o; 306 } 307 }; 308 309 inline flatbuffers::Offset<EnumVal> CreateEnumVal( 310 flatbuffers::FlatBufferBuilder &_fbb, 311 flatbuffers::Offset<flatbuffers::String> name = 0, 312 int64_t value = 0, 313 flatbuffers::Offset<Object> object = 0, 314 flatbuffers::Offset<Type> union_type = 0, 315 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> documentation = 0) { 316 EnumValBuilder builder_(_fbb); 317 builder_.add_value(value); 318 builder_.add_documentation(documentation); 319 builder_.add_union_type(union_type); 320 builder_.add_object(object); 321 builder_.add_name(name); 322 return builder_.Finish(); 323 } 324 325 inline flatbuffers::Offset<EnumVal> CreateEnumValDirect( 326 flatbuffers::FlatBufferBuilder &_fbb, 327 const char *name = nullptr, 328 int64_t value = 0, 329 flatbuffers::Offset<Object> object = 0, 330 flatbuffers::Offset<Type> union_type = 0, 331 const std::vector<flatbuffers::Offset<flatbuffers::String>> *documentation = nullptr) { 332 auto name__ = name ? _fbb.CreateString(name) : 0; 333 auto documentation__ = documentation ? _fbb.CreateVector<flatbuffers::Offset<flatbuffers::String>>(*documentation) : 0; 334 return reflection::CreateEnumVal( 335 _fbb, 336 name__, 337 value, 338 object, 339 union_type, 340 documentation__); 341 } 342 343 struct Enum FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { 344 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { 345 VT_NAME = 4, 346 VT_VALUES = 6, 347 VT_IS_UNION = 8, 348 VT_UNDERLYING_TYPE = 10, 349 VT_ATTRIBUTES = 12, 350 VT_DOCUMENTATION = 14 351 }; 352 const flatbuffers::String *name() const { 353 return GetPointer<const flatbuffers::String *>(VT_NAME); 354 } 355 bool KeyCompareLessThan(const Enum *o) const { 356 return *name() < *o->name(); 357 } 358 int KeyCompareWithValue(const char *val) const { 359 return strcmp(name()->c_str(), val); 360 } 361 const flatbuffers::Vector<flatbuffers::Offset<EnumVal>> *values() const { 362 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<EnumVal>> *>(VT_VALUES); 363 } 364 bool is_union() const { 365 return GetField<uint8_t>(VT_IS_UNION, 0) != 0; 366 } 367 const Type *underlying_type() const { 368 return GetPointer<const Type *>(VT_UNDERLYING_TYPE); 369 } 370 const flatbuffers::Vector<flatbuffers::Offset<KeyValue>> *attributes() const { 371 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<KeyValue>> *>(VT_ATTRIBUTES); 372 } 373 const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *documentation() const { 374 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *>(VT_DOCUMENTATION); 375 } 376 bool Verify(flatbuffers::Verifier &verifier) const { 377 return VerifyTableStart(verifier) && 378 VerifyOffsetRequired(verifier, VT_NAME) && 379 verifier.VerifyString(name()) && 380 VerifyOffsetRequired(verifier, VT_VALUES) && 381 verifier.VerifyVector(values()) && 382 verifier.VerifyVectorOfTables(values()) && 383 VerifyField<uint8_t>(verifier, VT_IS_UNION) && 384 VerifyOffsetRequired(verifier, VT_UNDERLYING_TYPE) && 385 verifier.VerifyTable(underlying_type()) && 386 VerifyOffset(verifier, VT_ATTRIBUTES) && 387 verifier.VerifyVector(attributes()) && 388 verifier.VerifyVectorOfTables(attributes()) && 389 VerifyOffset(verifier, VT_DOCUMENTATION) && 390 verifier.VerifyVector(documentation()) && 391 verifier.VerifyVectorOfStrings(documentation()) && 392 verifier.EndTable(); 393 } 394 }; 395 396 struct EnumBuilder { 397 flatbuffers::FlatBufferBuilder &fbb_; 398 flatbuffers::uoffset_t start_; 399 void add_name(flatbuffers::Offset<flatbuffers::String> name) { 400 fbb_.AddOffset(Enum::VT_NAME, name); 401 } 402 void add_values(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<EnumVal>>> values) { 403 fbb_.AddOffset(Enum::VT_VALUES, values); 404 } 405 void add_is_union(bool is_union) { 406 fbb_.AddElement<uint8_t>(Enum::VT_IS_UNION, static_cast<uint8_t>(is_union), 0); 407 } 408 void add_underlying_type(flatbuffers::Offset<Type> underlying_type) { 409 fbb_.AddOffset(Enum::VT_UNDERLYING_TYPE, underlying_type); 410 } 411 void add_attributes(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<KeyValue>>> attributes) { 412 fbb_.AddOffset(Enum::VT_ATTRIBUTES, attributes); 413 } 414 void add_documentation(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> documentation) { 415 fbb_.AddOffset(Enum::VT_DOCUMENTATION, documentation); 416 } 417 explicit EnumBuilder(flatbuffers::FlatBufferBuilder &_fbb) 418 : fbb_(_fbb) { 419 start_ = fbb_.StartTable(); 420 } 421 EnumBuilder &operator=(const EnumBuilder &); 422 flatbuffers::Offset<Enum> Finish() { 423 const auto end = fbb_.EndTable(start_); 424 auto o = flatbuffers::Offset<Enum>(end); 425 fbb_.Required(o, Enum::VT_NAME); 426 fbb_.Required(o, Enum::VT_VALUES); 427 fbb_.Required(o, Enum::VT_UNDERLYING_TYPE); 428 return o; 429 } 430 }; 431 432 inline flatbuffers::Offset<Enum> CreateEnum( 433 flatbuffers::FlatBufferBuilder &_fbb, 434 flatbuffers::Offset<flatbuffers::String> name = 0, 435 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<EnumVal>>> values = 0, 436 bool is_union = false, 437 flatbuffers::Offset<Type> underlying_type = 0, 438 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<KeyValue>>> attributes = 0, 439 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> documentation = 0) { 440 EnumBuilder builder_(_fbb); 441 builder_.add_documentation(documentation); 442 builder_.add_attributes(attributes); 443 builder_.add_underlying_type(underlying_type); 444 builder_.add_values(values); 445 builder_.add_name(name); 446 builder_.add_is_union(is_union); 447 return builder_.Finish(); 448 } 449 450 inline flatbuffers::Offset<Enum> CreateEnumDirect( 451 flatbuffers::FlatBufferBuilder &_fbb, 452 const char *name = nullptr, 453 const std::vector<flatbuffers::Offset<EnumVal>> *values = nullptr, 454 bool is_union = false, 455 flatbuffers::Offset<Type> underlying_type = 0, 456 const std::vector<flatbuffers::Offset<KeyValue>> *attributes = nullptr, 457 const std::vector<flatbuffers::Offset<flatbuffers::String>> *documentation = nullptr) { 458 auto name__ = name ? _fbb.CreateString(name) : 0; 459 auto values__ = values ? _fbb.CreateVector<flatbuffers::Offset<EnumVal>>(*values) : 0; 460 auto attributes__ = attributes ? _fbb.CreateVector<flatbuffers::Offset<KeyValue>>(*attributes) : 0; 461 auto documentation__ = documentation ? _fbb.CreateVector<flatbuffers::Offset<flatbuffers::String>>(*documentation) : 0; 462 return reflection::CreateEnum( 463 _fbb, 464 name__, 465 values__, 466 is_union, 467 underlying_type, 468 attributes__, 469 documentation__); 470 } 471 472 struct Field FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { 473 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { 474 VT_NAME = 4, 475 VT_TYPE = 6, 476 VT_ID = 8, 477 VT_OFFSET = 10, 478 VT_DEFAULT_INTEGER = 12, 479 VT_DEFAULT_REAL = 14, 480 VT_DEPRECATED = 16, 481 VT_REQUIRED = 18, 482 VT_KEY = 20, 483 VT_ATTRIBUTES = 22, 484 VT_DOCUMENTATION = 24 485 }; 486 const flatbuffers::String *name() const { 487 return GetPointer<const flatbuffers::String *>(VT_NAME); 488 } 489 bool KeyCompareLessThan(const Field *o) const { 490 return *name() < *o->name(); 491 } 492 int KeyCompareWithValue(const char *val) const { 493 return strcmp(name()->c_str(), val); 494 } 495 const Type *type() const { 496 return GetPointer<const Type *>(VT_TYPE); 497 } 498 uint16_t id() const { 499 return GetField<uint16_t>(VT_ID, 0); 500 } 501 uint16_t offset() const { 502 return GetField<uint16_t>(VT_OFFSET, 0); 503 } 504 int64_t default_integer() const { 505 return GetField<int64_t>(VT_DEFAULT_INTEGER, 0); 506 } 507 double default_real() const { 508 return GetField<double>(VT_DEFAULT_REAL, 0.0); 509 } 510 bool deprecated() const { 511 return GetField<uint8_t>(VT_DEPRECATED, 0) != 0; 512 } 513 bool required() const { 514 return GetField<uint8_t>(VT_REQUIRED, 0) != 0; 515 } 516 bool key() const { 517 return GetField<uint8_t>(VT_KEY, 0) != 0; 518 } 519 const flatbuffers::Vector<flatbuffers::Offset<KeyValue>> *attributes() const { 520 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<KeyValue>> *>(VT_ATTRIBUTES); 521 } 522 const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *documentation() const { 523 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *>(VT_DOCUMENTATION); 524 } 525 bool Verify(flatbuffers::Verifier &verifier) const { 526 return VerifyTableStart(verifier) && 527 VerifyOffsetRequired(verifier, VT_NAME) && 528 verifier.VerifyString(name()) && 529 VerifyOffsetRequired(verifier, VT_TYPE) && 530 verifier.VerifyTable(type()) && 531 VerifyField<uint16_t>(verifier, VT_ID) && 532 VerifyField<uint16_t>(verifier, VT_OFFSET) && 533 VerifyField<int64_t>(verifier, VT_DEFAULT_INTEGER) && 534 VerifyField<double>(verifier, VT_DEFAULT_REAL) && 535 VerifyField<uint8_t>(verifier, VT_DEPRECATED) && 536 VerifyField<uint8_t>(verifier, VT_REQUIRED) && 537 VerifyField<uint8_t>(verifier, VT_KEY) && 538 VerifyOffset(verifier, VT_ATTRIBUTES) && 539 verifier.VerifyVector(attributes()) && 540 verifier.VerifyVectorOfTables(attributes()) && 541 VerifyOffset(verifier, VT_DOCUMENTATION) && 542 verifier.VerifyVector(documentation()) && 543 verifier.VerifyVectorOfStrings(documentation()) && 544 verifier.EndTable(); 545 } 546 }; 547 548 struct FieldBuilder { 549 flatbuffers::FlatBufferBuilder &fbb_; 550 flatbuffers::uoffset_t start_; 551 void add_name(flatbuffers::Offset<flatbuffers::String> name) { 552 fbb_.AddOffset(Field::VT_NAME, name); 553 } 554 void add_type(flatbuffers::Offset<Type> type) { 555 fbb_.AddOffset(Field::VT_TYPE, type); 556 } 557 void add_id(uint16_t id) { 558 fbb_.AddElement<uint16_t>(Field::VT_ID, id, 0); 559 } 560 void add_offset(uint16_t offset) { 561 fbb_.AddElement<uint16_t>(Field::VT_OFFSET, offset, 0); 562 } 563 void add_default_integer(int64_t default_integer) { 564 fbb_.AddElement<int64_t>(Field::VT_DEFAULT_INTEGER, default_integer, 0); 565 } 566 void add_default_real(double default_real) { 567 fbb_.AddElement<double>(Field::VT_DEFAULT_REAL, default_real, 0.0); 568 } 569 void add_deprecated(bool deprecated) { 570 fbb_.AddElement<uint8_t>(Field::VT_DEPRECATED, static_cast<uint8_t>(deprecated), 0); 571 } 572 void add_required(bool required) { 573 fbb_.AddElement<uint8_t>(Field::VT_REQUIRED, static_cast<uint8_t>(required), 0); 574 } 575 void add_key(bool key) { 576 fbb_.AddElement<uint8_t>(Field::VT_KEY, static_cast<uint8_t>(key), 0); 577 } 578 void add_attributes(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<KeyValue>>> attributes) { 579 fbb_.AddOffset(Field::VT_ATTRIBUTES, attributes); 580 } 581 void add_documentation(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> documentation) { 582 fbb_.AddOffset(Field::VT_DOCUMENTATION, documentation); 583 } 584 explicit FieldBuilder(flatbuffers::FlatBufferBuilder &_fbb) 585 : fbb_(_fbb) { 586 start_ = fbb_.StartTable(); 587 } 588 FieldBuilder &operator=(const FieldBuilder &); 589 flatbuffers::Offset<Field> Finish() { 590 const auto end = fbb_.EndTable(start_); 591 auto o = flatbuffers::Offset<Field>(end); 592 fbb_.Required(o, Field::VT_NAME); 593 fbb_.Required(o, Field::VT_TYPE); 594 return o; 595 } 596 }; 597 598 inline flatbuffers::Offset<Field> CreateField( 599 flatbuffers::FlatBufferBuilder &_fbb, 600 flatbuffers::Offset<flatbuffers::String> name = 0, 601 flatbuffers::Offset<Type> type = 0, 602 uint16_t id = 0, 603 uint16_t offset = 0, 604 int64_t default_integer = 0, 605 double default_real = 0.0, 606 bool deprecated = false, 607 bool required = false, 608 bool key = false, 609 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<KeyValue>>> attributes = 0, 610 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> documentation = 0) { 611 FieldBuilder builder_(_fbb); 612 builder_.add_default_real(default_real); 613 builder_.add_default_integer(default_integer); 614 builder_.add_documentation(documentation); 615 builder_.add_attributes(attributes); 616 builder_.add_type(type); 617 builder_.add_name(name); 618 builder_.add_offset(offset); 619 builder_.add_id(id); 620 builder_.add_key(key); 621 builder_.add_required(required); 622 builder_.add_deprecated(deprecated); 623 return builder_.Finish(); 624 } 625 626 inline flatbuffers::Offset<Field> CreateFieldDirect( 627 flatbuffers::FlatBufferBuilder &_fbb, 628 const char *name = nullptr, 629 flatbuffers::Offset<Type> type = 0, 630 uint16_t id = 0, 631 uint16_t offset = 0, 632 int64_t default_integer = 0, 633 double default_real = 0.0, 634 bool deprecated = false, 635 bool required = false, 636 bool key = false, 637 const std::vector<flatbuffers::Offset<KeyValue>> *attributes = nullptr, 638 const std::vector<flatbuffers::Offset<flatbuffers::String>> *documentation = nullptr) { 639 auto name__ = name ? _fbb.CreateString(name) : 0; 640 auto attributes__ = attributes ? _fbb.CreateVector<flatbuffers::Offset<KeyValue>>(*attributes) : 0; 641 auto documentation__ = documentation ? _fbb.CreateVector<flatbuffers::Offset<flatbuffers::String>>(*documentation) : 0; 642 return reflection::CreateField( 643 _fbb, 644 name__, 645 type, 646 id, 647 offset, 648 default_integer, 649 default_real, 650 deprecated, 651 required, 652 key, 653 attributes__, 654 documentation__); 655 } 656 657 struct Object FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { 658 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { 659 VT_NAME = 4, 660 VT_FIELDS = 6, 661 VT_IS_STRUCT = 8, 662 VT_MINALIGN = 10, 663 VT_BYTESIZE = 12, 664 VT_ATTRIBUTES = 14, 665 VT_DOCUMENTATION = 16 666 }; 667 const flatbuffers::String *name() const { 668 return GetPointer<const flatbuffers::String *>(VT_NAME); 669 } 670 bool KeyCompareLessThan(const Object *o) const { 671 return *name() < *o->name(); 672 } 673 int KeyCompareWithValue(const char *val) const { 674 return strcmp(name()->c_str(), val); 675 } 676 const flatbuffers::Vector<flatbuffers::Offset<Field>> *fields() const { 677 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<Field>> *>(VT_FIELDS); 678 } 679 bool is_struct() const { 680 return GetField<uint8_t>(VT_IS_STRUCT, 0) != 0; 681 } 682 int32_t minalign() const { 683 return GetField<int32_t>(VT_MINALIGN, 0); 684 } 685 int32_t bytesize() const { 686 return GetField<int32_t>(VT_BYTESIZE, 0); 687 } 688 const flatbuffers::Vector<flatbuffers::Offset<KeyValue>> *attributes() const { 689 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<KeyValue>> *>(VT_ATTRIBUTES); 690 } 691 const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *documentation() const { 692 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *>(VT_DOCUMENTATION); 693 } 694 bool Verify(flatbuffers::Verifier &verifier) const { 695 return VerifyTableStart(verifier) && 696 VerifyOffsetRequired(verifier, VT_NAME) && 697 verifier.VerifyString(name()) && 698 VerifyOffsetRequired(verifier, VT_FIELDS) && 699 verifier.VerifyVector(fields()) && 700 verifier.VerifyVectorOfTables(fields()) && 701 VerifyField<uint8_t>(verifier, VT_IS_STRUCT) && 702 VerifyField<int32_t>(verifier, VT_MINALIGN) && 703 VerifyField<int32_t>(verifier, VT_BYTESIZE) && 704 VerifyOffset(verifier, VT_ATTRIBUTES) && 705 verifier.VerifyVector(attributes()) && 706 verifier.VerifyVectorOfTables(attributes()) && 707 VerifyOffset(verifier, VT_DOCUMENTATION) && 708 verifier.VerifyVector(documentation()) && 709 verifier.VerifyVectorOfStrings(documentation()) && 710 verifier.EndTable(); 711 } 712 }; 713 714 struct ObjectBuilder { 715 flatbuffers::FlatBufferBuilder &fbb_; 716 flatbuffers::uoffset_t start_; 717 void add_name(flatbuffers::Offset<flatbuffers::String> name) { 718 fbb_.AddOffset(Object::VT_NAME, name); 719 } 720 void add_fields(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<Field>>> fields) { 721 fbb_.AddOffset(Object::VT_FIELDS, fields); 722 } 723 void add_is_struct(bool is_struct) { 724 fbb_.AddElement<uint8_t>(Object::VT_IS_STRUCT, static_cast<uint8_t>(is_struct), 0); 725 } 726 void add_minalign(int32_t minalign) { 727 fbb_.AddElement<int32_t>(Object::VT_MINALIGN, minalign, 0); 728 } 729 void add_bytesize(int32_t bytesize) { 730 fbb_.AddElement<int32_t>(Object::VT_BYTESIZE, bytesize, 0); 731 } 732 void add_attributes(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<KeyValue>>> attributes) { 733 fbb_.AddOffset(Object::VT_ATTRIBUTES, attributes); 734 } 735 void add_documentation(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> documentation) { 736 fbb_.AddOffset(Object::VT_DOCUMENTATION, documentation); 737 } 738 explicit ObjectBuilder(flatbuffers::FlatBufferBuilder &_fbb) 739 : fbb_(_fbb) { 740 start_ = fbb_.StartTable(); 741 } 742 ObjectBuilder &operator=(const ObjectBuilder &); 743 flatbuffers::Offset<Object> Finish() { 744 const auto end = fbb_.EndTable(start_); 745 auto o = flatbuffers::Offset<Object>(end); 746 fbb_.Required(o, Object::VT_NAME); 747 fbb_.Required(o, Object::VT_FIELDS); 748 return o; 749 } 750 }; 751 752 inline flatbuffers::Offset<Object> CreateObject( 753 flatbuffers::FlatBufferBuilder &_fbb, 754 flatbuffers::Offset<flatbuffers::String> name = 0, 755 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<Field>>> fields = 0, 756 bool is_struct = false, 757 int32_t minalign = 0, 758 int32_t bytesize = 0, 759 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<KeyValue>>> attributes = 0, 760 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> documentation = 0) { 761 ObjectBuilder builder_(_fbb); 762 builder_.add_documentation(documentation); 763 builder_.add_attributes(attributes); 764 builder_.add_bytesize(bytesize); 765 builder_.add_minalign(minalign); 766 builder_.add_fields(fields); 767 builder_.add_name(name); 768 builder_.add_is_struct(is_struct); 769 return builder_.Finish(); 770 } 771 772 inline flatbuffers::Offset<Object> CreateObjectDirect( 773 flatbuffers::FlatBufferBuilder &_fbb, 774 const char *name = nullptr, 775 const std::vector<flatbuffers::Offset<Field>> *fields = nullptr, 776 bool is_struct = false, 777 int32_t minalign = 0, 778 int32_t bytesize = 0, 779 const std::vector<flatbuffers::Offset<KeyValue>> *attributes = nullptr, 780 const std::vector<flatbuffers::Offset<flatbuffers::String>> *documentation = nullptr) { 781 auto name__ = name ? _fbb.CreateString(name) : 0; 782 auto fields__ = fields ? _fbb.CreateVector<flatbuffers::Offset<Field>>(*fields) : 0; 783 auto attributes__ = attributes ? _fbb.CreateVector<flatbuffers::Offset<KeyValue>>(*attributes) : 0; 784 auto documentation__ = documentation ? _fbb.CreateVector<flatbuffers::Offset<flatbuffers::String>>(*documentation) : 0; 785 return reflection::CreateObject( 786 _fbb, 787 name__, 788 fields__, 789 is_struct, 790 minalign, 791 bytesize, 792 attributes__, 793 documentation__); 794 } 795 796 struct RPCCall FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { 797 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { 798 VT_NAME = 4, 799 VT_REQUEST = 6, 800 VT_RESPONSE = 8, 801 VT_ATTRIBUTES = 10, 802 VT_DOCUMENTATION = 12 803 }; 804 const flatbuffers::String *name() const { 805 return GetPointer<const flatbuffers::String *>(VT_NAME); 806 } 807 bool KeyCompareLessThan(const RPCCall *o) const { 808 return *name() < *o->name(); 809 } 810 int KeyCompareWithValue(const char *val) const { 811 return strcmp(name()->c_str(), val); 812 } 813 const Object *request() const { 814 return GetPointer<const Object *>(VT_REQUEST); 815 } 816 const Object *response() const { 817 return GetPointer<const Object *>(VT_RESPONSE); 818 } 819 const flatbuffers::Vector<flatbuffers::Offset<KeyValue>> *attributes() const { 820 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<KeyValue>> *>(VT_ATTRIBUTES); 821 } 822 const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *documentation() const { 823 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *>(VT_DOCUMENTATION); 824 } 825 bool Verify(flatbuffers::Verifier &verifier) const { 826 return VerifyTableStart(verifier) && 827 VerifyOffsetRequired(verifier, VT_NAME) && 828 verifier.VerifyString(name()) && 829 VerifyOffsetRequired(verifier, VT_REQUEST) && 830 verifier.VerifyTable(request()) && 831 VerifyOffsetRequired(verifier, VT_RESPONSE) && 832 verifier.VerifyTable(response()) && 833 VerifyOffset(verifier, VT_ATTRIBUTES) && 834 verifier.VerifyVector(attributes()) && 835 verifier.VerifyVectorOfTables(attributes()) && 836 VerifyOffset(verifier, VT_DOCUMENTATION) && 837 verifier.VerifyVector(documentation()) && 838 verifier.VerifyVectorOfStrings(documentation()) && 839 verifier.EndTable(); 840 } 841 }; 842 843 struct RPCCallBuilder { 844 flatbuffers::FlatBufferBuilder &fbb_; 845 flatbuffers::uoffset_t start_; 846 void add_name(flatbuffers::Offset<flatbuffers::String> name) { 847 fbb_.AddOffset(RPCCall::VT_NAME, name); 848 } 849 void add_request(flatbuffers::Offset<Object> request) { 850 fbb_.AddOffset(RPCCall::VT_REQUEST, request); 851 } 852 void add_response(flatbuffers::Offset<Object> response) { 853 fbb_.AddOffset(RPCCall::VT_RESPONSE, response); 854 } 855 void add_attributes(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<KeyValue>>> attributes) { 856 fbb_.AddOffset(RPCCall::VT_ATTRIBUTES, attributes); 857 } 858 void add_documentation(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> documentation) { 859 fbb_.AddOffset(RPCCall::VT_DOCUMENTATION, documentation); 860 } 861 explicit RPCCallBuilder(flatbuffers::FlatBufferBuilder &_fbb) 862 : fbb_(_fbb) { 863 start_ = fbb_.StartTable(); 864 } 865 RPCCallBuilder &operator=(const RPCCallBuilder &); 866 flatbuffers::Offset<RPCCall> Finish() { 867 const auto end = fbb_.EndTable(start_); 868 auto o = flatbuffers::Offset<RPCCall>(end); 869 fbb_.Required(o, RPCCall::VT_NAME); 870 fbb_.Required(o, RPCCall::VT_REQUEST); 871 fbb_.Required(o, RPCCall::VT_RESPONSE); 872 return o; 873 } 874 }; 875 876 inline flatbuffers::Offset<RPCCall> CreateRPCCall( 877 flatbuffers::FlatBufferBuilder &_fbb, 878 flatbuffers::Offset<flatbuffers::String> name = 0, 879 flatbuffers::Offset<Object> request = 0, 880 flatbuffers::Offset<Object> response = 0, 881 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<KeyValue>>> attributes = 0, 882 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> documentation = 0) { 883 RPCCallBuilder builder_(_fbb); 884 builder_.add_documentation(documentation); 885 builder_.add_attributes(attributes); 886 builder_.add_response(response); 887 builder_.add_request(request); 888 builder_.add_name(name); 889 return builder_.Finish(); 890 } 891 892 inline flatbuffers::Offset<RPCCall> CreateRPCCallDirect( 893 flatbuffers::FlatBufferBuilder &_fbb, 894 const char *name = nullptr, 895 flatbuffers::Offset<Object> request = 0, 896 flatbuffers::Offset<Object> response = 0, 897 const std::vector<flatbuffers::Offset<KeyValue>> *attributes = nullptr, 898 const std::vector<flatbuffers::Offset<flatbuffers::String>> *documentation = nullptr) { 899 auto name__ = name ? _fbb.CreateString(name) : 0; 900 auto attributes__ = attributes ? _fbb.CreateVector<flatbuffers::Offset<KeyValue>>(*attributes) : 0; 901 auto documentation__ = documentation ? _fbb.CreateVector<flatbuffers::Offset<flatbuffers::String>>(*documentation) : 0; 902 return reflection::CreateRPCCall( 903 _fbb, 904 name__, 905 request, 906 response, 907 attributes__, 908 documentation__); 909 } 910 911 struct Service FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { 912 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { 913 VT_NAME = 4, 914 VT_CALLS = 6, 915 VT_ATTRIBUTES = 8, 916 VT_DOCUMENTATION = 10 917 }; 918 const flatbuffers::String *name() const { 919 return GetPointer<const flatbuffers::String *>(VT_NAME); 920 } 921 bool KeyCompareLessThan(const Service *o) const { 922 return *name() < *o->name(); 923 } 924 int KeyCompareWithValue(const char *val) const { 925 return strcmp(name()->c_str(), val); 926 } 927 const flatbuffers::Vector<flatbuffers::Offset<RPCCall>> *calls() const { 928 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<RPCCall>> *>(VT_CALLS); 929 } 930 const flatbuffers::Vector<flatbuffers::Offset<KeyValue>> *attributes() const { 931 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<KeyValue>> *>(VT_ATTRIBUTES); 932 } 933 const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *documentation() const { 934 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *>(VT_DOCUMENTATION); 935 } 936 bool Verify(flatbuffers::Verifier &verifier) const { 937 return VerifyTableStart(verifier) && 938 VerifyOffsetRequired(verifier, VT_NAME) && 939 verifier.VerifyString(name()) && 940 VerifyOffset(verifier, VT_CALLS) && 941 verifier.VerifyVector(calls()) && 942 verifier.VerifyVectorOfTables(calls()) && 943 VerifyOffset(verifier, VT_ATTRIBUTES) && 944 verifier.VerifyVector(attributes()) && 945 verifier.VerifyVectorOfTables(attributes()) && 946 VerifyOffset(verifier, VT_DOCUMENTATION) && 947 verifier.VerifyVector(documentation()) && 948 verifier.VerifyVectorOfStrings(documentation()) && 949 verifier.EndTable(); 950 } 951 }; 952 953 struct ServiceBuilder { 954 flatbuffers::FlatBufferBuilder &fbb_; 955 flatbuffers::uoffset_t start_; 956 void add_name(flatbuffers::Offset<flatbuffers::String> name) { 957 fbb_.AddOffset(Service::VT_NAME, name); 958 } 959 void add_calls(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<RPCCall>>> calls) { 960 fbb_.AddOffset(Service::VT_CALLS, calls); 961 } 962 void add_attributes(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<KeyValue>>> attributes) { 963 fbb_.AddOffset(Service::VT_ATTRIBUTES, attributes); 964 } 965 void add_documentation(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> documentation) { 966 fbb_.AddOffset(Service::VT_DOCUMENTATION, documentation); 967 } 968 explicit ServiceBuilder(flatbuffers::FlatBufferBuilder &_fbb) 969 : fbb_(_fbb) { 970 start_ = fbb_.StartTable(); 971 } 972 ServiceBuilder &operator=(const ServiceBuilder &); 973 flatbuffers::Offset<Service> Finish() { 974 const auto end = fbb_.EndTable(start_); 975 auto o = flatbuffers::Offset<Service>(end); 976 fbb_.Required(o, Service::VT_NAME); 977 return o; 978 } 979 }; 980 981 inline flatbuffers::Offset<Service> CreateService( 982 flatbuffers::FlatBufferBuilder &_fbb, 983 flatbuffers::Offset<flatbuffers::String> name = 0, 984 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<RPCCall>>> calls = 0, 985 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<KeyValue>>> attributes = 0, 986 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> documentation = 0) { 987 ServiceBuilder builder_(_fbb); 988 builder_.add_documentation(documentation); 989 builder_.add_attributes(attributes); 990 builder_.add_calls(calls); 991 builder_.add_name(name); 992 return builder_.Finish(); 993 } 994 995 inline flatbuffers::Offset<Service> CreateServiceDirect( 996 flatbuffers::FlatBufferBuilder &_fbb, 997 const char *name = nullptr, 998 const std::vector<flatbuffers::Offset<RPCCall>> *calls = nullptr, 999 const std::vector<flatbuffers::Offset<KeyValue>> *attributes = nullptr, 1000 const std::vector<flatbuffers::Offset<flatbuffers::String>> *documentation = nullptr) { 1001 auto name__ = name ? _fbb.CreateString(name) : 0; 1002 auto calls__ = calls ? _fbb.CreateVector<flatbuffers::Offset<RPCCall>>(*calls) : 0; 1003 auto attributes__ = attributes ? _fbb.CreateVector<flatbuffers::Offset<KeyValue>>(*attributes) : 0; 1004 auto documentation__ = documentation ? _fbb.CreateVector<flatbuffers::Offset<flatbuffers::String>>(*documentation) : 0; 1005 return reflection::CreateService( 1006 _fbb, 1007 name__, 1008 calls__, 1009 attributes__, 1010 documentation__); 1011 } 1012 1013 struct Schema FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { 1014 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { 1015 VT_OBJECTS = 4, 1016 VT_ENUMS = 6, 1017 VT_FILE_IDENT = 8, 1018 VT_FILE_EXT = 10, 1019 VT_ROOT_TABLE = 12, 1020 VT_SERVICES = 14 1021 }; 1022 const flatbuffers::Vector<flatbuffers::Offset<Object>> *objects() const { 1023 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<Object>> *>(VT_OBJECTS); 1024 } 1025 const flatbuffers::Vector<flatbuffers::Offset<Enum>> *enums() const { 1026 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<Enum>> *>(VT_ENUMS); 1027 } 1028 const flatbuffers::String *file_ident() const { 1029 return GetPointer<const flatbuffers::String *>(VT_FILE_IDENT); 1030 } 1031 const flatbuffers::String *file_ext() const { 1032 return GetPointer<const flatbuffers::String *>(VT_FILE_EXT); 1033 } 1034 const Object *root_table() const { 1035 return GetPointer<const Object *>(VT_ROOT_TABLE); 1036 } 1037 const flatbuffers::Vector<flatbuffers::Offset<Service>> *services() const { 1038 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<Service>> *>(VT_SERVICES); 1039 } 1040 bool Verify(flatbuffers::Verifier &verifier) const { 1041 return VerifyTableStart(verifier) && 1042 VerifyOffsetRequired(verifier, VT_OBJECTS) && 1043 verifier.VerifyVector(objects()) && 1044 verifier.VerifyVectorOfTables(objects()) && 1045 VerifyOffsetRequired(verifier, VT_ENUMS) && 1046 verifier.VerifyVector(enums()) && 1047 verifier.VerifyVectorOfTables(enums()) && 1048 VerifyOffset(verifier, VT_FILE_IDENT) && 1049 verifier.VerifyString(file_ident()) && 1050 VerifyOffset(verifier, VT_FILE_EXT) && 1051 verifier.VerifyString(file_ext()) && 1052 VerifyOffset(verifier, VT_ROOT_TABLE) && 1053 verifier.VerifyTable(root_table()) && 1054 VerifyOffset(verifier, VT_SERVICES) && 1055 verifier.VerifyVector(services()) && 1056 verifier.VerifyVectorOfTables(services()) && 1057 verifier.EndTable(); 1058 } 1059 }; 1060 1061 struct SchemaBuilder { 1062 flatbuffers::FlatBufferBuilder &fbb_; 1063 flatbuffers::uoffset_t start_; 1064 void add_objects(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<Object>>> objects) { 1065 fbb_.AddOffset(Schema::VT_OBJECTS, objects); 1066 } 1067 void add_enums(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<Enum>>> enums) { 1068 fbb_.AddOffset(Schema::VT_ENUMS, enums); 1069 } 1070 void add_file_ident(flatbuffers::Offset<flatbuffers::String> file_ident) { 1071 fbb_.AddOffset(Schema::VT_FILE_IDENT, file_ident); 1072 } 1073 void add_file_ext(flatbuffers::Offset<flatbuffers::String> file_ext) { 1074 fbb_.AddOffset(Schema::VT_FILE_EXT, file_ext); 1075 } 1076 void add_root_table(flatbuffers::Offset<Object> root_table) { 1077 fbb_.AddOffset(Schema::VT_ROOT_TABLE, root_table); 1078 } 1079 void add_services(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<Service>>> services) { 1080 fbb_.AddOffset(Schema::VT_SERVICES, services); 1081 } 1082 explicit SchemaBuilder(flatbuffers::FlatBufferBuilder &_fbb) 1083 : fbb_(_fbb) { 1084 start_ = fbb_.StartTable(); 1085 } 1086 SchemaBuilder &operator=(const SchemaBuilder &); 1087 flatbuffers::Offset<Schema> Finish() { 1088 const auto end = fbb_.EndTable(start_); 1089 auto o = flatbuffers::Offset<Schema>(end); 1090 fbb_.Required(o, Schema::VT_OBJECTS); 1091 fbb_.Required(o, Schema::VT_ENUMS); 1092 return o; 1093 } 1094 }; 1095 1096 inline flatbuffers::Offset<Schema> CreateSchema( 1097 flatbuffers::FlatBufferBuilder &_fbb, 1098 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<Object>>> objects = 0, 1099 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<Enum>>> enums = 0, 1100 flatbuffers::Offset<flatbuffers::String> file_ident = 0, 1101 flatbuffers::Offset<flatbuffers::String> file_ext = 0, 1102 flatbuffers::Offset<Object> root_table = 0, 1103 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<Service>>> services = 0) { 1104 SchemaBuilder builder_(_fbb); 1105 builder_.add_services(services); 1106 builder_.add_root_table(root_table); 1107 builder_.add_file_ext(file_ext); 1108 builder_.add_file_ident(file_ident); 1109 builder_.add_enums(enums); 1110 builder_.add_objects(objects); 1111 return builder_.Finish(); 1112 } 1113 1114 inline flatbuffers::Offset<Schema> CreateSchemaDirect( 1115 flatbuffers::FlatBufferBuilder &_fbb, 1116 const std::vector<flatbuffers::Offset<Object>> *objects = nullptr, 1117 const std::vector<flatbuffers::Offset<Enum>> *enums = nullptr, 1118 const char *file_ident = nullptr, 1119 const char *file_ext = nullptr, 1120 flatbuffers::Offset<Object> root_table = 0, 1121 const std::vector<flatbuffers::Offset<Service>> *services = nullptr) { 1122 auto objects__ = objects ? _fbb.CreateVector<flatbuffers::Offset<Object>>(*objects) : 0; 1123 auto enums__ = enums ? _fbb.CreateVector<flatbuffers::Offset<Enum>>(*enums) : 0; 1124 auto file_ident__ = file_ident ? _fbb.CreateString(file_ident) : 0; 1125 auto file_ext__ = file_ext ? _fbb.CreateString(file_ext) : 0; 1126 auto services__ = services ? _fbb.CreateVector<flatbuffers::Offset<Service>>(*services) : 0; 1127 return reflection::CreateSchema( 1128 _fbb, 1129 objects__, 1130 enums__, 1131 file_ident__, 1132 file_ext__, 1133 root_table, 1134 services__); 1135 } 1136 1137 inline const reflection::Schema *GetSchema(const void *buf) { 1138 return flatbuffers::GetRoot<reflection::Schema>(buf); 1139 } 1140 1141 inline const reflection::Schema *GetSizePrefixedSchema(const void *buf) { 1142 return flatbuffers::GetSizePrefixedRoot<reflection::Schema>(buf); 1143 } 1144 1145 inline const char *SchemaIdentifier() { 1146 return "BFBS"; 1147 } 1148 1149 inline bool SchemaBufferHasIdentifier(const void *buf) { 1150 return flatbuffers::BufferHasIdentifier( 1151 buf, SchemaIdentifier()); 1152 } 1153 1154 inline bool VerifySchemaBuffer( 1155 flatbuffers::Verifier &verifier) { 1156 return verifier.VerifyBuffer<reflection::Schema>(SchemaIdentifier()); 1157 } 1158 1159 inline bool VerifySizePrefixedSchemaBuffer( 1160 flatbuffers::Verifier &verifier) { 1161 return verifier.VerifySizePrefixedBuffer<reflection::Schema>(SchemaIdentifier()); 1162 } 1163 1164 inline const char *SchemaExtension() { 1165 return "bfbs"; 1166 } 1167 1168 inline void FinishSchemaBuffer( 1169 flatbuffers::FlatBufferBuilder &fbb, 1170 flatbuffers::Offset<reflection::Schema> root) { 1171 fbb.Finish(root, SchemaIdentifier()); 1172 } 1173 1174 inline void FinishSizePrefixedSchemaBuffer( 1175 flatbuffers::FlatBufferBuilder &fbb, 1176 flatbuffers::Offset<reflection::Schema> root) { 1177 fbb.FinishSizePrefixed(root, SchemaIdentifier()); 1178 } 1179 1180 } // namespace reflection 1181 1182 #endif // FLATBUFFERS_GENERATED_REFLECTION_REFLECTION_H_ 1183