Struct typetable (#5291)

* C++: Generate MiniReflectTypeTable for Structs as well as Tables

* Update generated code

* add test
This commit is contained in:
Nils Berg
2019-04-15 20:38:00 +02:00
committed by Wouter van Oortmerssen
parent 98b9b5a933
commit cef8f928bb
6 changed files with 41 additions and 0 deletions

View File

@@ -197,6 +197,9 @@ FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) Rapunzel FLATBUFFERS_FINAL_CLASS {
int32_t hair_length_;
public:
static const flatbuffers::TypeTable *MiniReflectTypeTable() {
return RapunzelTypeTable();
}
Rapunzel() {
memset(static_cast<void *>(this), 0, sizeof(Rapunzel));
}
@@ -227,6 +230,9 @@ FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) BookReader FLATBUFFERS_FINAL_CLASS {
int32_t books_read_;
public:
static const flatbuffers::TypeTable *MiniReflectTypeTable() {
return BookReaderTypeTable();
}
BookReader() {
memset(static_cast<void *>(this), 0, sizeof(BookReader));
}