ROSE
0.11.137.0
|
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>
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... | |
Shared-ownership pointer.
Definition at line 17 of file Serializer.h.
|
static |
Register a serializer for use later.
|
static |
Return all registered serializers.
|
static |
Return the registered serializer with the specified name.
|
pure virtual |
Every serializer has a unique name.
Implemented in Rosebud::BoostSerializer, and Rosebud::NoneSerializer.
|
pure virtual |
Single-line description for the serializer.
Implemented in Rosebud::BoostSerializer, and Rosebud::NoneSerializer.
|
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.
|
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.