mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-24 23:26:10 +00:00
FlatBuffers Version 22.11.22
This commit is contained in:
@@ -9,8 +9,8 @@
|
||||
// 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 == 22 &&
|
||||
FLATBUFFERS_VERSION_MINOR == 10 &&
|
||||
FLATBUFFERS_VERSION_REVISION == 26,
|
||||
FLATBUFFERS_VERSION_MINOR == 11 &&
|
||||
FLATBUFFERS_VERSION_REVISION == 22,
|
||||
"Non-compatible flatbuffers version included");
|
||||
|
||||
namespace keyfield {
|
||||
@@ -22,6 +22,20 @@ struct Bar;
|
||||
|
||||
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 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 *FooTableTypeTable();
|
||||
|
||||
FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(1) Baz FLATBUFFERS_FINAL_CLASS {
|
||||
private:
|
||||
@@ -29,6 +43,9 @@ FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(1) Baz FLATBUFFERS_FINAL_CLASS {
|
||||
uint8_t b_;
|
||||
|
||||
public:
|
||||
static const flatbuffers::TypeTable *MiniReflectTypeTable() {
|
||||
return BazTypeTable();
|
||||
}
|
||||
Baz()
|
||||
: a_(),
|
||||
b_(0) {
|
||||
@@ -44,6 +61,9 @@ FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(1) Baz FLATBUFFERS_FINAL_CLASS {
|
||||
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;
|
||||
}
|
||||
@@ -59,9 +79,23 @@ FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(1) Baz FLATBUFFERS_FINAL_CLASS {
|
||||
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];
|
||||
@@ -69,6 +103,9 @@ FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) Bar FLATBUFFERS_FINAL_CLASS {
|
||||
int8_t padding0__; int16_t padding1__;
|
||||
|
||||
public:
|
||||
static const flatbuffers::TypeTable *MiniReflectTypeTable() {
|
||||
return BarTypeTable();
|
||||
}
|
||||
Bar()
|
||||
: a_(),
|
||||
b_(0),
|
||||
@@ -96,6 +133,9 @@ FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) Bar FLATBUFFERS_FINAL_CLASS {
|
||||
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;
|
||||
}
|
||||
@@ -111,11 +151,38 @@ FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) Bar FLATBUFFERS_FINAL_CLASS {
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
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{};
|
||||
};
|
||||
|
||||
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,
|
||||
@@ -126,12 +193,21 @@ struct FooTable FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
||||
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();
|
||||
}
|
||||
@@ -141,9 +217,15 @@ struct FooTable FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
||||
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);
|
||||
}
|
||||
bool Verify(flatbuffers::Verifier &verifier) const {
|
||||
return VerifyTableStart(verifier) &&
|
||||
VerifyField<int32_t>(verifier, VT_A, 4) &&
|
||||
@@ -156,6 +238,9 @@ struct FooTable FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
||||
verifier.VerifyVector(e()) &&
|
||||
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 {
|
||||
@@ -224,6 +309,120 @@ inline flatbuffers::Offset<FooTable> CreateFooTableDirect(
|
||||
e__);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
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); } }
|
||||
}
|
||||
|
||||
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;
|
||||
return keyfield::sample::CreateFooTable(
|
||||
_fbb,
|
||||
_a,
|
||||
_b,
|
||||
_c,
|
||||
_d,
|
||||
_e);
|
||||
}
|
||||
|
||||
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 *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 }
|
||||
};
|
||||
static const flatbuffers::TypeFunction type_refs[] = {
|
||||
keyfield::sample::BazTypeTable,
|
||||
keyfield::sample::BarTypeTable
|
||||
};
|
||||
static const char * const names[] = {
|
||||
"a",
|
||||
"b",
|
||||
"c",
|
||||
"d",
|
||||
"e"
|
||||
};
|
||||
static const flatbuffers::TypeTable tt = {
|
||||
flatbuffers::ST_TABLE, 5, 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);
|
||||
}
|
||||
@@ -232,6 +431,14 @@ 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);
|
||||
@@ -254,6 +461,18 @@ inline void FinishSizePrefixedFooTableBuffer(
|
||||
fbb.FinishSizePrefixed(root);
|
||||
}
|
||||
|
||||
inline flatbuffers::unique_ptr<keyfield::sample::FooTableT> UnPackFooTable(
|
||||
const void *buf,
|
||||
const flatbuffers::resolver_function_t *res = nullptr) {
|
||||
return flatbuffers::unique_ptr<keyfield::sample::FooTableT>(GetFooTable(buf)->UnPack(res));
|
||||
}
|
||||
|
||||
inline flatbuffers::unique_ptr<keyfield::sample::FooTableT> UnPackSizePrefixedFooTable(
|
||||
const void *buf,
|
||||
const flatbuffers::resolver_function_t *res = nullptr) {
|
||||
return flatbuffers::unique_ptr<keyfield::sample::FooTableT>(GetSizePrefixedFooTable(buf)->UnPack(res));
|
||||
}
|
||||
|
||||
} // namespace sample
|
||||
} // namespace keyfield
|
||||
|
||||
|
||||
Reference in New Issue
Block a user