ROSE  0.11.145.0
Public Types | Public Member Functions | Static Public Member Functions | List of all members
Rosebud::Serializer Class Referenceabstract

Description

Base class for serialization generators.

A serialization generator is responsible for generating C++ source code to serialize and deserialize instances of an node class.

Definition at line 11 of file Serializer.h.

#include <Rosebud/Serializer.h>

Inheritance diagram for Rosebud::Serializer:
Inheritance graph
[legend]

Public Types

using Ptr = SerializerPtr
 Shared-ownership pointer. More...
 

Public Member Functions

virtual std::string name () const =0
 Every serializer has a unique name. More...
 
virtual std::string purpose () const =0
 Single-line description for the serializer. More...
 
virtual bool isSerializable (const Ast::ClassPtr &) const =0
 Determines if a class should be serialized. More...
 
virtual void generate (std::ostream &header, std::ostream &impl, const Ast::ClassPtr &, const Generator &) const =0
 Generate code for the specified class. More...
 

Static Public Member Functions

static void registerSerializer (const Ptr &)
 Register a serializer for use later. More...
 
static const std::vector< Ptr > & registeredSerializers ()
 Return all registered serializers. More...
 
static Ptr lookup (const std::string &)
 Return the registered serializer with the specified name. More...
 

Member Typedef Documentation

Shared-ownership pointer.

Definition at line 17 of file Serializer.h.

Member Function Documentation

static void Rosebud::Serializer::registerSerializer ( const Ptr )
static

Register a serializer for use later.

static const std::vector<Ptr>& Rosebud::Serializer::registeredSerializers ( )
static

Return all registered serializers.

static Ptr Rosebud::Serializer::lookup ( const std::string &  )
static

Return the registered serializer with the specified name.

virtual std::string Rosebud::Serializer::name ( ) const
pure virtual

Every serializer has a unique name.

Implemented in Rosebud::BoostSerializer, and Rosebud::NoneSerializer.

virtual std::string Rosebud::Serializer::purpose ( ) const
pure virtual

Single-line description for the serializer.

Implemented in Rosebud::BoostSerializer, and Rosebud::NoneSerializer.

virtual bool Rosebud::Serializer::isSerializable ( const Ast::ClassPtr ) const
pure virtual

Determines if a class should be serialized.

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

Implemented in Rosebud::BoostSerializer, and Rosebud::NoneSerializer.

virtual void Rosebud::Serializer::generate ( std::ostream &  header,
std::ostream &  impl,
const Ast::ClassPtr ,
const Generator  
) const
pure virtual

Generate code for the specified class.

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.

Implemented in Rosebud::BoostSerializer, and Rosebud::NoneSerializer.


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