mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-23 06:40:02 +00:00
[C++] Add Builder and Table typedefs (#5685)
* Add Builder and Table typedefs This gives us a way to use templates to go from a builder to a table and back again without having to pass both types in. * Fix tests/cpp17/generated_cpp17/monster_test_generated.h
This commit is contained in:
committed by
Wouter van Oortmerssen
parent
31f8799083
commit
901b89e733
@@ -14,6 +14,7 @@ struct NestedStruct;
|
||||
struct ArrayStruct;
|
||||
|
||||
struct ArrayTable;
|
||||
struct ArrayTableBuilder;
|
||||
struct ArrayTableT;
|
||||
|
||||
bool operator==(const NestedStruct &lhs, const NestedStruct &rhs);
|
||||
@@ -229,6 +230,7 @@ inline bool operator!=(const ArrayTableT &lhs, const ArrayTableT &rhs) {
|
||||
|
||||
struct ArrayTable FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
||||
typedef ArrayTableT NativeTableType;
|
||||
typedef ArrayTableBuilder Builder;
|
||||
static const flatbuffers::TypeTable *MiniReflectTypeTable() {
|
||||
return ArrayTableTypeTable();
|
||||
}
|
||||
@@ -252,6 +254,7 @@ struct ArrayTable FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
||||
};
|
||||
|
||||
struct ArrayTableBuilder {
|
||||
typedef ArrayTable Table;
|
||||
flatbuffers::FlatBufferBuilder &fbb_;
|
||||
flatbuffers::uoffset_t start_;
|
||||
void add_a(const MyGame::Example::ArrayStruct *a) {
|
||||
|
||||
Reference in New Issue
Block a user