/*************************************** Auteur : Pierre Aubert Mail : aubertp7@gmail.com Licence : CeCILL-C ****************************************/ #ifndef __PREPR_H__ #define __PREPR_H__ #include #include ///@brief Dimention of a tensor configuration class PDimention{ public: PDimention(); PDimention(const PDimention & other); virtual ~PDimention(); PDimention & operator = (const PDimention & other); void setName(const std::string & name); void setValue(const size_t & value); void setIsValue(bool isValue); const std::string & getName() const; std::string & getName(); const size_t & getValue() const; size_t & getValue(); bool getIsValue() const; bool & getIsValue(); protected: void copyPDimention(const PDimention & other); private: ///Name of the variable associated to this dimention std::string p_name; ///Fixed value of the dimention size_t p_value; ///True if the Dimention is a fixed value bool p_isValue; }; ///@brief Attribute of a generated class class PAttribute{ public: PAttribute(); PAttribute(const PAttribute & other); virtual ~PAttribute(); PAttribute & operator = (const PAttribute & other); void setName(const std::string & name); void setColName(const std::string & colName); void setType(const std::string & type); void setDocString(const std::string & docString); void setVecDim(const std::vector & vecDim); const std::string & getName() const; std::string & getName(); const std::string & getColName() const; std::string & getColName(); const std::string & getType() const; std::string & getType(); const std::string & getDocString() const; std::string & getDocString(); const std::vector & getVecDim() const; std::vector & getVecDim(); protected: void copyPAttribute(const PAttribute & other); private: ///Name of the attribute std::string p_name; ///Name of the associated column std::string p_colName; ///Type of the column std::string p_type; ///Documentation string std::string p_docString; ///Vector of all dimention if the attribute is a tensor std::vector p_vecDim; }; ///@brief Generated DataSet class class PTable{ public: PTable(); PTable(const PTable & other); virtual ~PTable(); PTable & operator = (const PTable & other); void setName(const std::string & name); void setDataSetName(const std::string & dataSetName); void setVarNbEntry(const std::string & varNbEntry); void setDocString(const std::string & docString); void setVecAttribute(const std::vector & vecAttribute); const std::string & getName() const; std::string & getName(); const std::string & getDataSetName() const; std::string & getDataSetName(); const std::string & getVarNbEntry() const; std::string & getVarNbEntry(); const std::string & getDocString() const; std::string & getDocString(); const std::vector & getVecAttribute() const; std::vector & getVecAttribute(); protected: void copyPTable(const PTable & other); private: ///Name of the generated class std::string p_name; ///Name of the corresponding DataSet std::string p_dataSetName; ///Name of the variable which describes the number of entries (or row) of the current PTable (or DataSet) std::string p_varNbEntry; ///Documentation string of the current PTable std::string p_docString; ///Vector of all the attributes of the PTable std::vector p_vecAttribute; }; ///@brief Configuration file which will produce a source and header in C++ class PSource{ public: PSource(); PSource(const PSource & other); virtual ~PSource(); PSource & operator = (const PSource & other); void setName(const std::string & name); void setVecTable(const std::vector & vecTable); const std::string & getName() const; std::string & getName(); const std::vector & getVecTable() const; std::vector & getVecTable(); protected: void copyPSource(const PSource & other); private: ///Name of the source file (without extention) std::string p_name; ///Vector of all tables describes in the current PSource std::vector p_vecTable; }; #endif