1 /*! 2 * \file mfront/include/MFront/AbstractMaterialPropertyInterface.hxx 3 * \brief 4 * 5 * \author Thomas Helfer 6 * \date 16 jan 2007 7 * \copyright Copyright (C) 2006-2018 CEA/DEN, EDF R&D. All rights 8 * reserved. 9 * This project is publicly released under either the GNU GPL Licence 10 * or the CECILL-A licence. A copy of thoses licences are delivered 11 * with the sources of TFEL. CEA or EDF may also distribute this 12 * project under specific licensing conditions. 13 */ 14 15 #ifndef LIB_MFRONT_ABSTRACTMATERIALPROPERTYINTERFACE_HXX 16 #define LIB_MFRONT_ABSTRACTMATERIALPROPERTYINTERFACE_HXX 17 18 #include<map> 19 #include<string> 20 #include<utility> 21 #include<vector> 22 23 #include"MFront/MFrontConfig.hxx" 24 #include"TFEL/Utilities/CxxTokenizer.hxx" 25 26 namespace mfront{ 27 28 // forward declartion 29 struct MaterialPropertyDescription; 30 // forward declartion 31 struct FileDescription; 32 // forward declartion 33 struct TargetsDescription; 34 35 /*! 36 * \brief abstract interface for material property interface. 37 */ 38 struct MFRONT_VISIBILITY_EXPORT AbstractMaterialPropertyInterface 39 { 40 //! a simple alias 41 using tokens_iterator = 42 tfel::utilities::CxxTokenizer::TokensContainer::const_iterator; 43 /*! 44 * \param[in] k : keyword to be treated 45 * \param[in] i: list of interfaces to which the keyword is restricted 46 * \param[in] p : iterator to the current token 47 * \param[in] pe : iterator past the end of the file 48 * \return a pair. The first entry is true if the keyword was 49 * treated by the interface. The second entry is an iterator after 50 * the last token treated. 51 */ 52 virtual std::pair<bool,tokens_iterator> 53 treatKeyword(const std::string&, 54 const std::vector<std::string>&, 55 tokens_iterator, 56 const tokens_iterator) = 0; 57 /*! 58 * \brief generate the output files 59 * \param[in] mpd: material property description 60 * \param[in] fd: mfront file description 61 */ 62 virtual void writeOutputFiles(const MaterialPropertyDescription&, 63 const FileDescription&) const = 0; 64 /*! 65 * \brief : fill the target descripton 66 * \param[out] d: target description 67 * \param[in] mpd: material property description 68 */ 69 virtual void getTargetsDescription(TargetsDescription&, 70 const MaterialPropertyDescription&) const = 0; 71 //! destructor 72 virtual ~AbstractMaterialPropertyInterface(); 73 }; // end of AbstractMaterialPropertyInterface 74 75 } // end of namespace mfront 76 77 #endif /* LIB_MFRONT_ABSTRACTMATERIALPROPERTYINTERFACE_HXX */ 78