1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030
|
// automatically generated by the FlatBuffers compiler, do not modify
#ifndef FLATBUFFERS_GENERATED_KEYFIELDSAMPLE_KEYFIELD_SAMPLE_H_
#define FLATBUFFERS_GENERATED_KEYFIELDSAMPLE_KEYFIELD_SAMPLE_H_
#include "flatbuffers/flatbuffers.h"
// Ensure the included flatbuffers.h is the same version as when this file was
// generated, otherwise it may not be compatible.
static_assert(FLATBUFFERS_VERSION_MAJOR == 24 &&
FLATBUFFERS_VERSION_MINOR == 12 &&
FLATBUFFERS_VERSION_REVISION == 23,
"Non-compatible flatbuffers version included");
namespace keyfield {
namespace sample {
struct Baz;
struct Bar;
struct Color;
struct Apple;
struct Fruit;
struct Rice;
struct Grain;
struct FooTable;
struct FooTableBuilder;
struct FooTableT;
bool operator==(const Baz &lhs, const Baz &rhs);
bool operator!=(const Baz &lhs, const Baz &rhs);
bool operator==(const Bar &lhs, const Bar &rhs);
bool operator!=(const Bar &lhs, const Bar &rhs);
bool operator==(const Color &lhs, const Color &rhs);
bool operator!=(const Color &lhs, const Color &rhs);
bool operator==(const Apple &lhs, const Apple &rhs);
bool operator!=(const Apple &lhs, const Apple &rhs);
bool operator==(const Fruit &lhs, const Fruit &rhs);
bool operator!=(const Fruit &lhs, const Fruit &rhs);
bool operator==(const Rice &lhs, const Rice &rhs);
bool operator!=(const Rice &lhs, const Rice &rhs);
bool operator==(const Grain &lhs, const Grain &rhs);
bool operator!=(const Grain &lhs, const Grain &rhs);
bool operator==(const FooTableT &lhs, const FooTableT &rhs);
bool operator!=(const FooTableT &lhs, const FooTableT &rhs);
inline const ::flatbuffers::TypeTable *BazTypeTable();
inline const ::flatbuffers::TypeTable *BarTypeTable();
inline const ::flatbuffers::TypeTable *ColorTypeTable();
inline const ::flatbuffers::TypeTable *AppleTypeTable();
inline const ::flatbuffers::TypeTable *FruitTypeTable();
inline const ::flatbuffers::TypeTable *RiceTypeTable();
inline const ::flatbuffers::TypeTable *GrainTypeTable();
inline const ::flatbuffers::TypeTable *FooTableTypeTable();
FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(1) Baz FLATBUFFERS_FINAL_CLASS {
private:
uint8_t a_[4];
uint8_t b_;
public:
static const ::flatbuffers::TypeTable *MiniReflectTypeTable() {
return BazTypeTable();
}
Baz()
: a_(),
b_(0) {
}
Baz(uint8_t _b)
: a_(),
b_(::flatbuffers::EndianScalar(_b)) {
}
Baz(::flatbuffers::span<const uint8_t, 4> _a, uint8_t _b)
: b_(::flatbuffers::EndianScalar(_b)) {
::flatbuffers::CastToArray(a_).CopyFromSpan(_a);
}
const ::flatbuffers::Array<uint8_t, 4> *a() const {
return &::flatbuffers::CastToArray(a_);
}
::flatbuffers::Array<uint8_t, 4> *mutable_a() {
return &::flatbuffers::CastToArray(a_);
}
bool KeyCompareLessThan(const Baz * const o) const {
return KeyCompareWithValue(o->a()) < 0;
}
int KeyCompareWithValue(const ::flatbuffers::Array<uint8_t, 4> *_a) const {
const ::flatbuffers::Array<uint8_t, 4> *curr_a = a();
for (::flatbuffers::uoffset_t i = 0; i < curr_a->size(); i++) {
const auto lhs = curr_a->Get(i);
const auto rhs = _a->Get(i);
if (lhs != rhs)
return static_cast<int>(lhs > rhs) - static_cast<int>(lhs < rhs);
}
return 0;
}
uint8_t b() const {
return ::flatbuffers::EndianScalar(b_);
}
void mutate_b(uint8_t _b) {
::flatbuffers::WriteScalar(&b_, _b);
}
};
FLATBUFFERS_STRUCT_END(Baz, 5);
inline bool operator==(const Baz &lhs, const Baz &rhs) {
return
(*lhs.a() == *rhs.a()) &&
(lhs.b() == rhs.b());
}
inline bool operator!=(const Baz &lhs, const Baz &rhs) {
return !(lhs == rhs);
}
FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) Bar FLATBUFFERS_FINAL_CLASS {
private:
float a_[3];
uint8_t b_;
int8_t padding0__; int16_t padding1__;
public:
static const ::flatbuffers::TypeTable *MiniReflectTypeTable() {
return BarTypeTable();
}
Bar()
: a_(),
b_(0),
padding0__(0),
padding1__(0) {
(void)padding0__;
(void)padding1__;
}
Bar(uint8_t _b)
: a_(),
b_(::flatbuffers::EndianScalar(_b)),
padding0__(0),
padding1__(0) {
(void)padding0__;
(void)padding1__;
}
Bar(::flatbuffers::span<const float, 3> _a, uint8_t _b)
: b_(::flatbuffers::EndianScalar(_b)),
padding0__(0),
padding1__(0) {
::flatbuffers::CastToArray(a_).CopyFromSpan(_a);
(void)padding0__;
(void)padding1__;
}
const ::flatbuffers::Array<float, 3> *a() const {
return &::flatbuffers::CastToArray(a_);
}
::flatbuffers::Array<float, 3> *mutable_a() {
return &::flatbuffers::CastToArray(a_);
}
bool KeyCompareLessThan(const Bar * const o) const {
return KeyCompareWithValue(o->a()) < 0;
}
int KeyCompareWithValue(const ::flatbuffers::Array<float, 3> *_a) const {
const ::flatbuffers::Array<float, 3> *curr_a = a();
for (::flatbuffers::uoffset_t i = 0; i < curr_a->size(); i++) {
const auto lhs = curr_a->Get(i);
const auto rhs = _a->Get(i);
if (lhs != rhs)
return static_cast<int>(lhs > rhs) - static_cast<int>(lhs < rhs);
}
return 0;
}
uint8_t b() const {
return ::flatbuffers::EndianScalar(b_);
}
void mutate_b(uint8_t _b) {
::flatbuffers::WriteScalar(&b_, _b);
}
};
FLATBUFFERS_STRUCT_END(Bar, 16);
inline bool operator==(const Bar &lhs, const Bar &rhs) {
return
(*lhs.a() == *rhs.a()) &&
(lhs.b() == rhs.b());
}
inline bool operator!=(const Bar &lhs, const Bar &rhs) {
return !(lhs == rhs);
}
FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) Color FLATBUFFERS_FINAL_CLASS {
private:
float rgb_[3];
uint8_t tag_;
int8_t padding0__; int16_t padding1__;
public:
static const ::flatbuffers::TypeTable *MiniReflectTypeTable() {
return ColorTypeTable();
}
Color()
: rgb_(),
tag_(0),
padding0__(0),
padding1__(0) {
(void)padding0__;
(void)padding1__;
}
Color(uint8_t _tag)
: rgb_(),
tag_(::flatbuffers::EndianScalar(_tag)),
padding0__(0),
padding1__(0) {
(void)padding0__;
(void)padding1__;
}
Color(::flatbuffers::span<const float, 3> _rgb, uint8_t _tag)
: tag_(::flatbuffers::EndianScalar(_tag)),
padding0__(0),
padding1__(0) {
::flatbuffers::CastToArray(rgb_).CopyFromSpan(_rgb);
(void)padding0__;
(void)padding1__;
}
const ::flatbuffers::Array<float, 3> *rgb() const {
return &::flatbuffers::CastToArray(rgb_);
}
::flatbuffers::Array<float, 3> *mutable_rgb() {
return &::flatbuffers::CastToArray(rgb_);
}
bool KeyCompareLessThan(const Color * const o) const {
return KeyCompareWithValue(o->rgb()) < 0;
}
int KeyCompareWithValue(const ::flatbuffers::Array<float, 3> *_rgb) const {
const ::flatbuffers::Array<float, 3> *curr_rgb = rgb();
for (::flatbuffers::uoffset_t i = 0; i < curr_rgb->size(); i++) {
const auto lhs = curr_rgb->Get(i);
const auto rhs = _rgb->Get(i);
if (lhs != rhs)
return static_cast<int>(lhs > rhs) - static_cast<int>(lhs < rhs);
}
return 0;
}
uint8_t tag() const {
return ::flatbuffers::EndianScalar(tag_);
}
void mutate_tag(uint8_t _tag) {
::flatbuffers::WriteScalar(&tag_, _tag);
}
};
FLATBUFFERS_STRUCT_END(Color, 16);
inline bool operator==(const Color &lhs, const Color &rhs) {
return
(*lhs.rgb() == *rhs.rgb()) &&
(lhs.tag() == rhs.tag());
}
inline bool operator!=(const Color &lhs, const Color &rhs) {
return !(lhs == rhs);
}
FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) Apple FLATBUFFERS_FINAL_CLASS {
private:
uint8_t tag_;
int8_t padding0__; int16_t padding1__;
keyfield::sample::Color color_;
public:
static const ::flatbuffers::TypeTable *MiniReflectTypeTable() {
return AppleTypeTable();
}
Apple()
: tag_(0),
padding0__(0),
padding1__(0),
color_() {
(void)padding0__;
(void)padding1__;
}
Apple(uint8_t _tag, const keyfield::sample::Color &_color)
: tag_(::flatbuffers::EndianScalar(_tag)),
padding0__(0),
padding1__(0),
color_(_color) {
(void)padding0__;
(void)padding1__;
}
uint8_t tag() const {
return ::flatbuffers::EndianScalar(tag_);
}
void mutate_tag(uint8_t _tag) {
::flatbuffers::WriteScalar(&tag_, _tag);
}
const keyfield::sample::Color &color() const {
return color_;
}
keyfield::sample::Color &mutable_color() {
return color_;
}
bool KeyCompareLessThan(const Apple * const o) const {
return KeyCompareWithValue(o->color()) < 0;
}
int KeyCompareWithValue(const keyfield::sample::Color &_color) const {
const auto &lhs_color = color();
const auto &rhs_color = _color;
const auto rhs_color_rgb = rhs_color.rgb();
const auto rgb_compare_result = lhs_color.KeyCompareWithValue(rhs_color_rgb);
if (rgb_compare_result != 0)
return rgb_compare_result;
const auto lhs_color_tag = lhs_color.tag();
const auto rhs_color_tag = rhs_color.tag();
if (lhs_color_tag != rhs_color_tag)
return static_cast<int>(lhs_color_tag > rhs_color_tag) - static_cast<int>(lhs_color_tag < rhs_color_tag);
return 0;
}
};
FLATBUFFERS_STRUCT_END(Apple, 20);
inline bool operator==(const Apple &lhs, const Apple &rhs) {
return
(lhs.tag() == rhs.tag()) &&
(lhs.color() == rhs.color());
}
inline bool operator!=(const Apple &lhs, const Apple &rhs) {
return !(lhs == rhs);
}
FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) Fruit FLATBUFFERS_FINAL_CLASS {
private:
keyfield::sample::Apple a_;
uint8_t b_;
int8_t padding0__; int16_t padding1__;
public:
static const ::flatbuffers::TypeTable *MiniReflectTypeTable() {
return FruitTypeTable();
}
Fruit()
: a_(),
b_(0),
padding0__(0),
padding1__(0) {
(void)padding0__;
(void)padding1__;
}
Fruit(const keyfield::sample::Apple &_a, uint8_t _b)
: a_(_a),
b_(::flatbuffers::EndianScalar(_b)),
padding0__(0),
padding1__(0) {
(void)padding0__;
(void)padding1__;
}
const keyfield::sample::Apple &a() const {
return a_;
}
keyfield::sample::Apple &mutable_a() {
return a_;
}
bool KeyCompareLessThan(const Fruit * const o) const {
return KeyCompareWithValue(o->a()) < 0;
}
int KeyCompareWithValue(const keyfield::sample::Apple &_a) const {
const auto &lhs_a = a();
const auto &rhs_a = _a;
const auto lhs_a_tag = lhs_a.tag();
const auto rhs_a_tag = rhs_a.tag();
if (lhs_a_tag != rhs_a_tag)
return static_cast<int>(lhs_a_tag > rhs_a_tag) - static_cast<int>(lhs_a_tag < rhs_a_tag);
const auto rhs_a_color = rhs_a.color();
const auto color_compare_result = lhs_a.KeyCompareWithValue(rhs_a_color);
if (color_compare_result != 0)
return color_compare_result;
return 0;
}
uint8_t b() const {
return ::flatbuffers::EndianScalar(b_);
}
void mutate_b(uint8_t _b) {
::flatbuffers::WriteScalar(&b_, _b);
}
};
FLATBUFFERS_STRUCT_END(Fruit, 24);
inline bool operator==(const Fruit &lhs, const Fruit &rhs) {
return
(lhs.a() == rhs.a()) &&
(lhs.b() == rhs.b());
}
inline bool operator!=(const Fruit &lhs, const Fruit &rhs) {
return !(lhs == rhs);
}
FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) Rice FLATBUFFERS_FINAL_CLASS {
private:
uint8_t origin_[3];
int8_t padding0__;
uint32_t quantity_;
public:
static const ::flatbuffers::TypeTable *MiniReflectTypeTable() {
return RiceTypeTable();
}
Rice()
: origin_(),
padding0__(0),
quantity_(0) {
(void)padding0__;
}
Rice(uint32_t _quantity)
: origin_(),
padding0__(0),
quantity_(::flatbuffers::EndianScalar(_quantity)) {
(void)padding0__;
}
Rice(::flatbuffers::span<const uint8_t, 3> _origin, uint32_t _quantity)
: padding0__(0),
quantity_(::flatbuffers::EndianScalar(_quantity)) {
::flatbuffers::CastToArray(origin_).CopyFromSpan(_origin);
(void)padding0__;
}
const ::flatbuffers::Array<uint8_t, 3> *origin() const {
return &::flatbuffers::CastToArray(origin_);
}
::flatbuffers::Array<uint8_t, 3> *mutable_origin() {
return &::flatbuffers::CastToArray(origin_);
}
uint32_t quantity() const {
return ::flatbuffers::EndianScalar(quantity_);
}
void mutate_quantity(uint32_t _quantity) {
::flatbuffers::WriteScalar(&quantity_, _quantity);
}
};
FLATBUFFERS_STRUCT_END(Rice, 8);
inline bool operator==(const Rice &lhs, const Rice &rhs) {
return
(*lhs.origin() == *rhs.origin()) &&
(lhs.quantity() == rhs.quantity());
}
inline bool operator!=(const Rice &lhs, const Rice &rhs) {
return !(lhs == rhs);
}
FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) Grain FLATBUFFERS_FINAL_CLASS {
private:
keyfield::sample::Rice a_[3];
uint8_t tag_;
int8_t padding0__; int16_t padding1__;
public:
static const ::flatbuffers::TypeTable *MiniReflectTypeTable() {
return GrainTypeTable();
}
Grain()
: a_(),
tag_(0),
padding0__(0),
padding1__(0) {
(void)padding0__;
(void)padding1__;
}
Grain(uint8_t _tag)
: a_(),
tag_(::flatbuffers::EndianScalar(_tag)),
padding0__(0),
padding1__(0) {
(void)padding0__;
(void)padding1__;
}
Grain(::flatbuffers::span<const keyfield::sample::Rice, 3> _a, uint8_t _tag)
: tag_(::flatbuffers::EndianScalar(_tag)),
padding0__(0),
padding1__(0) {
::flatbuffers::CastToArray(a_).CopyFromSpan(_a);
(void)padding0__;
(void)padding1__;
}
const ::flatbuffers::Array<keyfield::sample::Rice, 3> *a() const {
return &::flatbuffers::CastToArray(a_);
}
::flatbuffers::Array<keyfield::sample::Rice, 3> *mutable_a() {
return &::flatbuffers::CastToArray(a_);
}
bool KeyCompareLessThan(const Grain * const o) const {
return KeyCompareWithValue(o->a()) < 0;
}
int KeyCompareWithValue(const ::flatbuffers::Array<keyfield::sample::Rice, 3> *_a) const {
const ::flatbuffers::Array<keyfield::sample::Rice, 3> *curr_a = a();
for (::flatbuffers::uoffset_t i = 0; i < curr_a->size(); i++) {
const auto &lhs_a = *(curr_a->Get(i));
const auto &rhs_a = *(_a->Get(i));
const auto lhs_a_origin = lhs_a.origin();
const auto rhs_a_origin = rhs_a.origin();
for (::flatbuffers::uoffset_t i = 0; i < lhs_a_origin->size(); i++) {
const auto lhs_a_origin_elem = lhs_a_origin->Get(i);
const auto rhs_a_origin_elem = rhs_a_origin->Get(i);
if (lhs_a_origin_elem != rhs_a_origin_elem)
return static_cast<int>(lhs_a_origin_elem > rhs_a_origin_elem) - static_cast<int>(lhs_a_origin_elem < rhs_a_origin_elem);
}
const auto lhs_a_quantity = lhs_a.quantity();
const auto rhs_a_quantity = rhs_a.quantity();
if (lhs_a_quantity != rhs_a_quantity)
return static_cast<int>(lhs_a_quantity > rhs_a_quantity) - static_cast<int>(lhs_a_quantity < rhs_a_quantity);
}
return 0;
}
uint8_t tag() const {
return ::flatbuffers::EndianScalar(tag_);
}
void mutate_tag(uint8_t _tag) {
::flatbuffers::WriteScalar(&tag_, _tag);
}
};
FLATBUFFERS_STRUCT_END(Grain, 28);
inline bool operator==(const Grain &lhs, const Grain &rhs) {
return
(*lhs.a() == *rhs.a()) &&
(lhs.tag() == rhs.tag());
}
inline bool operator!=(const Grain &lhs, const Grain &rhs) {
return !(lhs == rhs);
}
struct FooTableT : public ::flatbuffers::NativeTable {
typedef FooTable TableType;
int32_t a = 0;
int32_t b = 0;
std::string c{};
std::vector<keyfield::sample::Baz> d{};
std::vector<keyfield::sample::Bar> e{};
std::vector<keyfield::sample::Apple> f{};
std::vector<keyfield::sample::Fruit> g{};
std::vector<keyfield::sample::Grain> h{};
};
struct FooTable FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
typedef FooTableT NativeTableType;
typedef FooTableBuilder Builder;
static const ::flatbuffers::TypeTable *MiniReflectTypeTable() {
return FooTableTypeTable();
}
enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
VT_A = 4,
VT_B = 6,
VT_C = 8,
VT_D = 10,
VT_E = 12,
VT_F = 14,
VT_G = 16,
VT_H = 18
};
int32_t a() const {
return GetField<int32_t>(VT_A, 0);
}
bool mutate_a(int32_t _a = 0) {
return SetField<int32_t>(VT_A, _a, 0);
}
int32_t b() const {
return GetField<int32_t>(VT_B, 0);
}
bool mutate_b(int32_t _b = 0) {
return SetField<int32_t>(VT_B, _b, 0);
}
const ::flatbuffers::String *c() const {
return GetPointer<const ::flatbuffers::String *>(VT_C);
}
::flatbuffers::String *mutable_c() {
return GetPointer<::flatbuffers::String *>(VT_C);
}
bool KeyCompareLessThan(const FooTable * const o) const {
return *c() < *o->c();
}
int KeyCompareWithValue(const char *_c) const {
return strcmp(c()->c_str(), _c);
}
template<typename StringType>
int KeyCompareWithValue(const StringType& _c) const {
if (c()->c_str() < _c) return -1;
if (_c < c()->c_str()) return 1;
return 0;
}
const ::flatbuffers::Vector<const keyfield::sample::Baz *> *d() const {
return GetPointer<const ::flatbuffers::Vector<const keyfield::sample::Baz *> *>(VT_D);
}
::flatbuffers::Vector<const keyfield::sample::Baz *> *mutable_d() {
return GetPointer<::flatbuffers::Vector<const keyfield::sample::Baz *> *>(VT_D);
}
const ::flatbuffers::Vector<const keyfield::sample::Bar *> *e() const {
return GetPointer<const ::flatbuffers::Vector<const keyfield::sample::Bar *> *>(VT_E);
}
::flatbuffers::Vector<const keyfield::sample::Bar *> *mutable_e() {
return GetPointer<::flatbuffers::Vector<const keyfield::sample::Bar *> *>(VT_E);
}
const ::flatbuffers::Vector<const keyfield::sample::Apple *> *f() const {
return GetPointer<const ::flatbuffers::Vector<const keyfield::sample::Apple *> *>(VT_F);
}
::flatbuffers::Vector<const keyfield::sample::Apple *> *mutable_f() {
return GetPointer<::flatbuffers::Vector<const keyfield::sample::Apple *> *>(VT_F);
}
const ::flatbuffers::Vector<const keyfield::sample::Fruit *> *g() const {
return GetPointer<const ::flatbuffers::Vector<const keyfield::sample::Fruit *> *>(VT_G);
}
::flatbuffers::Vector<const keyfield::sample::Fruit *> *mutable_g() {
return GetPointer<::flatbuffers::Vector<const keyfield::sample::Fruit *> *>(VT_G);
}
const ::flatbuffers::Vector<const keyfield::sample::Grain *> *h() const {
return GetPointer<const ::flatbuffers::Vector<const keyfield::sample::Grain *> *>(VT_H);
}
::flatbuffers::Vector<const keyfield::sample::Grain *> *mutable_h() {
return GetPointer<::flatbuffers::Vector<const keyfield::sample::Grain *> *>(VT_H);
}
bool Verify(::flatbuffers::Verifier &verifier) const {
return VerifyTableStart(verifier) &&
VerifyField<int32_t>(verifier, VT_A, 4) &&
VerifyField<int32_t>(verifier, VT_B, 4) &&
VerifyOffsetRequired(verifier, VT_C) &&
verifier.VerifyString(c()) &&
VerifyOffset(verifier, VT_D) &&
verifier.VerifyVector(d()) &&
VerifyOffset(verifier, VT_E) &&
verifier.VerifyVector(e()) &&
VerifyOffset(verifier, VT_F) &&
verifier.VerifyVector(f()) &&
VerifyOffset(verifier, VT_G) &&
verifier.VerifyVector(g()) &&
VerifyOffset(verifier, VT_H) &&
verifier.VerifyVector(h()) &&
verifier.EndTable();
}
FooTableT *UnPack(const ::flatbuffers::resolver_function_t *_resolver = nullptr) const;
void UnPackTo(FooTableT *_o, const ::flatbuffers::resolver_function_t *_resolver = nullptr) const;
static ::flatbuffers::Offset<FooTable> Pack(::flatbuffers::FlatBufferBuilder &_fbb, const FooTableT* _o, const ::flatbuffers::rehasher_function_t *_rehasher = nullptr);
};
struct FooTableBuilder {
typedef FooTable Table;
::flatbuffers::FlatBufferBuilder &fbb_;
::flatbuffers::uoffset_t start_;
void add_a(int32_t a) {
fbb_.AddElement<int32_t>(FooTable::VT_A, a, 0);
}
void add_b(int32_t b) {
fbb_.AddElement<int32_t>(FooTable::VT_B, b, 0);
}
void add_c(::flatbuffers::Offset<::flatbuffers::String> c) {
fbb_.AddOffset(FooTable::VT_C, c);
}
void add_d(::flatbuffers::Offset<::flatbuffers::Vector<const keyfield::sample::Baz *>> d) {
fbb_.AddOffset(FooTable::VT_D, d);
}
void add_e(::flatbuffers::Offset<::flatbuffers::Vector<const keyfield::sample::Bar *>> e) {
fbb_.AddOffset(FooTable::VT_E, e);
}
void add_f(::flatbuffers::Offset<::flatbuffers::Vector<const keyfield::sample::Apple *>> f) {
fbb_.AddOffset(FooTable::VT_F, f);
}
void add_g(::flatbuffers::Offset<::flatbuffers::Vector<const keyfield::sample::Fruit *>> g) {
fbb_.AddOffset(FooTable::VT_G, g);
}
void add_h(::flatbuffers::Offset<::flatbuffers::Vector<const keyfield::sample::Grain *>> h) {
fbb_.AddOffset(FooTable::VT_H, h);
}
explicit FooTableBuilder(::flatbuffers::FlatBufferBuilder &_fbb)
: fbb_(_fbb) {
start_ = fbb_.StartTable();
}
::flatbuffers::Offset<FooTable> Finish() {
const auto end = fbb_.EndTable(start_);
auto o = ::flatbuffers::Offset<FooTable>(end);
fbb_.Required(o, FooTable::VT_C);
return o;
}
};
inline ::flatbuffers::Offset<FooTable> CreateFooTable(
::flatbuffers::FlatBufferBuilder &_fbb,
int32_t a = 0,
int32_t b = 0,
::flatbuffers::Offset<::flatbuffers::String> c = 0,
::flatbuffers::Offset<::flatbuffers::Vector<const keyfield::sample::Baz *>> d = 0,
::flatbuffers::Offset<::flatbuffers::Vector<const keyfield::sample::Bar *>> e = 0,
::flatbuffers::Offset<::flatbuffers::Vector<const keyfield::sample::Apple *>> f = 0,
::flatbuffers::Offset<::flatbuffers::Vector<const keyfield::sample::Fruit *>> g = 0,
::flatbuffers::Offset<::flatbuffers::Vector<const keyfield::sample::Grain *>> h = 0) {
FooTableBuilder builder_(_fbb);
builder_.add_h(h);
builder_.add_g(g);
builder_.add_f(f);
builder_.add_e(e);
builder_.add_d(d);
builder_.add_c(c);
builder_.add_b(b);
builder_.add_a(a);
return builder_.Finish();
}
inline ::flatbuffers::Offset<FooTable> CreateFooTableDirect(
::flatbuffers::FlatBufferBuilder &_fbb,
int32_t a = 0,
int32_t b = 0,
const char *c = nullptr,
std::vector<keyfield::sample::Baz> *d = nullptr,
std::vector<keyfield::sample::Bar> *e = nullptr,
std::vector<keyfield::sample::Apple> *f = nullptr,
std::vector<keyfield::sample::Fruit> *g = nullptr,
std::vector<keyfield::sample::Grain> *h = nullptr) {
auto c__ = c ? _fbb.CreateString(c) : 0;
auto d__ = d ? _fbb.CreateVectorOfSortedStructs<keyfield::sample::Baz>(d) : 0;
auto e__ = e ? _fbb.CreateVectorOfSortedStructs<keyfield::sample::Bar>(e) : 0;
auto f__ = f ? _fbb.CreateVectorOfSortedStructs<keyfield::sample::Apple>(f) : 0;
auto g__ = g ? _fbb.CreateVectorOfSortedStructs<keyfield::sample::Fruit>(g) : 0;
auto h__ = h ? _fbb.CreateVectorOfSortedStructs<keyfield::sample::Grain>(h) : 0;
return keyfield::sample::CreateFooTable(
_fbb,
a,
b,
c__,
d__,
e__,
f__,
g__,
h__);
}
::flatbuffers::Offset<FooTable> CreateFooTable(::flatbuffers::FlatBufferBuilder &_fbb, const FooTableT *_o, const ::flatbuffers::rehasher_function_t *_rehasher = nullptr);
inline bool operator==(const FooTableT &lhs, const FooTableT &rhs) {
return
(lhs.a == rhs.a) &&
(lhs.b == rhs.b) &&
(lhs.c == rhs.c) &&
(lhs.d == rhs.d) &&
(lhs.e == rhs.e) &&
(lhs.f == rhs.f) &&
(lhs.g == rhs.g) &&
(lhs.h == rhs.h);
}
inline bool operator!=(const FooTableT &lhs, const FooTableT &rhs) {
return !(lhs == rhs);
}
inline FooTableT *FooTable::UnPack(const ::flatbuffers::resolver_function_t *_resolver) const {
auto _o = std::unique_ptr<FooTableT>(new FooTableT());
UnPackTo(_o.get(), _resolver);
return _o.release();
}
inline void FooTable::UnPackTo(FooTableT *_o, const ::flatbuffers::resolver_function_t *_resolver) const {
(void)_o;
(void)_resolver;
{ auto _e = a(); _o->a = _e; }
{ auto _e = b(); _o->b = _e; }
{ auto _e = c(); if (_e) _o->c = _e->str(); }
{ auto _e = d(); if (_e) { _o->d.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->d[_i] = *_e->Get(_i); } } else { _o->d.resize(0); } }
{ auto _e = e(); if (_e) { _o->e.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->e[_i] = *_e->Get(_i); } } else { _o->e.resize(0); } }
{ auto _e = f(); if (_e) { _o->f.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->f[_i] = *_e->Get(_i); } } else { _o->f.resize(0); } }
{ auto _e = g(); if (_e) { _o->g.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->g[_i] = *_e->Get(_i); } } else { _o->g.resize(0); } }
{ auto _e = h(); if (_e) { _o->h.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->h[_i] = *_e->Get(_i); } } else { _o->h.resize(0); } }
}
inline ::flatbuffers::Offset<FooTable> FooTable::Pack(::flatbuffers::FlatBufferBuilder &_fbb, const FooTableT* _o, const ::flatbuffers::rehasher_function_t *_rehasher) {
return CreateFooTable(_fbb, _o, _rehasher);
}
inline ::flatbuffers::Offset<FooTable> CreateFooTable(::flatbuffers::FlatBufferBuilder &_fbb, const FooTableT *_o, const ::flatbuffers::rehasher_function_t *_rehasher) {
(void)_rehasher;
(void)_o;
struct _VectorArgs { ::flatbuffers::FlatBufferBuilder *__fbb; const FooTableT* __o; const ::flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
auto _a = _o->a;
auto _b = _o->b;
auto _c = _fbb.CreateString(_o->c);
auto _d = _o->d.size() ? _fbb.CreateVectorOfStructs(_o->d) : 0;
auto _e = _o->e.size() ? _fbb.CreateVectorOfStructs(_o->e) : 0;
auto _f = _o->f.size() ? _fbb.CreateVectorOfStructs(_o->f) : 0;
auto _g = _o->g.size() ? _fbb.CreateVectorOfStructs(_o->g) : 0;
auto _h = _o->h.size() ? _fbb.CreateVectorOfStructs(_o->h) : 0;
return keyfield::sample::CreateFooTable(
_fbb,
_a,
_b,
_c,
_d,
_e,
_f,
_g,
_h);
}
inline const ::flatbuffers::TypeTable *BazTypeTable() {
static const ::flatbuffers::TypeCode type_codes[] = {
{ ::flatbuffers::ET_UCHAR, 1, -1 },
{ ::flatbuffers::ET_UCHAR, 0, -1 }
};
static const int16_t array_sizes[] = { 4, };
static const int64_t values[] = { 0, 4, 5 };
static const char * const names[] = {
"a",
"b"
};
static const ::flatbuffers::TypeTable tt = {
::flatbuffers::ST_STRUCT, 2, type_codes, nullptr, array_sizes, values, names
};
return &tt;
}
inline const ::flatbuffers::TypeTable *BarTypeTable() {
static const ::flatbuffers::TypeCode type_codes[] = {
{ ::flatbuffers::ET_FLOAT, 1, -1 },
{ ::flatbuffers::ET_UCHAR, 0, -1 }
};
static const int16_t array_sizes[] = { 3, };
static const int64_t values[] = { 0, 12, 16 };
static const char * const names[] = {
"a",
"b"
};
static const ::flatbuffers::TypeTable tt = {
::flatbuffers::ST_STRUCT, 2, type_codes, nullptr, array_sizes, values, names
};
return &tt;
}
inline const ::flatbuffers::TypeTable *ColorTypeTable() {
static const ::flatbuffers::TypeCode type_codes[] = {
{ ::flatbuffers::ET_FLOAT, 1, -1 },
{ ::flatbuffers::ET_UCHAR, 0, -1 }
};
static const int16_t array_sizes[] = { 3, };
static const int64_t values[] = { 0, 12, 16 };
static const char * const names[] = {
"rgb",
"tag"
};
static const ::flatbuffers::TypeTable tt = {
::flatbuffers::ST_STRUCT, 2, type_codes, nullptr, array_sizes, values, names
};
return &tt;
}
inline const ::flatbuffers::TypeTable *AppleTypeTable() {
static const ::flatbuffers::TypeCode type_codes[] = {
{ ::flatbuffers::ET_UCHAR, 0, -1 },
{ ::flatbuffers::ET_SEQUENCE, 0, 0 }
};
static const ::flatbuffers::TypeFunction type_refs[] = {
keyfield::sample::ColorTypeTable
};
static const int64_t values[] = { 0, 4, 20 };
static const char * const names[] = {
"tag",
"color"
};
static const ::flatbuffers::TypeTable tt = {
::flatbuffers::ST_STRUCT, 2, type_codes, type_refs, nullptr, values, names
};
return &tt;
}
inline const ::flatbuffers::TypeTable *FruitTypeTable() {
static const ::flatbuffers::TypeCode type_codes[] = {
{ ::flatbuffers::ET_SEQUENCE, 0, 0 },
{ ::flatbuffers::ET_UCHAR, 0, -1 }
};
static const ::flatbuffers::TypeFunction type_refs[] = {
keyfield::sample::AppleTypeTable
};
static const int64_t values[] = { 0, 20, 24 };
static const char * const names[] = {
"a",
"b"
};
static const ::flatbuffers::TypeTable tt = {
::flatbuffers::ST_STRUCT, 2, type_codes, type_refs, nullptr, values, names
};
return &tt;
}
inline const ::flatbuffers::TypeTable *RiceTypeTable() {
static const ::flatbuffers::TypeCode type_codes[] = {
{ ::flatbuffers::ET_UCHAR, 1, -1 },
{ ::flatbuffers::ET_UINT, 0, -1 }
};
static const int16_t array_sizes[] = { 3, };
static const int64_t values[] = { 0, 4, 8 };
static const char * const names[] = {
"origin",
"quantity"
};
static const ::flatbuffers::TypeTable tt = {
::flatbuffers::ST_STRUCT, 2, type_codes, nullptr, array_sizes, values, names
};
return &tt;
}
inline const ::flatbuffers::TypeTable *GrainTypeTable() {
static const ::flatbuffers::TypeCode type_codes[] = {
{ ::flatbuffers::ET_SEQUENCE, 1, 0 },
{ ::flatbuffers::ET_UCHAR, 0, -1 }
};
static const ::flatbuffers::TypeFunction type_refs[] = {
keyfield::sample::RiceTypeTable
};
static const int16_t array_sizes[] = { 3, };
static const int64_t values[] = { 0, 24, 28 };
static const char * const names[] = {
"a",
"tag"
};
static const ::flatbuffers::TypeTable tt = {
::flatbuffers::ST_STRUCT, 2, type_codes, type_refs, array_sizes, values, names
};
return &tt;
}
inline const ::flatbuffers::TypeTable *FooTableTypeTable() {
static const ::flatbuffers::TypeCode type_codes[] = {
{ ::flatbuffers::ET_INT, 0, -1 },
{ ::flatbuffers::ET_INT, 0, -1 },
{ ::flatbuffers::ET_STRING, 0, -1 },
{ ::flatbuffers::ET_SEQUENCE, 1, 0 },
{ ::flatbuffers::ET_SEQUENCE, 1, 1 },
{ ::flatbuffers::ET_SEQUENCE, 1, 2 },
{ ::flatbuffers::ET_SEQUENCE, 1, 3 },
{ ::flatbuffers::ET_SEQUENCE, 1, 4 }
};
static const ::flatbuffers::TypeFunction type_refs[] = {
keyfield::sample::BazTypeTable,
keyfield::sample::BarTypeTable,
keyfield::sample::AppleTypeTable,
keyfield::sample::FruitTypeTable,
keyfield::sample::GrainTypeTable
};
static const char * const names[] = {
"a",
"b",
"c",
"d",
"e",
"f",
"g",
"h"
};
static const ::flatbuffers::TypeTable tt = {
::flatbuffers::ST_TABLE, 8, type_codes, type_refs, nullptr, nullptr, names
};
return &tt;
}
inline const keyfield::sample::FooTable *GetFooTable(const void *buf) {
return ::flatbuffers::GetRoot<keyfield::sample::FooTable>(buf);
}
inline const keyfield::sample::FooTable *GetSizePrefixedFooTable(const void *buf) {
return ::flatbuffers::GetSizePrefixedRoot<keyfield::sample::FooTable>(buf);
}
inline FooTable *GetMutableFooTable(void *buf) {
return ::flatbuffers::GetMutableRoot<FooTable>(buf);
}
inline keyfield::sample::FooTable *GetMutableSizePrefixedFooTable(void *buf) {
return ::flatbuffers::GetMutableSizePrefixedRoot<keyfield::sample::FooTable>(buf);
}
inline bool VerifyFooTableBuffer(
::flatbuffers::Verifier &verifier) {
return verifier.VerifyBuffer<keyfield::sample::FooTable>(nullptr);
}
inline bool VerifySizePrefixedFooTableBuffer(
::flatbuffers::Verifier &verifier) {
return verifier.VerifySizePrefixedBuffer<keyfield::sample::FooTable>(nullptr);
}
inline void FinishFooTableBuffer(
::flatbuffers::FlatBufferBuilder &fbb,
::flatbuffers::Offset<keyfield::sample::FooTable> root) {
fbb.Finish(root);
}
inline void FinishSizePrefixedFooTableBuffer(
::flatbuffers::FlatBufferBuilder &fbb,
::flatbuffers::Offset<keyfield::sample::FooTable> root) {
fbb.FinishSizePrefixed(root);
}
inline std::unique_ptr<keyfield::sample::FooTableT> UnPackFooTable(
const void *buf,
const ::flatbuffers::resolver_function_t *res = nullptr) {
return std::unique_ptr<keyfield::sample::FooTableT>(GetFooTable(buf)->UnPack(res));
}
inline std::unique_ptr<keyfield::sample::FooTableT> UnPackSizePrefixedFooTable(
const void *buf,
const ::flatbuffers::resolver_function_t *res = nullptr) {
return std::unique_ptr<keyfield::sample::FooTableT>(GetSizePrefixedFooTable(buf)->UnPack(res));
}
} // namespace sample
} // namespace keyfield
#endif // FLATBUFFERS_GENERATED_KEYFIELDSAMPLE_KEYFIELD_SAMPLE_H_
|