GEGELATI
dataHandlerPrinter.h
1
37#ifdef CODE_GENERATION
38#ifndef DATA_HANDLER_PRINTER_H
39#define DATA_HANDLER_PRINTER_H
40
41#include "data/dataHandler.h"
42#include "data/demangle.h"
43
44namespace Data {
50 {
51 public:
53 DataHandlerPrinter() = default;
54
56 virtual ~DataHandlerPrinter() = default;
57
59 DataHandlerPrinter(const DataHandlerPrinter& other) = default;
60
77 std::string printDataAt(const Data::DataHandler& dataHandler,
78 const std::type_info& type,
79 const size_t& address,
80 const std::string& nameVar) const;
81
94 std::string print1DArray(const size_t& start, const size_t& size,
95 const std::string& nameVar) const; // override;
96
116 std::string print2DArray(const size_t& start,
117 const std::vector<size_t>& sourceTabSize,
118 const std::vector<size_t>& generatedTabSize,
119 const std::string& nameVar) const;
120
129 std::string getDemangleTemplateType(
130 const Data::DataHandler& dataHandler) const;
131
139 static std::vector<size_t> getOperandSizes(const std::type_info& type);
140 };
141
142} // namespace Data
143
144#endif // DATAHANDLERPRINTER_H
145#endif // CODE_GENERATION
Class used to generate the declaration of operands of a line for the code gen.
Definition: dataHandlerPrinter.h:50
std::string print1DArray(const size_t &start, const size_t &size, const std::string &nameVar) const
Function that return the initialization of a 1D array.
Definition: dataHandlerPrinter.cpp:107
DataHandlerPrinter(const DataHandlerPrinter &other)=default
copy constructor
std::string printDataAt(const Data::DataHandler &dataHandler, const std::type_info &type, const size_t &address, const std::string &nameVar) const
Function used to generate the declaration of an operand based on its type.
Definition: dataHandlerPrinter.cpp:42
std::string getDemangleTemplateType(const Data::DataHandler &dataHandler) const
function used to retrieve the typename of the template of the DataHandler.
Definition: dataHandlerPrinter.cpp:100
static std::vector< size_t > getOperandSizes(const std::type_info &type)
Function that return the size of each dimension of an operand.
Definition: dataHandlerPrinter.cpp:150
DataHandlerPrinter()=default
Constructor for the DataHandlerPrinter.
std::string print2DArray(const size_t &start, const std::vector< size_t > &sourceTabSize, const std::vector< size_t > &generatedTabSize, const std::string &nameVar) const
Function that return the initialization of a 2D array.
Definition: dataHandlerPrinter.cpp:122
virtual ~DataHandlerPrinter()=default
destructor
Base class for all sources of data to be accessed by a TPG Instruction executed within a Program.
Definition: dataHandler.h:54
Definition: array2DWrapper.h:44