mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-21 12:55:45 +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
@@ -9,6 +9,7 @@
|
||||
namespace MyGame {
|
||||
|
||||
struct MonsterExtra;
|
||||
struct MonsterExtraBuilder;
|
||||
struct MonsterExtraT;
|
||||
|
||||
bool operator==(const MonsterExtraT &lhs, const MonsterExtraT &rhs);
|
||||
@@ -61,6 +62,7 @@ inline bool operator!=(const MonsterExtraT &lhs, const MonsterExtraT &rhs) {
|
||||
|
||||
struct MonsterExtra FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
||||
typedef MonsterExtraT NativeTableType;
|
||||
typedef MonsterExtraBuilder Builder;
|
||||
static const flatbuffers::TypeTable *MiniReflectTypeTable() {
|
||||
return MonsterExtraTypeTable();
|
||||
}
|
||||
@@ -158,6 +160,7 @@ struct MonsterExtra FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
||||
};
|
||||
|
||||
struct MonsterExtraBuilder {
|
||||
typedef MonsterExtra Table;
|
||||
flatbuffers::FlatBufferBuilder &fbb_;
|
||||
flatbuffers::uoffset_t start_;
|
||||
void add_d0(double d0) {
|
||||
|
||||
Reference in New Issue
Block a user