ROSE 0.11.145.192
CerealSerializer.h
1#ifndef Rosebud_CerealSerializer_H
2#define Rosebud_CerealSerializer_H
3#include <Rosebud/Serializer.h>
4
5namespace Rosebud {
6
9public:
10 using Ptr = std::shared_ptr<CerealSerializer>;
11
12protected:
14
15public:
16 static Ptr instance();
17 virtual std::string name() const override;
18 virtual std::string purpose() const override;
19 virtual bool isSerializable(const Ast::ClassPtr&) const override;
20
21 virtual void genPrologue(std::ostream &header, std::ostream &impl, const Ast::ClassPtr&, const Hierarchy&,
22 const Generator&) const override;
23 virtual void genBody(std::ostream &header, std::ostream &impl, const Ast::ClassPtr&, const Hierarchy&,
24 const Generator&) const override;
25 virtual void genEpilogue(std::ostream &header, std::ostream &impl, const Ast::ClassPtr&, const Hierarchy&,
26 const Generator&) const override;
27};
28
29} // namespace
30#endif
Class serializer producing JSON.
virtual void genEpilogue(std::ostream &header, std::ostream &impl, const Ast::ClassPtr &, const Hierarchy &, const Generator &) const override
Generate epilogue code.
virtual std::string purpose() const override
Single-line description for the serializer.
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 bool isSerializable(const Ast::ClassPtr &) const override
Determines if a class should be serialized.
virtual std::string name() const override
Every serializer has a unique name.
virtual void genPrologue(std::ostream &header, std::ostream &impl, const Ast::ClassPtr &, const Hierarchy &, const Generator &) const override
Generate prologue code.
Base class for backend code generators.
Definition Generator.h:10
Base class for serialization generators.
Definition Serializer.h:13
Graph containing user-defined vertices and edges.
Definition Graph.h:634
std::shared_ptr< Class > ClassPtr
Shared-ownership pointer to a Class.
Rosebud is a tool to generate abstract syntax trees.
Definition Ast.h:14