ROSE 0.11.145.192
Public Types | Public Member Functions | Static Public Member Functions | List of all members
Rosebud::CerealSerializer Class Reference

Description

Class serializer producing JSON.

Definition at line 8 of file CerealSerializer.h.

#include <Rosebud/CerealSerializer.h>

Inheritance diagram for Rosebud::CerealSerializer:
Inheritance graph
[legend]
Collaboration diagram for Rosebud::CerealSerializer:
Collaboration graph
[legend]

Public Types

using Ptr = std::shared_ptr< CerealSerializer >
 
- Public Types inherited from Rosebud::Serializer
using Ptr = SerializerPtr
 Shared-ownership pointer.
 

Public Member Functions

virtual std::string name () const override
 Every serializer has a unique name.
 
virtual std::string purpose () const override
 Single-line description for the serializer.
 
virtual bool isSerializable (const Ast::ClassPtr &) const override
 Determines if a class should be serialized.
 
virtual void genPrologue (std::ostream &header, std::ostream &impl, const Ast::ClassPtr &, const Hierarchy &, const Generator &) const override
 Generate prologue code.
 
virtual void genBody (std::ostream &header, std::ostream &impl, const Ast::ClassPtr &, const Hierarchy &, const Generator &) const override
 Generate main serialization code for the specified class.
 
virtual void genEpilogue (std::ostream &header, std::ostream &impl, const Ast::ClassPtr &, const Hierarchy &, const Generator &) const override
 Generate epilogue code.
 

Static Public Member Functions

static Ptr instance ()
 
- Static Public Member Functions inherited from Rosebud::Serializer
static void registerSerializer (const Ptr &)
 Register a serializer for use later.
 
static const std::vector< Ptr > & registeredSerializers ()
 Return all registered serializers.
 
static Ptr lookup (const std::string &)
 Return the registered serializer with the specified name.
 
static std::vector< Ptrlookup (const std::vector< std::string > &)
 Returns the serializers registered with the specified names.
 

Member Typedef Documentation

◆ Ptr

using Rosebud::CerealSerializer::Ptr = std::shared_ptr<CerealSerializer>

Definition at line 10 of file CerealSerializer.h.

Constructor & Destructor Documentation

◆ CerealSerializer()

Rosebud::CerealSerializer::CerealSerializer ( )
inlineprotected

Definition at line 13 of file CerealSerializer.h.

Member Function Documentation

◆ name()

virtual std::string Rosebud::CerealSerializer::name ( ) const
overridevirtual

Every serializer has a unique name.

Implements Rosebud::Serializer.

◆ purpose()

virtual std::string Rosebud::CerealSerializer::purpose ( ) const
overridevirtual

Single-line description for the serializer.

Implements Rosebud::Serializer.

◆ isSerializable()

virtual bool Rosebud::CerealSerializer::isSerializable ( const Ast::ClassPtr ) const
overridevirtual

Determines if a class should be serialized.

Returns true if this class should have serilization and deserialization functions.

Implements Rosebud::Serializer.

◆ genPrologue()

virtual void Rosebud::CerealSerializer::genPrologue ( std::ostream &  header,
std::ostream &  impl,
const Ast::ClassPtr ,
const Hierarchy ,
const Generator  
) const
overridevirtual

Generate prologue code.

In the header file, the prologue goes immediately after the generated include-once protection and before any user-written pre-class-definition code.

Implements Rosebud::Serializer.

◆ genBody()

virtual void Rosebud::CerealSerializer::genBody ( std::ostream &  header,
std::ostream &  impl,
const Ast::ClassPtr ,
const Hierarchy ,
const Generator  
) const
overridevirtual

Generate main serialization code for the specified class.

This code emitted by this function will appear inside the class definition in the header, and near the end of the implementation file.

The header and impl streams are output streams for the C++ header file and implementation file, respectively. The generator is from whence this serializer was called.

Implements Rosebud::Serializer.

◆ genEpilogue()

virtual void Rosebud::CerealSerializer::genEpilogue ( std::ostream &  header,
std::ostream &  impl,
const Ast::ClassPtr ,
const Hierarchy ,
const Generator  
) const
overridevirtual

Generate epilogue code.

In the header file, this goes at the end of the file, after the class definition and after the namespace (if any) but before the closing compile-once directives.

Implements Rosebud::Serializer.


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