github.com/google/syzkaller@v0.0.0-20240517125934-c0f1611a36d6/executor/_include/flatbuffers/reflection_generated.h (about) 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 // Ensure the included flatbuffers.h is the same version as when this file was 10 // generated, otherwise it may not be compatible. 11 static_assert(FLATBUFFERS_VERSION_MAJOR == 2 && 12 FLATBUFFERS_VERSION_MINOR == 0 && 13 FLATBUFFERS_VERSION_REVISION == 8, 14 "Non-compatible flatbuffers version included"); 15 16 namespace reflection { 17 18 struct Type; 19 struct TypeBuilder; 20 21 struct KeyValue; 22 struct KeyValueBuilder; 23 24 struct EnumVal; 25 struct EnumValBuilder; 26 27 struct Enum; 28 struct EnumBuilder; 29 30 struct Field; 31 struct FieldBuilder; 32 33 struct Object; 34 struct ObjectBuilder; 35 36 struct RPCCall; 37 struct RPCCallBuilder; 38 39 struct Service; 40 struct ServiceBuilder; 41 42 struct SchemaFile; 43 struct SchemaFileBuilder; 44 45 struct Schema; 46 struct SchemaBuilder; 47 48 enum BaseType { 49 None = 0, 50 UType = 1, 51 Bool = 2, 52 Byte = 3, 53 UByte = 4, 54 Short = 5, 55 UShort = 6, 56 Int = 7, 57 UInt = 8, 58 Long = 9, 59 ULong = 10, 60 Float = 11, 61 Double = 12, 62 String = 13, 63 Vector = 14, 64 Obj = 15, 65 Union = 16, 66 Array = 17, 67 MaxBaseType = 18 68 }; 69 70 inline const BaseType (&EnumValuesBaseType())[19] { 71 static const BaseType values[] = { 72 None, 73 UType, 74 Bool, 75 Byte, 76 UByte, 77 Short, 78 UShort, 79 Int, 80 UInt, 81 Long, 82 ULong, 83 Float, 84 Double, 85 String, 86 Vector, 87 Obj, 88 Union, 89 Array, 90 MaxBaseType 91 }; 92 return values; 93 } 94 95 inline const char * const *EnumNamesBaseType() { 96 static const char * const names[20] = { 97 "None", 98 "UType", 99 "Bool", 100 "Byte", 101 "UByte", 102 "Short", 103 "UShort", 104 "Int", 105 "UInt", 106 "Long", 107 "ULong", 108 "Float", 109 "Double", 110 "String", 111 "Vector", 112 "Obj", 113 "Union", 114 "Array", 115 "MaxBaseType", 116 nullptr 117 }; 118 return names; 119 } 120 121 inline const char *EnumNameBaseType(BaseType e) { 122 if (flatbuffers::IsOutRange(e, None, MaxBaseType)) return ""; 123 const size_t index = static_cast<size_t>(e); 124 return EnumNamesBaseType()[index]; 125 } 126 127 /// New schema language features that are not supported by old code generators. 128 enum AdvancedFeatures { 129 AdvancedArrayFeatures = 1ULL, 130 AdvancedUnionFeatures = 2ULL, 131 OptionalScalars = 4ULL, 132 DefaultVectorsAndStrings = 8ULL 133 }; 134 135 inline const AdvancedFeatures (&EnumValuesAdvancedFeatures())[4] { 136 static const AdvancedFeatures values[] = { 137 AdvancedArrayFeatures, 138 AdvancedUnionFeatures, 139 OptionalScalars, 140 DefaultVectorsAndStrings 141 }; 142 return values; 143 } 144 145 inline const char * const *EnumNamesAdvancedFeatures() { 146 static const char * const names[9] = { 147 "AdvancedArrayFeatures", 148 "AdvancedUnionFeatures", 149 "", 150 "OptionalScalars", 151 "", 152 "", 153 "", 154 "DefaultVectorsAndStrings", 155 nullptr 156 }; 157 return names; 158 } 159 160 inline const char *EnumNameAdvancedFeatures(AdvancedFeatures e) { 161 if (flatbuffers::IsOutRange(e, AdvancedArrayFeatures, DefaultVectorsAndStrings)) return ""; 162 const size_t index = static_cast<size_t>(e) - static_cast<size_t>(AdvancedArrayFeatures); 163 return EnumNamesAdvancedFeatures()[index]; 164 } 165 166 struct Type FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { 167 typedef TypeBuilder Builder; 168 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { 169 VT_BASE_TYPE = 4, 170 VT_ELEMENT = 6, 171 VT_INDEX = 8, 172 VT_FIXED_LENGTH = 10, 173 VT_BASE_SIZE = 12, 174 VT_ELEMENT_SIZE = 14 175 }; 176 reflection::BaseType base_type() const { 177 return static_cast<reflection::BaseType>(GetField<int8_t>(VT_BASE_TYPE, 0)); 178 } 179 reflection::BaseType element() const { 180 return static_cast<reflection::BaseType>(GetField<int8_t>(VT_ELEMENT, 0)); 181 } 182 int32_t index() const { 183 return GetField<int32_t>(VT_INDEX, -1); 184 } 185 uint16_t fixed_length() const { 186 return GetField<uint16_t>(VT_FIXED_LENGTH, 0); 187 } 188 /// The size (octets) of the `base_type` field. 189 uint32_t base_size() const { 190 return GetField<uint32_t>(VT_BASE_SIZE, 4); 191 } 192 /// The size (octets) of the `element` field, if present. 193 uint32_t element_size() const { 194 return GetField<uint32_t>(VT_ELEMENT_SIZE, 0); 195 } 196 bool Verify(flatbuffers::Verifier &verifier) const { 197 return VerifyTableStart(verifier) && 198 VerifyField<int8_t>(verifier, VT_BASE_TYPE, 1) && 199 VerifyField<int8_t>(verifier, VT_ELEMENT, 1) && 200 VerifyField<int32_t>(verifier, VT_INDEX, 4) && 201 VerifyField<uint16_t>(verifier, VT_FIXED_LENGTH, 2) && 202 VerifyField<uint32_t>(verifier, VT_BASE_SIZE, 4) && 203 VerifyField<uint32_t>(verifier, VT_ELEMENT_SIZE, 4) && 204 verifier.EndTable(); 205 } 206 }; 207 208 struct TypeBuilder { 209 typedef Type Table; 210 flatbuffers::FlatBufferBuilder &fbb_; 211 flatbuffers::uoffset_t start_; 212 void add_base_type(reflection::BaseType base_type) { 213 fbb_.AddElement<int8_t>(Type::VT_BASE_TYPE, static_cast<int8_t>(base_type), 0); 214 } 215 void add_element(reflection::BaseType element) { 216 fbb_.AddElement<int8_t>(Type::VT_ELEMENT, static_cast<int8_t>(element), 0); 217 } 218 void add_index(int32_t index) { 219 fbb_.AddElement<int32_t>(Type::VT_INDEX, index, -1); 220 } 221 void add_fixed_length(uint16_t fixed_length) { 222 fbb_.AddElement<uint16_t>(Type::VT_FIXED_LENGTH, fixed_length, 0); 223 } 224 void add_base_size(uint32_t base_size) { 225 fbb_.AddElement<uint32_t>(Type::VT_BASE_SIZE, base_size, 4); 226 } 227 void add_element_size(uint32_t element_size) { 228 fbb_.AddElement<uint32_t>(Type::VT_ELEMENT_SIZE, element_size, 0); 229 } 230 explicit TypeBuilder(flatbuffers::FlatBufferBuilder &_fbb) 231 : fbb_(_fbb) { 232 start_ = fbb_.StartTable(); 233 } 234 flatbuffers::Offset<Type> Finish() { 235 const auto end = fbb_.EndTable(start_); 236 auto o = flatbuffers::Offset<Type>(end); 237 return o; 238 } 239 }; 240 241 inline flatbuffers::Offset<Type> CreateType( 242 flatbuffers::FlatBufferBuilder &_fbb, 243 reflection::BaseType base_type = reflection::None, 244 reflection::BaseType element = reflection::None, 245 int32_t index = -1, 246 uint16_t fixed_length = 0, 247 uint32_t base_size = 4, 248 uint32_t element_size = 0) { 249 TypeBuilder builder_(_fbb); 250 builder_.add_element_size(element_size); 251 builder_.add_base_size(base_size); 252 builder_.add_index(index); 253 builder_.add_fixed_length(fixed_length); 254 builder_.add_element(element); 255 builder_.add_base_type(base_type); 256 return builder_.Finish(); 257 } 258 259 struct KeyValue FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { 260 typedef KeyValueBuilder Builder; 261 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { 262 VT_KEY = 4, 263 VT_VALUE = 6 264 }; 265 const flatbuffers::String *key() const { 266 return GetPointer<const flatbuffers::String *>(VT_KEY); 267 } 268 bool KeyCompareLessThan(const KeyValue *o) const { 269 return *key() < *o->key(); 270 } 271 int KeyCompareWithValue(const char *_key) const { 272 return strcmp(key()->c_str(), _key); 273 } 274 const flatbuffers::String *value() const { 275 return GetPointer<const flatbuffers::String *>(VT_VALUE); 276 } 277 bool Verify(flatbuffers::Verifier &verifier) const { 278 return VerifyTableStart(verifier) && 279 VerifyOffsetRequired(verifier, VT_KEY) && 280 verifier.VerifyString(key()) && 281 VerifyOffset(verifier, VT_VALUE) && 282 verifier.VerifyString(value()) && 283 verifier.EndTable(); 284 } 285 }; 286 287 struct KeyValueBuilder { 288 typedef KeyValue Table; 289 flatbuffers::FlatBufferBuilder &fbb_; 290 flatbuffers::uoffset_t start_; 291 void add_key(flatbuffers::Offset<flatbuffers::String> key) { 292 fbb_.AddOffset(KeyValue::VT_KEY, key); 293 } 294 void add_value(flatbuffers::Offset<flatbuffers::String> value) { 295 fbb_.AddOffset(KeyValue::VT_VALUE, value); 296 } 297 explicit KeyValueBuilder(flatbuffers::FlatBufferBuilder &_fbb) 298 : fbb_(_fbb) { 299 start_ = fbb_.StartTable(); 300 } 301 flatbuffers::Offset<KeyValue> Finish() { 302 const auto end = fbb_.EndTable(start_); 303 auto o = flatbuffers::Offset<KeyValue>(end); 304 fbb_.Required(o, KeyValue::VT_KEY); 305 return o; 306 } 307 }; 308 309 inline flatbuffers::Offset<KeyValue> CreateKeyValue( 310 flatbuffers::FlatBufferBuilder &_fbb, 311 flatbuffers::Offset<flatbuffers::String> key = 0, 312 flatbuffers::Offset<flatbuffers::String> value = 0) { 313 KeyValueBuilder builder_(_fbb); 314 builder_.add_value(value); 315 builder_.add_key(key); 316 return builder_.Finish(); 317 } 318 319 inline flatbuffers::Offset<KeyValue> CreateKeyValueDirect( 320 flatbuffers::FlatBufferBuilder &_fbb, 321 const char *key = nullptr, 322 const char *value = nullptr) { 323 auto key__ = key ? _fbb.CreateString(key) : 0; 324 auto value__ = value ? _fbb.CreateString(value) : 0; 325 return reflection::CreateKeyValue( 326 _fbb, 327 key__, 328 value__); 329 } 330 331 struct EnumVal FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { 332 typedef EnumValBuilder Builder; 333 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { 334 VT_NAME = 4, 335 VT_VALUE = 6, 336 VT_UNION_TYPE = 10, 337 VT_DOCUMENTATION = 12 338 }; 339 const flatbuffers::String *name() const { 340 return GetPointer<const flatbuffers::String *>(VT_NAME); 341 } 342 int64_t value() const { 343 return GetField<int64_t>(VT_VALUE, 0); 344 } 345 bool KeyCompareLessThan(const EnumVal *o) const { 346 return value() < o->value(); 347 } 348 int KeyCompareWithValue(int64_t _value) const { 349 return static_cast<int>(value() > _value) - static_cast<int>(value() < _value); 350 } 351 const reflection::Type *union_type() const { 352 return GetPointer<const reflection::Type *>(VT_UNION_TYPE); 353 } 354 const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *documentation() const { 355 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *>(VT_DOCUMENTATION); 356 } 357 bool Verify(flatbuffers::Verifier &verifier) const { 358 return VerifyTableStart(verifier) && 359 VerifyOffsetRequired(verifier, VT_NAME) && 360 verifier.VerifyString(name()) && 361 VerifyField<int64_t>(verifier, VT_VALUE, 8) && 362 VerifyOffset(verifier, VT_UNION_TYPE) && 363 verifier.VerifyTable(union_type()) && 364 VerifyOffset(verifier, VT_DOCUMENTATION) && 365 verifier.VerifyVector(documentation()) && 366 verifier.VerifyVectorOfStrings(documentation()) && 367 verifier.EndTable(); 368 } 369 }; 370 371 struct EnumValBuilder { 372 typedef EnumVal Table; 373 flatbuffers::FlatBufferBuilder &fbb_; 374 flatbuffers::uoffset_t start_; 375 void add_name(flatbuffers::Offset<flatbuffers::String> name) { 376 fbb_.AddOffset(EnumVal::VT_NAME, name); 377 } 378 void add_value(int64_t value) { 379 fbb_.AddElement<int64_t>(EnumVal::VT_VALUE, value, 0); 380 } 381 void add_union_type(flatbuffers::Offset<reflection::Type> union_type) { 382 fbb_.AddOffset(EnumVal::VT_UNION_TYPE, union_type); 383 } 384 void add_documentation(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> documentation) { 385 fbb_.AddOffset(EnumVal::VT_DOCUMENTATION, documentation); 386 } 387 explicit EnumValBuilder(flatbuffers::FlatBufferBuilder &_fbb) 388 : fbb_(_fbb) { 389 start_ = fbb_.StartTable(); 390 } 391 flatbuffers::Offset<EnumVal> Finish() { 392 const auto end = fbb_.EndTable(start_); 393 auto o = flatbuffers::Offset<EnumVal>(end); 394 fbb_.Required(o, EnumVal::VT_NAME); 395 return o; 396 } 397 }; 398 399 inline flatbuffers::Offset<EnumVal> CreateEnumVal( 400 flatbuffers::FlatBufferBuilder &_fbb, 401 flatbuffers::Offset<flatbuffers::String> name = 0, 402 int64_t value = 0, 403 flatbuffers::Offset<reflection::Type> union_type = 0, 404 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> documentation = 0) { 405 EnumValBuilder builder_(_fbb); 406 builder_.add_value(value); 407 builder_.add_documentation(documentation); 408 builder_.add_union_type(union_type); 409 builder_.add_name(name); 410 return builder_.Finish(); 411 } 412 413 inline flatbuffers::Offset<EnumVal> CreateEnumValDirect( 414 flatbuffers::FlatBufferBuilder &_fbb, 415 const char *name = nullptr, 416 int64_t value = 0, 417 flatbuffers::Offset<reflection::Type> union_type = 0, 418 const std::vector<flatbuffers::Offset<flatbuffers::String>> *documentation = nullptr) { 419 auto name__ = name ? _fbb.CreateString(name) : 0; 420 auto documentation__ = documentation ? _fbb.CreateVector<flatbuffers::Offset<flatbuffers::String>>(*documentation) : 0; 421 return reflection::CreateEnumVal( 422 _fbb, 423 name__, 424 value, 425 union_type, 426 documentation__); 427 } 428 429 struct Enum FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { 430 typedef EnumBuilder Builder; 431 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { 432 VT_NAME = 4, 433 VT_VALUES = 6, 434 VT_IS_UNION = 8, 435 VT_UNDERLYING_TYPE = 10, 436 VT_ATTRIBUTES = 12, 437 VT_DOCUMENTATION = 14, 438 VT_DECLARATION_FILE = 16 439 }; 440 const flatbuffers::String *name() const { 441 return GetPointer<const flatbuffers::String *>(VT_NAME); 442 } 443 bool KeyCompareLessThan(const Enum *o) const { 444 return *name() < *o->name(); 445 } 446 int KeyCompareWithValue(const char *_name) const { 447 return strcmp(name()->c_str(), _name); 448 } 449 const flatbuffers::Vector<flatbuffers::Offset<reflection::EnumVal>> *values() const { 450 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<reflection::EnumVal>> *>(VT_VALUES); 451 } 452 bool is_union() const { 453 return GetField<uint8_t>(VT_IS_UNION, 0) != 0; 454 } 455 const reflection::Type *underlying_type() const { 456 return GetPointer<const reflection::Type *>(VT_UNDERLYING_TYPE); 457 } 458 const flatbuffers::Vector<flatbuffers::Offset<reflection::KeyValue>> *attributes() const { 459 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<reflection::KeyValue>> *>(VT_ATTRIBUTES); 460 } 461 const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *documentation() const { 462 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *>(VT_DOCUMENTATION); 463 } 464 /// File that this Enum is declared in. 465 const flatbuffers::String *declaration_file() const { 466 return GetPointer<const flatbuffers::String *>(VT_DECLARATION_FILE); 467 } 468 bool Verify(flatbuffers::Verifier &verifier) const { 469 return VerifyTableStart(verifier) && 470 VerifyOffsetRequired(verifier, VT_NAME) && 471 verifier.VerifyString(name()) && 472 VerifyOffsetRequired(verifier, VT_VALUES) && 473 verifier.VerifyVector(values()) && 474 verifier.VerifyVectorOfTables(values()) && 475 VerifyField<uint8_t>(verifier, VT_IS_UNION, 1) && 476 VerifyOffsetRequired(verifier, VT_UNDERLYING_TYPE) && 477 verifier.VerifyTable(underlying_type()) && 478 VerifyOffset(verifier, VT_ATTRIBUTES) && 479 verifier.VerifyVector(attributes()) && 480 verifier.VerifyVectorOfTables(attributes()) && 481 VerifyOffset(verifier, VT_DOCUMENTATION) && 482 verifier.VerifyVector(documentation()) && 483 verifier.VerifyVectorOfStrings(documentation()) && 484 VerifyOffset(verifier, VT_DECLARATION_FILE) && 485 verifier.VerifyString(declaration_file()) && 486 verifier.EndTable(); 487 } 488 }; 489 490 struct EnumBuilder { 491 typedef Enum Table; 492 flatbuffers::FlatBufferBuilder &fbb_; 493 flatbuffers::uoffset_t start_; 494 void add_name(flatbuffers::Offset<flatbuffers::String> name) { 495 fbb_.AddOffset(Enum::VT_NAME, name); 496 } 497 void add_values(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<reflection::EnumVal>>> values) { 498 fbb_.AddOffset(Enum::VT_VALUES, values); 499 } 500 void add_is_union(bool is_union) { 501 fbb_.AddElement<uint8_t>(Enum::VT_IS_UNION, static_cast<uint8_t>(is_union), 0); 502 } 503 void add_underlying_type(flatbuffers::Offset<reflection::Type> underlying_type) { 504 fbb_.AddOffset(Enum::VT_UNDERLYING_TYPE, underlying_type); 505 } 506 void add_attributes(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<reflection::KeyValue>>> attributes) { 507 fbb_.AddOffset(Enum::VT_ATTRIBUTES, attributes); 508 } 509 void add_documentation(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> documentation) { 510 fbb_.AddOffset(Enum::VT_DOCUMENTATION, documentation); 511 } 512 void add_declaration_file(flatbuffers::Offset<flatbuffers::String> declaration_file) { 513 fbb_.AddOffset(Enum::VT_DECLARATION_FILE, declaration_file); 514 } 515 explicit EnumBuilder(flatbuffers::FlatBufferBuilder &_fbb) 516 : fbb_(_fbb) { 517 start_ = fbb_.StartTable(); 518 } 519 flatbuffers::Offset<Enum> Finish() { 520 const auto end = fbb_.EndTable(start_); 521 auto o = flatbuffers::Offset<Enum>(end); 522 fbb_.Required(o, Enum::VT_NAME); 523 fbb_.Required(o, Enum::VT_VALUES); 524 fbb_.Required(o, Enum::VT_UNDERLYING_TYPE); 525 return o; 526 } 527 }; 528 529 inline flatbuffers::Offset<Enum> CreateEnum( 530 flatbuffers::FlatBufferBuilder &_fbb, 531 flatbuffers::Offset<flatbuffers::String> name = 0, 532 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<reflection::EnumVal>>> values = 0, 533 bool is_union = false, 534 flatbuffers::Offset<reflection::Type> underlying_type = 0, 535 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<reflection::KeyValue>>> attributes = 0, 536 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> documentation = 0, 537 flatbuffers::Offset<flatbuffers::String> declaration_file = 0) { 538 EnumBuilder builder_(_fbb); 539 builder_.add_declaration_file(declaration_file); 540 builder_.add_documentation(documentation); 541 builder_.add_attributes(attributes); 542 builder_.add_underlying_type(underlying_type); 543 builder_.add_values(values); 544 builder_.add_name(name); 545 builder_.add_is_union(is_union); 546 return builder_.Finish(); 547 } 548 549 inline flatbuffers::Offset<Enum> CreateEnumDirect( 550 flatbuffers::FlatBufferBuilder &_fbb, 551 const char *name = nullptr, 552 std::vector<flatbuffers::Offset<reflection::EnumVal>> *values = nullptr, 553 bool is_union = false, 554 flatbuffers::Offset<reflection::Type> underlying_type = 0, 555 std::vector<flatbuffers::Offset<reflection::KeyValue>> *attributes = nullptr, 556 const std::vector<flatbuffers::Offset<flatbuffers::String>> *documentation = nullptr, 557 const char *declaration_file = nullptr) { 558 auto name__ = name ? _fbb.CreateString(name) : 0; 559 auto values__ = values ? _fbb.CreateVectorOfSortedTables<reflection::EnumVal>(values) : 0; 560 auto attributes__ = attributes ? _fbb.CreateVectorOfSortedTables<reflection::KeyValue>(attributes) : 0; 561 auto documentation__ = documentation ? _fbb.CreateVector<flatbuffers::Offset<flatbuffers::String>>(*documentation) : 0; 562 auto declaration_file__ = declaration_file ? _fbb.CreateString(declaration_file) : 0; 563 return reflection::CreateEnum( 564 _fbb, 565 name__, 566 values__, 567 is_union, 568 underlying_type, 569 attributes__, 570 documentation__, 571 declaration_file__); 572 } 573 574 struct Field FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { 575 typedef FieldBuilder Builder; 576 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { 577 VT_NAME = 4, 578 VT_TYPE = 6, 579 VT_ID = 8, 580 VT_OFFSET = 10, 581 VT_DEFAULT_INTEGER = 12, 582 VT_DEFAULT_REAL = 14, 583 VT_DEPRECATED = 16, 584 VT_REQUIRED = 18, 585 VT_KEY = 20, 586 VT_ATTRIBUTES = 22, 587 VT_DOCUMENTATION = 24, 588 VT_OPTIONAL = 26, 589 VT_PADDING = 28 590 }; 591 const flatbuffers::String *name() const { 592 return GetPointer<const flatbuffers::String *>(VT_NAME); 593 } 594 bool KeyCompareLessThan(const Field *o) const { 595 return *name() < *o->name(); 596 } 597 int KeyCompareWithValue(const char *_name) const { 598 return strcmp(name()->c_str(), _name); 599 } 600 const reflection::Type *type() const { 601 return GetPointer<const reflection::Type *>(VT_TYPE); 602 } 603 uint16_t id() const { 604 return GetField<uint16_t>(VT_ID, 0); 605 } 606 uint16_t offset() const { 607 return GetField<uint16_t>(VT_OFFSET, 0); 608 } 609 int64_t default_integer() const { 610 return GetField<int64_t>(VT_DEFAULT_INTEGER, 0); 611 } 612 double default_real() const { 613 return GetField<double>(VT_DEFAULT_REAL, 0.0); 614 } 615 bool deprecated() const { 616 return GetField<uint8_t>(VT_DEPRECATED, 0) != 0; 617 } 618 bool required() const { 619 return GetField<uint8_t>(VT_REQUIRED, 0) != 0; 620 } 621 bool key() const { 622 return GetField<uint8_t>(VT_KEY, 0) != 0; 623 } 624 const flatbuffers::Vector<flatbuffers::Offset<reflection::KeyValue>> *attributes() const { 625 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<reflection::KeyValue>> *>(VT_ATTRIBUTES); 626 } 627 const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *documentation() const { 628 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *>(VT_DOCUMENTATION); 629 } 630 bool optional() const { 631 return GetField<uint8_t>(VT_OPTIONAL, 0) != 0; 632 } 633 /// Number of padding octets to always add after this field. Structs only. 634 uint16_t padding() const { 635 return GetField<uint16_t>(VT_PADDING, 0); 636 } 637 bool Verify(flatbuffers::Verifier &verifier) const { 638 return VerifyTableStart(verifier) && 639 VerifyOffsetRequired(verifier, VT_NAME) && 640 verifier.VerifyString(name()) && 641 VerifyOffsetRequired(verifier, VT_TYPE) && 642 verifier.VerifyTable(type()) && 643 VerifyField<uint16_t>(verifier, VT_ID, 2) && 644 VerifyField<uint16_t>(verifier, VT_OFFSET, 2) && 645 VerifyField<int64_t>(verifier, VT_DEFAULT_INTEGER, 8) && 646 VerifyField<double>(verifier, VT_DEFAULT_REAL, 8) && 647 VerifyField<uint8_t>(verifier, VT_DEPRECATED, 1) && 648 VerifyField<uint8_t>(verifier, VT_REQUIRED, 1) && 649 VerifyField<uint8_t>(verifier, VT_KEY, 1) && 650 VerifyOffset(verifier, VT_ATTRIBUTES) && 651 verifier.VerifyVector(attributes()) && 652 verifier.VerifyVectorOfTables(attributes()) && 653 VerifyOffset(verifier, VT_DOCUMENTATION) && 654 verifier.VerifyVector(documentation()) && 655 verifier.VerifyVectorOfStrings(documentation()) && 656 VerifyField<uint8_t>(verifier, VT_OPTIONAL, 1) && 657 VerifyField<uint16_t>(verifier, VT_PADDING, 2) && 658 verifier.EndTable(); 659 } 660 }; 661 662 struct FieldBuilder { 663 typedef Field Table; 664 flatbuffers::FlatBufferBuilder &fbb_; 665 flatbuffers::uoffset_t start_; 666 void add_name(flatbuffers::Offset<flatbuffers::String> name) { 667 fbb_.AddOffset(Field::VT_NAME, name); 668 } 669 void add_type(flatbuffers::Offset<reflection::Type> type) { 670 fbb_.AddOffset(Field::VT_TYPE, type); 671 } 672 void add_id(uint16_t id) { 673 fbb_.AddElement<uint16_t>(Field::VT_ID, id, 0); 674 } 675 void add_offset(uint16_t offset) { 676 fbb_.AddElement<uint16_t>(Field::VT_OFFSET, offset, 0); 677 } 678 void add_default_integer(int64_t default_integer) { 679 fbb_.AddElement<int64_t>(Field::VT_DEFAULT_INTEGER, default_integer, 0); 680 } 681 void add_default_real(double default_real) { 682 fbb_.AddElement<double>(Field::VT_DEFAULT_REAL, default_real, 0.0); 683 } 684 void add_deprecated(bool deprecated) { 685 fbb_.AddElement<uint8_t>(Field::VT_DEPRECATED, static_cast<uint8_t>(deprecated), 0); 686 } 687 void add_required(bool required) { 688 fbb_.AddElement<uint8_t>(Field::VT_REQUIRED, static_cast<uint8_t>(required), 0); 689 } 690 void add_key(bool key) { 691 fbb_.AddElement<uint8_t>(Field::VT_KEY, static_cast<uint8_t>(key), 0); 692 } 693 void add_attributes(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<reflection::KeyValue>>> attributes) { 694 fbb_.AddOffset(Field::VT_ATTRIBUTES, attributes); 695 } 696 void add_documentation(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> documentation) { 697 fbb_.AddOffset(Field::VT_DOCUMENTATION, documentation); 698 } 699 void add_optional(bool optional) { 700 fbb_.AddElement<uint8_t>(Field::VT_OPTIONAL, static_cast<uint8_t>(optional), 0); 701 } 702 void add_padding(uint16_t padding) { 703 fbb_.AddElement<uint16_t>(Field::VT_PADDING, padding, 0); 704 } 705 explicit FieldBuilder(flatbuffers::FlatBufferBuilder &_fbb) 706 : fbb_(_fbb) { 707 start_ = fbb_.StartTable(); 708 } 709 flatbuffers::Offset<Field> Finish() { 710 const auto end = fbb_.EndTable(start_); 711 auto o = flatbuffers::Offset<Field>(end); 712 fbb_.Required(o, Field::VT_NAME); 713 fbb_.Required(o, Field::VT_TYPE); 714 return o; 715 } 716 }; 717 718 inline flatbuffers::Offset<Field> CreateField( 719 flatbuffers::FlatBufferBuilder &_fbb, 720 flatbuffers::Offset<flatbuffers::String> name = 0, 721 flatbuffers::Offset<reflection::Type> type = 0, 722 uint16_t id = 0, 723 uint16_t offset = 0, 724 int64_t default_integer = 0, 725 double default_real = 0.0, 726 bool deprecated = false, 727 bool required = false, 728 bool key = false, 729 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<reflection::KeyValue>>> attributes = 0, 730 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> documentation = 0, 731 bool optional = false, 732 uint16_t padding = 0) { 733 FieldBuilder builder_(_fbb); 734 builder_.add_default_real(default_real); 735 builder_.add_default_integer(default_integer); 736 builder_.add_documentation(documentation); 737 builder_.add_attributes(attributes); 738 builder_.add_type(type); 739 builder_.add_name(name); 740 builder_.add_padding(padding); 741 builder_.add_offset(offset); 742 builder_.add_id(id); 743 builder_.add_optional(optional); 744 builder_.add_key(key); 745 builder_.add_required(required); 746 builder_.add_deprecated(deprecated); 747 return builder_.Finish(); 748 } 749 750 inline flatbuffers::Offset<Field> CreateFieldDirect( 751 flatbuffers::FlatBufferBuilder &_fbb, 752 const char *name = nullptr, 753 flatbuffers::Offset<reflection::Type> type = 0, 754 uint16_t id = 0, 755 uint16_t offset = 0, 756 int64_t default_integer = 0, 757 double default_real = 0.0, 758 bool deprecated = false, 759 bool required = false, 760 bool key = false, 761 std::vector<flatbuffers::Offset<reflection::KeyValue>> *attributes = nullptr, 762 const std::vector<flatbuffers::Offset<flatbuffers::String>> *documentation = nullptr, 763 bool optional = false, 764 uint16_t padding = 0) { 765 auto name__ = name ? _fbb.CreateString(name) : 0; 766 auto attributes__ = attributes ? _fbb.CreateVectorOfSortedTables<reflection::KeyValue>(attributes) : 0; 767 auto documentation__ = documentation ? _fbb.CreateVector<flatbuffers::Offset<flatbuffers::String>>(*documentation) : 0; 768 return reflection::CreateField( 769 _fbb, 770 name__, 771 type, 772 id, 773 offset, 774 default_integer, 775 default_real, 776 deprecated, 777 required, 778 key, 779 attributes__, 780 documentation__, 781 optional, 782 padding); 783 } 784 785 struct Object FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { 786 typedef ObjectBuilder Builder; 787 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { 788 VT_NAME = 4, 789 VT_FIELDS = 6, 790 VT_IS_STRUCT = 8, 791 VT_MINALIGN = 10, 792 VT_BYTESIZE = 12, 793 VT_ATTRIBUTES = 14, 794 VT_DOCUMENTATION = 16, 795 VT_DECLARATION_FILE = 18 796 }; 797 const flatbuffers::String *name() const { 798 return GetPointer<const flatbuffers::String *>(VT_NAME); 799 } 800 bool KeyCompareLessThan(const Object *o) const { 801 return *name() < *o->name(); 802 } 803 int KeyCompareWithValue(const char *_name) const { 804 return strcmp(name()->c_str(), _name); 805 } 806 const flatbuffers::Vector<flatbuffers::Offset<reflection::Field>> *fields() const { 807 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<reflection::Field>> *>(VT_FIELDS); 808 } 809 bool is_struct() const { 810 return GetField<uint8_t>(VT_IS_STRUCT, 0) != 0; 811 } 812 int32_t minalign() const { 813 return GetField<int32_t>(VT_MINALIGN, 0); 814 } 815 int32_t bytesize() const { 816 return GetField<int32_t>(VT_BYTESIZE, 0); 817 } 818 const flatbuffers::Vector<flatbuffers::Offset<reflection::KeyValue>> *attributes() const { 819 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<reflection::KeyValue>> *>(VT_ATTRIBUTES); 820 } 821 const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *documentation() const { 822 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *>(VT_DOCUMENTATION); 823 } 824 /// File that this Object is declared in. 825 const flatbuffers::String *declaration_file() const { 826 return GetPointer<const flatbuffers::String *>(VT_DECLARATION_FILE); 827 } 828 bool Verify(flatbuffers::Verifier &verifier) const { 829 return VerifyTableStart(verifier) && 830 VerifyOffsetRequired(verifier, VT_NAME) && 831 verifier.VerifyString(name()) && 832 VerifyOffsetRequired(verifier, VT_FIELDS) && 833 verifier.VerifyVector(fields()) && 834 verifier.VerifyVectorOfTables(fields()) && 835 VerifyField<uint8_t>(verifier, VT_IS_STRUCT, 1) && 836 VerifyField<int32_t>(verifier, VT_MINALIGN, 4) && 837 VerifyField<int32_t>(verifier, VT_BYTESIZE, 4) && 838 VerifyOffset(verifier, VT_ATTRIBUTES) && 839 verifier.VerifyVector(attributes()) && 840 verifier.VerifyVectorOfTables(attributes()) && 841 VerifyOffset(verifier, VT_DOCUMENTATION) && 842 verifier.VerifyVector(documentation()) && 843 verifier.VerifyVectorOfStrings(documentation()) && 844 VerifyOffset(verifier, VT_DECLARATION_FILE) && 845 verifier.VerifyString(declaration_file()) && 846 verifier.EndTable(); 847 } 848 }; 849 850 struct ObjectBuilder { 851 typedef Object Table; 852 flatbuffers::FlatBufferBuilder &fbb_; 853 flatbuffers::uoffset_t start_; 854 void add_name(flatbuffers::Offset<flatbuffers::String> name) { 855 fbb_.AddOffset(Object::VT_NAME, name); 856 } 857 void add_fields(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<reflection::Field>>> fields) { 858 fbb_.AddOffset(Object::VT_FIELDS, fields); 859 } 860 void add_is_struct(bool is_struct) { 861 fbb_.AddElement<uint8_t>(Object::VT_IS_STRUCT, static_cast<uint8_t>(is_struct), 0); 862 } 863 void add_minalign(int32_t minalign) { 864 fbb_.AddElement<int32_t>(Object::VT_MINALIGN, minalign, 0); 865 } 866 void add_bytesize(int32_t bytesize) { 867 fbb_.AddElement<int32_t>(Object::VT_BYTESIZE, bytesize, 0); 868 } 869 void add_attributes(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<reflection::KeyValue>>> attributes) { 870 fbb_.AddOffset(Object::VT_ATTRIBUTES, attributes); 871 } 872 void add_documentation(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> documentation) { 873 fbb_.AddOffset(Object::VT_DOCUMENTATION, documentation); 874 } 875 void add_declaration_file(flatbuffers::Offset<flatbuffers::String> declaration_file) { 876 fbb_.AddOffset(Object::VT_DECLARATION_FILE, declaration_file); 877 } 878 explicit ObjectBuilder(flatbuffers::FlatBufferBuilder &_fbb) 879 : fbb_(_fbb) { 880 start_ = fbb_.StartTable(); 881 } 882 flatbuffers::Offset<Object> Finish() { 883 const auto end = fbb_.EndTable(start_); 884 auto o = flatbuffers::Offset<Object>(end); 885 fbb_.Required(o, Object::VT_NAME); 886 fbb_.Required(o, Object::VT_FIELDS); 887 return o; 888 } 889 }; 890 891 inline flatbuffers::Offset<Object> CreateObject( 892 flatbuffers::FlatBufferBuilder &_fbb, 893 flatbuffers::Offset<flatbuffers::String> name = 0, 894 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<reflection::Field>>> fields = 0, 895 bool is_struct = false, 896 int32_t minalign = 0, 897 int32_t bytesize = 0, 898 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<reflection::KeyValue>>> attributes = 0, 899 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> documentation = 0, 900 flatbuffers::Offset<flatbuffers::String> declaration_file = 0) { 901 ObjectBuilder builder_(_fbb); 902 builder_.add_declaration_file(declaration_file); 903 builder_.add_documentation(documentation); 904 builder_.add_attributes(attributes); 905 builder_.add_bytesize(bytesize); 906 builder_.add_minalign(minalign); 907 builder_.add_fields(fields); 908 builder_.add_name(name); 909 builder_.add_is_struct(is_struct); 910 return builder_.Finish(); 911 } 912 913 inline flatbuffers::Offset<Object> CreateObjectDirect( 914 flatbuffers::FlatBufferBuilder &_fbb, 915 const char *name = nullptr, 916 std::vector<flatbuffers::Offset<reflection::Field>> *fields = nullptr, 917 bool is_struct = false, 918 int32_t minalign = 0, 919 int32_t bytesize = 0, 920 std::vector<flatbuffers::Offset<reflection::KeyValue>> *attributes = nullptr, 921 const std::vector<flatbuffers::Offset<flatbuffers::String>> *documentation = nullptr, 922 const char *declaration_file = nullptr) { 923 auto name__ = name ? _fbb.CreateString(name) : 0; 924 auto fields__ = fields ? _fbb.CreateVectorOfSortedTables<reflection::Field>(fields) : 0; 925 auto attributes__ = attributes ? _fbb.CreateVectorOfSortedTables<reflection::KeyValue>(attributes) : 0; 926 auto documentation__ = documentation ? _fbb.CreateVector<flatbuffers::Offset<flatbuffers::String>>(*documentation) : 0; 927 auto declaration_file__ = declaration_file ? _fbb.CreateString(declaration_file) : 0; 928 return reflection::CreateObject( 929 _fbb, 930 name__, 931 fields__, 932 is_struct, 933 minalign, 934 bytesize, 935 attributes__, 936 documentation__, 937 declaration_file__); 938 } 939 940 struct RPCCall FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { 941 typedef RPCCallBuilder Builder; 942 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { 943 VT_NAME = 4, 944 VT_REQUEST = 6, 945 VT_RESPONSE = 8, 946 VT_ATTRIBUTES = 10, 947 VT_DOCUMENTATION = 12 948 }; 949 const flatbuffers::String *name() const { 950 return GetPointer<const flatbuffers::String *>(VT_NAME); 951 } 952 bool KeyCompareLessThan(const RPCCall *o) const { 953 return *name() < *o->name(); 954 } 955 int KeyCompareWithValue(const char *_name) const { 956 return strcmp(name()->c_str(), _name); 957 } 958 const reflection::Object *request() const { 959 return GetPointer<const reflection::Object *>(VT_REQUEST); 960 } 961 const reflection::Object *response() const { 962 return GetPointer<const reflection::Object *>(VT_RESPONSE); 963 } 964 const flatbuffers::Vector<flatbuffers::Offset<reflection::KeyValue>> *attributes() const { 965 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<reflection::KeyValue>> *>(VT_ATTRIBUTES); 966 } 967 const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *documentation() const { 968 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *>(VT_DOCUMENTATION); 969 } 970 bool Verify(flatbuffers::Verifier &verifier) const { 971 return VerifyTableStart(verifier) && 972 VerifyOffsetRequired(verifier, VT_NAME) && 973 verifier.VerifyString(name()) && 974 VerifyOffsetRequired(verifier, VT_REQUEST) && 975 verifier.VerifyTable(request()) && 976 VerifyOffsetRequired(verifier, VT_RESPONSE) && 977 verifier.VerifyTable(response()) && 978 VerifyOffset(verifier, VT_ATTRIBUTES) && 979 verifier.VerifyVector(attributes()) && 980 verifier.VerifyVectorOfTables(attributes()) && 981 VerifyOffset(verifier, VT_DOCUMENTATION) && 982 verifier.VerifyVector(documentation()) && 983 verifier.VerifyVectorOfStrings(documentation()) && 984 verifier.EndTable(); 985 } 986 }; 987 988 struct RPCCallBuilder { 989 typedef RPCCall Table; 990 flatbuffers::FlatBufferBuilder &fbb_; 991 flatbuffers::uoffset_t start_; 992 void add_name(flatbuffers::Offset<flatbuffers::String> name) { 993 fbb_.AddOffset(RPCCall::VT_NAME, name); 994 } 995 void add_request(flatbuffers::Offset<reflection::Object> request) { 996 fbb_.AddOffset(RPCCall::VT_REQUEST, request); 997 } 998 void add_response(flatbuffers::Offset<reflection::Object> response) { 999 fbb_.AddOffset(RPCCall::VT_RESPONSE, response); 1000 } 1001 void add_attributes(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<reflection::KeyValue>>> attributes) { 1002 fbb_.AddOffset(RPCCall::VT_ATTRIBUTES, attributes); 1003 } 1004 void add_documentation(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> documentation) { 1005 fbb_.AddOffset(RPCCall::VT_DOCUMENTATION, documentation); 1006 } 1007 explicit RPCCallBuilder(flatbuffers::FlatBufferBuilder &_fbb) 1008 : fbb_(_fbb) { 1009 start_ = fbb_.StartTable(); 1010 } 1011 flatbuffers::Offset<RPCCall> Finish() { 1012 const auto end = fbb_.EndTable(start_); 1013 auto o = flatbuffers::Offset<RPCCall>(end); 1014 fbb_.Required(o, RPCCall::VT_NAME); 1015 fbb_.Required(o, RPCCall::VT_REQUEST); 1016 fbb_.Required(o, RPCCall::VT_RESPONSE); 1017 return o; 1018 } 1019 }; 1020 1021 inline flatbuffers::Offset<RPCCall> CreateRPCCall( 1022 flatbuffers::FlatBufferBuilder &_fbb, 1023 flatbuffers::Offset<flatbuffers::String> name = 0, 1024 flatbuffers::Offset<reflection::Object> request = 0, 1025 flatbuffers::Offset<reflection::Object> response = 0, 1026 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<reflection::KeyValue>>> attributes = 0, 1027 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> documentation = 0) { 1028 RPCCallBuilder builder_(_fbb); 1029 builder_.add_documentation(documentation); 1030 builder_.add_attributes(attributes); 1031 builder_.add_response(response); 1032 builder_.add_request(request); 1033 builder_.add_name(name); 1034 return builder_.Finish(); 1035 } 1036 1037 inline flatbuffers::Offset<RPCCall> CreateRPCCallDirect( 1038 flatbuffers::FlatBufferBuilder &_fbb, 1039 const char *name = nullptr, 1040 flatbuffers::Offset<reflection::Object> request = 0, 1041 flatbuffers::Offset<reflection::Object> response = 0, 1042 std::vector<flatbuffers::Offset<reflection::KeyValue>> *attributes = nullptr, 1043 const std::vector<flatbuffers::Offset<flatbuffers::String>> *documentation = nullptr) { 1044 auto name__ = name ? _fbb.CreateString(name) : 0; 1045 auto attributes__ = attributes ? _fbb.CreateVectorOfSortedTables<reflection::KeyValue>(attributes) : 0; 1046 auto documentation__ = documentation ? _fbb.CreateVector<flatbuffers::Offset<flatbuffers::String>>(*documentation) : 0; 1047 return reflection::CreateRPCCall( 1048 _fbb, 1049 name__, 1050 request, 1051 response, 1052 attributes__, 1053 documentation__); 1054 } 1055 1056 struct Service FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { 1057 typedef ServiceBuilder Builder; 1058 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { 1059 VT_NAME = 4, 1060 VT_CALLS = 6, 1061 VT_ATTRIBUTES = 8, 1062 VT_DOCUMENTATION = 10, 1063 VT_DECLARATION_FILE = 12 1064 }; 1065 const flatbuffers::String *name() const { 1066 return GetPointer<const flatbuffers::String *>(VT_NAME); 1067 } 1068 bool KeyCompareLessThan(const Service *o) const { 1069 return *name() < *o->name(); 1070 } 1071 int KeyCompareWithValue(const char *_name) const { 1072 return strcmp(name()->c_str(), _name); 1073 } 1074 const flatbuffers::Vector<flatbuffers::Offset<reflection::RPCCall>> *calls() const { 1075 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<reflection::RPCCall>> *>(VT_CALLS); 1076 } 1077 const flatbuffers::Vector<flatbuffers::Offset<reflection::KeyValue>> *attributes() const { 1078 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<reflection::KeyValue>> *>(VT_ATTRIBUTES); 1079 } 1080 const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *documentation() const { 1081 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *>(VT_DOCUMENTATION); 1082 } 1083 /// File that this Service is declared in. 1084 const flatbuffers::String *declaration_file() const { 1085 return GetPointer<const flatbuffers::String *>(VT_DECLARATION_FILE); 1086 } 1087 bool Verify(flatbuffers::Verifier &verifier) const { 1088 return VerifyTableStart(verifier) && 1089 VerifyOffsetRequired(verifier, VT_NAME) && 1090 verifier.VerifyString(name()) && 1091 VerifyOffset(verifier, VT_CALLS) && 1092 verifier.VerifyVector(calls()) && 1093 verifier.VerifyVectorOfTables(calls()) && 1094 VerifyOffset(verifier, VT_ATTRIBUTES) && 1095 verifier.VerifyVector(attributes()) && 1096 verifier.VerifyVectorOfTables(attributes()) && 1097 VerifyOffset(verifier, VT_DOCUMENTATION) && 1098 verifier.VerifyVector(documentation()) && 1099 verifier.VerifyVectorOfStrings(documentation()) && 1100 VerifyOffset(verifier, VT_DECLARATION_FILE) && 1101 verifier.VerifyString(declaration_file()) && 1102 verifier.EndTable(); 1103 } 1104 }; 1105 1106 struct ServiceBuilder { 1107 typedef Service Table; 1108 flatbuffers::FlatBufferBuilder &fbb_; 1109 flatbuffers::uoffset_t start_; 1110 void add_name(flatbuffers::Offset<flatbuffers::String> name) { 1111 fbb_.AddOffset(Service::VT_NAME, name); 1112 } 1113 void add_calls(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<reflection::RPCCall>>> calls) { 1114 fbb_.AddOffset(Service::VT_CALLS, calls); 1115 } 1116 void add_attributes(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<reflection::KeyValue>>> attributes) { 1117 fbb_.AddOffset(Service::VT_ATTRIBUTES, attributes); 1118 } 1119 void add_documentation(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> documentation) { 1120 fbb_.AddOffset(Service::VT_DOCUMENTATION, documentation); 1121 } 1122 void add_declaration_file(flatbuffers::Offset<flatbuffers::String> declaration_file) { 1123 fbb_.AddOffset(Service::VT_DECLARATION_FILE, declaration_file); 1124 } 1125 explicit ServiceBuilder(flatbuffers::FlatBufferBuilder &_fbb) 1126 : fbb_(_fbb) { 1127 start_ = fbb_.StartTable(); 1128 } 1129 flatbuffers::Offset<Service> Finish() { 1130 const auto end = fbb_.EndTable(start_); 1131 auto o = flatbuffers::Offset<Service>(end); 1132 fbb_.Required(o, Service::VT_NAME); 1133 return o; 1134 } 1135 }; 1136 1137 inline flatbuffers::Offset<Service> CreateService( 1138 flatbuffers::FlatBufferBuilder &_fbb, 1139 flatbuffers::Offset<flatbuffers::String> name = 0, 1140 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<reflection::RPCCall>>> calls = 0, 1141 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<reflection::KeyValue>>> attributes = 0, 1142 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> documentation = 0, 1143 flatbuffers::Offset<flatbuffers::String> declaration_file = 0) { 1144 ServiceBuilder builder_(_fbb); 1145 builder_.add_declaration_file(declaration_file); 1146 builder_.add_documentation(documentation); 1147 builder_.add_attributes(attributes); 1148 builder_.add_calls(calls); 1149 builder_.add_name(name); 1150 return builder_.Finish(); 1151 } 1152 1153 inline flatbuffers::Offset<Service> CreateServiceDirect( 1154 flatbuffers::FlatBufferBuilder &_fbb, 1155 const char *name = nullptr, 1156 std::vector<flatbuffers::Offset<reflection::RPCCall>> *calls = nullptr, 1157 std::vector<flatbuffers::Offset<reflection::KeyValue>> *attributes = nullptr, 1158 const std::vector<flatbuffers::Offset<flatbuffers::String>> *documentation = nullptr, 1159 const char *declaration_file = nullptr) { 1160 auto name__ = name ? _fbb.CreateString(name) : 0; 1161 auto calls__ = calls ? _fbb.CreateVectorOfSortedTables<reflection::RPCCall>(calls) : 0; 1162 auto attributes__ = attributes ? _fbb.CreateVectorOfSortedTables<reflection::KeyValue>(attributes) : 0; 1163 auto documentation__ = documentation ? _fbb.CreateVector<flatbuffers::Offset<flatbuffers::String>>(*documentation) : 0; 1164 auto declaration_file__ = declaration_file ? _fbb.CreateString(declaration_file) : 0; 1165 return reflection::CreateService( 1166 _fbb, 1167 name__, 1168 calls__, 1169 attributes__, 1170 documentation__, 1171 declaration_file__); 1172 } 1173 1174 /// File specific information. 1175 /// Symbols declared within a file may be recovered by iterating over all 1176 /// symbols and examining the `declaration_file` field. 1177 struct SchemaFile FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { 1178 typedef SchemaFileBuilder Builder; 1179 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { 1180 VT_FILENAME = 4, 1181 VT_INCLUDED_FILENAMES = 6 1182 }; 1183 /// Filename, relative to project root. 1184 const flatbuffers::String *filename() const { 1185 return GetPointer<const flatbuffers::String *>(VT_FILENAME); 1186 } 1187 bool KeyCompareLessThan(const SchemaFile *o) const { 1188 return *filename() < *o->filename(); 1189 } 1190 int KeyCompareWithValue(const char *_filename) const { 1191 return strcmp(filename()->c_str(), _filename); 1192 } 1193 /// Names of included files, relative to project root. 1194 const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *included_filenames() const { 1195 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *>(VT_INCLUDED_FILENAMES); 1196 } 1197 bool Verify(flatbuffers::Verifier &verifier) const { 1198 return VerifyTableStart(verifier) && 1199 VerifyOffsetRequired(verifier, VT_FILENAME) && 1200 verifier.VerifyString(filename()) && 1201 VerifyOffset(verifier, VT_INCLUDED_FILENAMES) && 1202 verifier.VerifyVector(included_filenames()) && 1203 verifier.VerifyVectorOfStrings(included_filenames()) && 1204 verifier.EndTable(); 1205 } 1206 }; 1207 1208 struct SchemaFileBuilder { 1209 typedef SchemaFile Table; 1210 flatbuffers::FlatBufferBuilder &fbb_; 1211 flatbuffers::uoffset_t start_; 1212 void add_filename(flatbuffers::Offset<flatbuffers::String> filename) { 1213 fbb_.AddOffset(SchemaFile::VT_FILENAME, filename); 1214 } 1215 void add_included_filenames(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> included_filenames) { 1216 fbb_.AddOffset(SchemaFile::VT_INCLUDED_FILENAMES, included_filenames); 1217 } 1218 explicit SchemaFileBuilder(flatbuffers::FlatBufferBuilder &_fbb) 1219 : fbb_(_fbb) { 1220 start_ = fbb_.StartTable(); 1221 } 1222 flatbuffers::Offset<SchemaFile> Finish() { 1223 const auto end = fbb_.EndTable(start_); 1224 auto o = flatbuffers::Offset<SchemaFile>(end); 1225 fbb_.Required(o, SchemaFile::VT_FILENAME); 1226 return o; 1227 } 1228 }; 1229 1230 inline flatbuffers::Offset<SchemaFile> CreateSchemaFile( 1231 flatbuffers::FlatBufferBuilder &_fbb, 1232 flatbuffers::Offset<flatbuffers::String> filename = 0, 1233 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> included_filenames = 0) { 1234 SchemaFileBuilder builder_(_fbb); 1235 builder_.add_included_filenames(included_filenames); 1236 builder_.add_filename(filename); 1237 return builder_.Finish(); 1238 } 1239 1240 inline flatbuffers::Offset<SchemaFile> CreateSchemaFileDirect( 1241 flatbuffers::FlatBufferBuilder &_fbb, 1242 const char *filename = nullptr, 1243 const std::vector<flatbuffers::Offset<flatbuffers::String>> *included_filenames = nullptr) { 1244 auto filename__ = filename ? _fbb.CreateString(filename) : 0; 1245 auto included_filenames__ = included_filenames ? _fbb.CreateVector<flatbuffers::Offset<flatbuffers::String>>(*included_filenames) : 0; 1246 return reflection::CreateSchemaFile( 1247 _fbb, 1248 filename__, 1249 included_filenames__); 1250 } 1251 1252 struct Schema FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { 1253 typedef SchemaBuilder Builder; 1254 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { 1255 VT_OBJECTS = 4, 1256 VT_ENUMS = 6, 1257 VT_FILE_IDENT = 8, 1258 VT_FILE_EXT = 10, 1259 VT_ROOT_TABLE = 12, 1260 VT_SERVICES = 14, 1261 VT_ADVANCED_FEATURES = 16, 1262 VT_FBS_FILES = 18 1263 }; 1264 const flatbuffers::Vector<flatbuffers::Offset<reflection::Object>> *objects() const { 1265 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<reflection::Object>> *>(VT_OBJECTS); 1266 } 1267 const flatbuffers::Vector<flatbuffers::Offset<reflection::Enum>> *enums() const { 1268 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<reflection::Enum>> *>(VT_ENUMS); 1269 } 1270 const flatbuffers::String *file_ident() const { 1271 return GetPointer<const flatbuffers::String *>(VT_FILE_IDENT); 1272 } 1273 const flatbuffers::String *file_ext() const { 1274 return GetPointer<const flatbuffers::String *>(VT_FILE_EXT); 1275 } 1276 const reflection::Object *root_table() const { 1277 return GetPointer<const reflection::Object *>(VT_ROOT_TABLE); 1278 } 1279 const flatbuffers::Vector<flatbuffers::Offset<reflection::Service>> *services() const { 1280 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<reflection::Service>> *>(VT_SERVICES); 1281 } 1282 reflection::AdvancedFeatures advanced_features() const { 1283 return static_cast<reflection::AdvancedFeatures>(GetField<uint64_t>(VT_ADVANCED_FEATURES, 0)); 1284 } 1285 /// All the files used in this compilation. Files are relative to where 1286 /// flatc was invoked. 1287 const flatbuffers::Vector<flatbuffers::Offset<reflection::SchemaFile>> *fbs_files() const { 1288 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<reflection::SchemaFile>> *>(VT_FBS_FILES); 1289 } 1290 bool Verify(flatbuffers::Verifier &verifier) const { 1291 return VerifyTableStart(verifier) && 1292 VerifyOffsetRequired(verifier, VT_OBJECTS) && 1293 verifier.VerifyVector(objects()) && 1294 verifier.VerifyVectorOfTables(objects()) && 1295 VerifyOffsetRequired(verifier, VT_ENUMS) && 1296 verifier.VerifyVector(enums()) && 1297 verifier.VerifyVectorOfTables(enums()) && 1298 VerifyOffset(verifier, VT_FILE_IDENT) && 1299 verifier.VerifyString(file_ident()) && 1300 VerifyOffset(verifier, VT_FILE_EXT) && 1301 verifier.VerifyString(file_ext()) && 1302 VerifyOffset(verifier, VT_ROOT_TABLE) && 1303 verifier.VerifyTable(root_table()) && 1304 VerifyOffset(verifier, VT_SERVICES) && 1305 verifier.VerifyVector(services()) && 1306 verifier.VerifyVectorOfTables(services()) && 1307 VerifyField<uint64_t>(verifier, VT_ADVANCED_FEATURES, 8) && 1308 VerifyOffset(verifier, VT_FBS_FILES) && 1309 verifier.VerifyVector(fbs_files()) && 1310 verifier.VerifyVectorOfTables(fbs_files()) && 1311 verifier.EndTable(); 1312 } 1313 }; 1314 1315 struct SchemaBuilder { 1316 typedef Schema Table; 1317 flatbuffers::FlatBufferBuilder &fbb_; 1318 flatbuffers::uoffset_t start_; 1319 void add_objects(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<reflection::Object>>> objects) { 1320 fbb_.AddOffset(Schema::VT_OBJECTS, objects); 1321 } 1322 void add_enums(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<reflection::Enum>>> enums) { 1323 fbb_.AddOffset(Schema::VT_ENUMS, enums); 1324 } 1325 void add_file_ident(flatbuffers::Offset<flatbuffers::String> file_ident) { 1326 fbb_.AddOffset(Schema::VT_FILE_IDENT, file_ident); 1327 } 1328 void add_file_ext(flatbuffers::Offset<flatbuffers::String> file_ext) { 1329 fbb_.AddOffset(Schema::VT_FILE_EXT, file_ext); 1330 } 1331 void add_root_table(flatbuffers::Offset<reflection::Object> root_table) { 1332 fbb_.AddOffset(Schema::VT_ROOT_TABLE, root_table); 1333 } 1334 void add_services(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<reflection::Service>>> services) { 1335 fbb_.AddOffset(Schema::VT_SERVICES, services); 1336 } 1337 void add_advanced_features(reflection::AdvancedFeatures advanced_features) { 1338 fbb_.AddElement<uint64_t>(Schema::VT_ADVANCED_FEATURES, static_cast<uint64_t>(advanced_features), 0); 1339 } 1340 void add_fbs_files(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<reflection::SchemaFile>>> fbs_files) { 1341 fbb_.AddOffset(Schema::VT_FBS_FILES, fbs_files); 1342 } 1343 explicit SchemaBuilder(flatbuffers::FlatBufferBuilder &_fbb) 1344 : fbb_(_fbb) { 1345 start_ = fbb_.StartTable(); 1346 } 1347 flatbuffers::Offset<Schema> Finish() { 1348 const auto end = fbb_.EndTable(start_); 1349 auto o = flatbuffers::Offset<Schema>(end); 1350 fbb_.Required(o, Schema::VT_OBJECTS); 1351 fbb_.Required(o, Schema::VT_ENUMS); 1352 return o; 1353 } 1354 }; 1355 1356 inline flatbuffers::Offset<Schema> CreateSchema( 1357 flatbuffers::FlatBufferBuilder &_fbb, 1358 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<reflection::Object>>> objects = 0, 1359 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<reflection::Enum>>> enums = 0, 1360 flatbuffers::Offset<flatbuffers::String> file_ident = 0, 1361 flatbuffers::Offset<flatbuffers::String> file_ext = 0, 1362 flatbuffers::Offset<reflection::Object> root_table = 0, 1363 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<reflection::Service>>> services = 0, 1364 reflection::AdvancedFeatures advanced_features = static_cast<reflection::AdvancedFeatures>(0), 1365 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<reflection::SchemaFile>>> fbs_files = 0) { 1366 SchemaBuilder builder_(_fbb); 1367 builder_.add_advanced_features(advanced_features); 1368 builder_.add_fbs_files(fbs_files); 1369 builder_.add_services(services); 1370 builder_.add_root_table(root_table); 1371 builder_.add_file_ext(file_ext); 1372 builder_.add_file_ident(file_ident); 1373 builder_.add_enums(enums); 1374 builder_.add_objects(objects); 1375 return builder_.Finish(); 1376 } 1377 1378 inline flatbuffers::Offset<Schema> CreateSchemaDirect( 1379 flatbuffers::FlatBufferBuilder &_fbb, 1380 std::vector<flatbuffers::Offset<reflection::Object>> *objects = nullptr, 1381 std::vector<flatbuffers::Offset<reflection::Enum>> *enums = nullptr, 1382 const char *file_ident = nullptr, 1383 const char *file_ext = nullptr, 1384 flatbuffers::Offset<reflection::Object> root_table = 0, 1385 std::vector<flatbuffers::Offset<reflection::Service>> *services = nullptr, 1386 reflection::AdvancedFeatures advanced_features = static_cast<reflection::AdvancedFeatures>(0), 1387 std::vector<flatbuffers::Offset<reflection::SchemaFile>> *fbs_files = nullptr) { 1388 auto objects__ = objects ? _fbb.CreateVectorOfSortedTables<reflection::Object>(objects) : 0; 1389 auto enums__ = enums ? _fbb.CreateVectorOfSortedTables<reflection::Enum>(enums) : 0; 1390 auto file_ident__ = file_ident ? _fbb.CreateString(file_ident) : 0; 1391 auto file_ext__ = file_ext ? _fbb.CreateString(file_ext) : 0; 1392 auto services__ = services ? _fbb.CreateVectorOfSortedTables<reflection::Service>(services) : 0; 1393 auto fbs_files__ = fbs_files ? _fbb.CreateVectorOfSortedTables<reflection::SchemaFile>(fbs_files) : 0; 1394 return reflection::CreateSchema( 1395 _fbb, 1396 objects__, 1397 enums__, 1398 file_ident__, 1399 file_ext__, 1400 root_table, 1401 services__, 1402 advanced_features, 1403 fbs_files__); 1404 } 1405 1406 inline const reflection::Schema *GetSchema(const void *buf) { 1407 return flatbuffers::GetRoot<reflection::Schema>(buf); 1408 } 1409 1410 inline const reflection::Schema *GetSizePrefixedSchema(const void *buf) { 1411 return flatbuffers::GetSizePrefixedRoot<reflection::Schema>(buf); 1412 } 1413 1414 inline const char *SchemaIdentifier() { 1415 return "BFBS"; 1416 } 1417 1418 inline bool SchemaBufferHasIdentifier(const void *buf) { 1419 return flatbuffers::BufferHasIdentifier( 1420 buf, SchemaIdentifier()); 1421 } 1422 1423 inline bool SizePrefixedSchemaBufferHasIdentifier(const void *buf) { 1424 return flatbuffers::BufferHasIdentifier( 1425 buf, SchemaIdentifier(), true); 1426 } 1427 1428 inline bool VerifySchemaBuffer( 1429 flatbuffers::Verifier &verifier) { 1430 return verifier.VerifyBuffer<reflection::Schema>(SchemaIdentifier()); 1431 } 1432 1433 inline bool VerifySizePrefixedSchemaBuffer( 1434 flatbuffers::Verifier &verifier) { 1435 return verifier.VerifySizePrefixedBuffer<reflection::Schema>(SchemaIdentifier()); 1436 } 1437 1438 inline const char *SchemaExtension() { 1439 return "bfbs"; 1440 } 1441 1442 inline void FinishSchemaBuffer( 1443 flatbuffers::FlatBufferBuilder &fbb, 1444 flatbuffers::Offset<reflection::Schema> root) { 1445 fbb.Finish(root, SchemaIdentifier()); 1446 } 1447 1448 inline void FinishSizePrefixedSchemaBuffer( 1449 flatbuffers::FlatBufferBuilder &fbb, 1450 flatbuffers::Offset<reflection::Schema> root) { 1451 fbb.FinishSizePrefixed(root, SchemaIdentifier()); 1452 } 1453 1454 } // namespace reflection 1455 1456 #endif // FLATBUFFERS_GENERATED_REFLECTION_REFLECTION_H_