GEGELATI

Loading...
Searching...
No Matches
tpgGenerationEngine.h
1
38#ifdef CODE_GENERATION
39
40#ifndef TPG_GENERATION_ENGINE_H
41#define TPG_GENERATION_ENGINE_H
42#include <ios>
43#include <iostream>
44#include <string>
45
46#include "codeGen/programGenerationEngine.h"
47#include "tpg/tpgAbstractEngine.h"
48#include "tpg/tpgEdge.h"
49#include "tpg/tpgGraph.h"
50#include "tpg/tpgTeam.h"
51
52namespace CodeGen {
69 class TPGGenerationEngine : public TPG::TPGAbstractEngine
70 {
71 protected:
76 inline static const std::string filenameProg = "program";
77
79 std::ofstream fileMain;
81 std::ofstream fileMainH;
82
89 CodeGen::ProgramGenerationEngine progGenerationEngine;
90
97 virtual void initTpgFile() = 0;
98
107 virtual void initHeaderFile() = 0;
108
109 public:
122 TPGGenerationEngine(const std::string& filename,
123 const TPG::TPGGraph& tpg,
124 const std::string& path = "./");
125
131 virtual ~TPGGenerationEngine();
132
140 virtual void generateTPGGraph() = 0;
141
142 protected:
156 virtual void generateEdge(const TPG::TPGEdge& edge) = 0;
157
168 virtual void generateTeam(const TPG::TPGTeam& team) = 0;
169
180 virtual void generateAction(const TPG::TPGAction& action) = 0;
181 };
182} // namespace CodeGen
183
184#endif // TPGGENERATIONENGINE_H
185
186#endif // CODE_GENERATION
CodeGen::ProgramGenerationEngine
Class in charge of generating inference C code for all the Program of a TPG.
Definition programGenerationEngine.h:64
CodeGen::TPGGenerationEngine
Class in charge of generating the C code of a TPGGraph.
Definition tpgGenerationEngine.h:70
CodeGen::TPGGenerationEngine::initHeaderFile
virtual void initHeaderFile()=0
function printing generic code declaration in the main file header.
CodeGen::TPGGenerationEngine::generateAction
virtual void generateAction(const TPG::TPGAction &action)=0
Method for generating a action of the graph.
CodeGen::TPGGenerationEngine::initTpgFile
virtual void initTpgFile()=0
function printing generic code in the main file.
CodeGen::TPGGenerationEngine::generateTeam
virtual void generateTeam(const TPG::TPGTeam &team)=0
Method for generating the code for a team of the graph.
CodeGen::TPGGenerationEngine::fileMain
std::ofstream fileMain
File holding the functions in charge of iterating through the TPG.
Definition tpgGenerationEngine.h:79
CodeGen::TPGGenerationEngine::generateEdge
virtual void generateEdge(const TPG::TPGEdge &edge)=0
Method for generating the code for an edge of the graph.
CodeGen::TPGGenerationEngine::fileMainH
std::ofstream fileMainH
header file for the function that iterates through the TPG.
Definition tpgGenerationEngine.h:81
CodeGen::TPGGenerationEngine::generateTPGGraph
virtual void generateTPGGraph()=0
function that creates the C files required to execute the TPG without gegelati.
CodeGen::TPGGenerationEngine::~TPGGenerationEngine
virtual ~TPGGenerationEngine()
destructor of the class.
Definition tpgGenerationEngine.cpp:87
CodeGen::TPGGenerationEngine::filenameProg
static const std::string filenameProg
Definition tpgGenerationEngine.h:76
CodeGen::TPGGenerationEngine::TPGGenerationEngine
TPGGenerationEngine(const std::string &filename, const TPG::TPGGraph &tpg, const std::string &path="./")
Main constructor of the class.
Definition tpgGenerationEngine.cpp:45
CodeGen::TPGGenerationEngine::progGenerationEngine
CodeGen::ProgramGenerationEngine progGenerationEngine
ProgramGenerationEngine for generating Programs of edges.
Definition tpgGenerationEngine.h:89
TPG::TPGAbstractEngine
Abstract Class in charge of managing maps to give a unique ID for vertex and a program of a TPGGraph.
Definition tpgAbstractEngine.h:49
TPG::TPGAbstractEngine::tpg
const TPG::TPGGraph & tpg
Reference to the TPGGraph whose content will be used to fill the maps.
Definition tpgAbstractEngine.h:56
TPG::TPGAction
Class representing an Action of a TPGGraph.
Definition tpgAction.h:55
TPG::TPGEdge
Class representing edges of the Tangled Program Graphs.
Definition tpgEdge.h:54
TPG::TPGGraph
Class for storing a Tangled-Program-Graph.
Definition tpgGraph.h:58
TPG::TPGTeam
Definition tpgTeam.h:49
CodeGen
Definition programGenerationEngine.h:49