|
Reflection for RapidJSON 0.0.17
Reflection for serializing/deserializing with RapidJSON
|
The CodeGenerator class is the base for generators used by the CodeFactory class. More...
#include <codegenerator.h>
Public Member Functions | |
| CodeGenerator (CodeFactory &factory) | |
| virtual | ~CodeGenerator () |
| virtual void | addDeclaration (clang::Decl *decl) |
| Adds the specified decl to the code generator. | |
| virtual void | generate (std::ostream &os) const =0 |
| Generates code based on the previously added declarations. The code is written to os. | |
Protected Member Functions | |
| CodeFactory & | factory () const |
| void | lazyInitializeSourceManager () const |
| Lazy initializes the source manager. | |
| bool | isOnlyIncluded (const clang::Decl *declaration) const |
| Returns whether the specified declaration is only included and not part of the actual file. | |
Static Protected Member Functions | |
| static clang::CXXBaseSpecifier * | inheritsFromInstantiationOf (clang::CXXRecordDecl *record, const char *templateClass) |
| Returns whether the specified record inherits from an instantiation of the specified templateClass. | |
The CodeGenerator class is the base for generators used by the CodeFactory class.
Definition at line 22 of file codegenerator.h.
|
inline |
Definition at line 43 of file codegenerator.h.
|
virtual |
Definition at line 13 of file codegenerator.cpp.
|
virtual |
Adds the specified decl to the code generator.
The generator might ignore irrelevant declarations.
Reimplemented in ReflectiveRapidJSON::SerializationCodeGenerator.
Definition at line 20 of file codegenerator.cpp.
|
inlineprotected |
Definition at line 49 of file codegenerator.h.
|
pure virtual |
Generates code based on the previously added declarations. The code is written to os.
Implemented in ReflectiveRapidJSON::BinarySerializationCodeGenerator, and ReflectiveRapidJSON::JsonSerializationCodeGenerator.
|
staticprotected |
Returns whether the specified record inherits from an instantiation of the specified templateClass.
Definition at line 50 of file codegenerator.cpp.
|
protected |
Returns whether the specified declaration is only included and not part of the actual file.
Definition at line 39 of file codegenerator.cpp.
|
protected |
Lazy initializes the source manager.
Definition at line 29 of file codegenerator.cpp.