GEGELATI
programExecutionEngine.h
1
38#ifndef PROGRAM_EXECUTION_ENGINE_H
39#define PROGRAM_EXECUTION_ENGINE_H
40
41#include <type_traits>
42
43#include "data/primitiveTypeArray.h"
44#include "data/untypedSharedPtr.h"
45#include "program/program.h"
46#include "program/programEngine.h"
47
48namespace Program {
53 {
54 protected:
57
58 public:
68
84 template <class T>
86 const Program& prog,
87 const std::vector<std::reference_wrapper<T>>& dataSrc)
88 : ProgramEngine(prog, dataSrc){};
89
101 prog.getEnvironment().getDataSources()){};
102
108 void executeCurrentLine();
109
124 double executeProgram(const bool ignoreException = false);
125
127 virtual void processLine() override;
128 };
129}; // namespace Program
130#endif
The Environment class contains all information needed to execute a Program.
Definition: environment.h:84
This abstract class is the base class for any program engine (generation and execution)
Definition: programEngine.h:54
const std::vector< std::reference_wrapper< const Data::DataHandler > > & getDataSources() const
Get the DataHandler of the ProgramExecutionEngine.
Definition: programEngine.cpp:91
Class in charge of executing a Program within its Environment.
Definition: programExecutionEngine.h:53
double executeProgram(const bool ignoreException=false)
Execute the program completely and returns the content of register 0.
Definition: programExecutionEngine.cpp:57
ProgramExecutionEngine()=delete
Default constructor is deleted.
virtual void processLine() override
inherited from Program::ProgramEngine
Definition: programExecutionEngine.cpp:71
void executeCurrentLine()
Execute the current line of the program.
Definition: programExecutionEngine.cpp:41
ProgramExecutionEngine(const Program &prog, const std::vector< std::reference_wrapper< T > > &dataSrc)
Constructor of the class.
Definition: programExecutionEngine.h:85
ProgramExecutionEngine(const Program &prog)
Constructor of the class.
Definition: programExecutionEngine.h:99
ProgramExecutionEngine(const Environment &env)
Constructor of the class.
Definition: programExecutionEngine.h:67
Definition: line.h:43