1 #ifndef Rosebud_Serializer_H
2 #define Rosebud_Serializer_H
3 #include <Rosebud/Ast.h>
23 static std::vector<Ptr> registry_;
48 virtual std::string
name()
const = 0;
51 virtual std::string
purpose()
const = 0;
66 virtual void generate(std::ostream &header, std::ostream &impl,
const Ast::ClassPtr&,
const Generator&)
const = 0;
72 static void initRegistry();
static Ptr lookup(const std::string &)
Return the registered serializer with the specified name.
Rosebud is a tool to generate code for ROSE.
std::shared_ptr< Serializer > SerializerPtr
Shared-ownership pointer to a Serializer.
virtual void generate(std::ostream &header, std::ostream &impl, const Ast::ClassPtr &, const Generator &) const =0
Generate code for the specified class.
virtual std::string purpose() const =0
Single-line description for the serializer.
static const std::vector< Ptr > & registeredSerializers()
Return all registered serializers.
static void registerSerializer(const Ptr &)
Register a serializer for use later.
std::shared_ptr< Class > ClassPtr
Shared-ownership pointer to a Class.
virtual std::string name() const =0
Every serializer has a unique name.
virtual bool isSerializable(const Ast::ClassPtr &) const =0
Determines if a class should be serialized.
SerializerPtr Ptr
Shared-ownership pointer.
Base class for serialization generators.