GEGELATI

Loading...
Searching...
No Matches
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
44 namespace Data {
49 class DataHandlerPrinter
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
Data::DataHandlerPrinter
Class used to generate the declaration of operands of a line for the code gen.
Definition dataHandlerPrinter.h:50
Data::DataHandlerPrinter::print1DArray
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
Data::DataHandlerPrinter::DataHandlerPrinter
DataHandlerPrinter(const DataHandlerPrinter &other)=default
copy constructor
Data::DataHandlerPrinter::printDataAt
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
Data::DataHandlerPrinter::getDemangleTemplateType
std::string getDemangleTemplateType(const Data::DataHandler &dataHandler) const
function used to retrieve the typename of the template of the DataHandler.
Definition dataHandlerPrinter.cpp:100
Data::DataHandlerPrinter::getOperandSizes
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
Data::DataHandlerPrinter::DataHandlerPrinter
DataHandlerPrinter()=default
Constructor for the DataHandlerPrinter.
Data::DataHandlerPrinter::print2DArray
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
Data::DataHandlerPrinter::~DataHandlerPrinter
virtual ~DataHandlerPrinter()=default
destructor
Data::DataHandler
Base class for all sources of data to be accessed by a TPG Instruction executed within a Program.
Definition dataHandler.h:55
Data::PrimitiveTypeArray2D
DataHandler for 2D arrays of primitive types.
Definition primitiveTypeArray2D.h:69
Data
Definition array2DWrapper.h:44