mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-02 04:04:19 +00:00
Struct typetable (#5291)
* C++: Generate MiniReflectTypeTable for Structs as well as Tables * Update generated code * add test
This commit is contained in:
committed by
Wouter van Oortmerssen
parent
98b9b5a933
commit
cef8f928bb
@@ -2684,6 +2684,15 @@ class CppGenerator : public BaseGenerator {
|
||||
// Generate GetFullyQualifiedName
|
||||
code_ += "";
|
||||
code_ += " public:";
|
||||
|
||||
// Make TypeTable accessible via the generated struct.
|
||||
if (parser_.opts.mini_reflect != IDLOptions::kNone) {
|
||||
code_ +=
|
||||
" static const flatbuffers::TypeTable *MiniReflectTypeTable() {";
|
||||
code_ += " return {{STRUCT_NAME}}TypeTable();";
|
||||
code_ += " }";
|
||||
}
|
||||
|
||||
GenFullyQualifiedNameGetter(struct_def, Name(struct_def));
|
||||
|
||||
// Generate a default constructor.
|
||||
|
||||
Reference in New Issue
Block a user