Reflection for RapidJSON 0.0.17
Reflection for serializing/deserializing with RapidJSON
Loading...
Searching...
No Matches
ReflectiveRapidJSON::BinarySerializationCodeGenerator Class Reference

The BinarySerializationCodeGenerator class generates code for JSON (de)serialization of objects inheriting from an instantiation of JsonSerializable. More...

#include <binaryserializationcodegenerator.h>

Inheritance diagram for ReflectiveRapidJSON::BinarySerializationCodeGenerator:
[legend]
Collaboration diagram for ReflectiveRapidJSON::BinarySerializationCodeGenerator:
[legend]

Classes

struct  Options

Public Member Functions

 BinarySerializationCodeGenerator (CodeFactory &factory, const Options &options)
void generate (std::ostream &os) const override
 Generates pull() and push() helper functions in the ReflectiveRapidJSON::BinaryReflector namespace for the relevant classes.
Public Member Functions inherited from ReflectiveRapidJSON::SerializationCodeGenerator
 SerializationCodeGenerator (CodeFactory &factory)
void addDeclaration (clang::Decl *decl) override
 Adds all class declarations (to the internal member variable m_records).
Public Member Functions inherited from ReflectiveRapidJSON::CodeGenerator
 CodeGenerator (CodeFactory &factory)
virtual ~CodeGenerator ()

Protected Member Functions

void computeRelevantClass (RelevantClass &possiblyRelevantClass) const override
 Checks whether possiblyRelevantClass is actually relevant.
Protected Member Functions inherited from ReflectiveRapidJSON::SerializationCodeGenerator
std::vector< RelevantClass > findRelevantClasses () const
Protected Member Functions inherited from ReflectiveRapidJSON::CodeGenerator
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.

Protected Attributes

const Options & m_options
Protected Attributes inherited from ReflectiveRapidJSON::SerializationCodeGenerator
const char * m_qualifiedNameOfRecords
const char * m_qualifiedNameOfAdaptionRecords

Additional Inherited Members

Public Types inherited from ReflectiveRapidJSON::SerializationCodeGenerator
enum class  IsRelevant { Yes , No , Maybe }
Static Protected Member Functions inherited from ReflectiveRapidJSON::SerializationCodeGenerator
static std::vector< const RelevantClass * > findRelevantBaseClasses (const RelevantClass &relevantClass, const std::vector< RelevantClass > &relevantBases)
Static Protected Member Functions inherited from ReflectiveRapidJSON::CodeGenerator
static clang::CXXBaseSpecifier * inheritsFromInstantiationOf (clang::CXXRecordDecl *record, const char *templateClass)
 Returns whether the specified record inherits from an instantiation of the specified templateClass.

Detailed Description

The BinarySerializationCodeGenerator class generates code for JSON (de)serialization of objects inheriting from an instantiation of JsonSerializable.

Definition at line 14 of file binaryserializationcodegenerator.h.

Constructor & Destructor Documentation

◆ BinarySerializationCodeGenerator()

ReflectiveRapidJSON::BinarySerializationCodeGenerator::BinarySerializationCodeGenerator ( CodeFactory & factory,
const Options & options )

Definition at line 34 of file binaryserializationcodegenerator.cpp.

Member Function Documentation

◆ computeRelevantClass()

void ReflectiveRapidJSON::BinarySerializationCodeGenerator::computeRelevantClass ( RelevantClass & possiblyRelevantClass) const
overrideprotectedvirtual

Checks whether possiblyRelevantClass is actually relevant.

Reimplemented from ReflectiveRapidJSON::SerializationCodeGenerator.

Definition at line 45 of file binaryserializationcodegenerator.cpp.

◆ generate()

void ReflectiveRapidJSON::BinarySerializationCodeGenerator::generate ( std::ostream & os) const
overridevirtual

Generates pull() and push() helper functions in the ReflectiveRapidJSON::BinaryReflector namespace for the relevant classes.

Implements ReflectiveRapidJSON::CodeGenerator.

Definition at line 195 of file binaryserializationcodegenerator.cpp.

Member Data Documentation

◆ m_options

const Options& ReflectiveRapidJSON::BinarySerializationCodeGenerator::m_options
protected

Definition at line 32 of file binaryserializationcodegenerator.h.


The documentation for this class was generated from the following files: