tfel
Loading...
Searching...
No Matches
mfront::ConfigurationManager Struct Reference

class holding the global configuration of MFront More...

#include </home/runner/work/tfel/tfel/mfront/include/MFront/ConfigurationManager.hxx>

Inheritance diagram for mfront::ConfigurationManager:
mfront::GlobalDomainSpecificLanguageOptionsManager

Public Types

enum  Language {
  CXX , C , FORTRAN , CUDA ,
  HIP , SYCL
}
 list of supported languages (including extensions) for which options may be defined
enum  LanguageOptionCategory { PREPROCESSOR_FLAGS , COMPILATION_FLAGS }
 list of option categories for the supported languages
enum  LinkerOptionCategory { LINKER_FLAGS , LINK_PATHS , LINK_LIBRARIES }
 list of option categories for the linking the generated libraries
using DataMap = tfel::utilities::DataMap
 a simple alias

Public Member Functions

void addInterfaceOptions (const std::string &, const DataMap &)
 declare options for the given interface
void addMaterialPropertyInterfaceOptions (const std::string &, const DataMap &)
 declare options for the given interface
void addBehaviourInterfaceOptions (const std::string &, const DataMap &)
 declare options for the given interface
void addModelInterfaceOptions (const std::string &, const DataMap &)
 declare options for the given interface
DataMap getMaterialPropertyInterfaceOptions (const std::string &) const
DataMap getBehaviourInterfaceOptions (const std::string &) const
DataMap getModelInterfaceOptions (const std::string &) const
void setCompiler (const Language, const std::string &)
 set the compiler for the given language
std::optional< std::string > getCompiler (const Language) const
void addCompilationOption (const Language, const LanguageOptionCategory, const std::string &)
 add a compilation option of the given language
void addCompilationOptions (const Language, const LanguageOptionCategory, const std::vector< std::string > &)
 add a compilation option of the given language
std::optional< std::vector< std::string > > getCompilationOptions (const Language, const LanguageOptionCategory) const
void addLinkerOption (const LinkerOptionCategory, const std::string &)
 add a linker option
void addLinkerOptions (const LinkerOptionCategory, const std::vector< std::string > &)
 add a linker option
std::optional< std::vector< std::string > > getLinkerOptions (const LinkerOptionCategory) const
void addIncludePath (const std::string &)
 add a include path
void addIncludePaths (const std::vector< std::string > &)
 add a include path
std::set< std::string > getIncludePaths () const
Public Member Functions inherited from mfront::GlobalDomainSpecificLanguageOptionsManager
void addDSLOption (const std::string &, const std::string &)
 add an option that will be passed to all DSLs
void addMaterialPropertyDSLOption (const std::string &, const std::string &)
 add an option that will be passed to DSLs related to material properties.
void addBehaviourDSLOption (const std::string &, const std::string &)
 add an option that will be passed to DSLs related to behaviours.
void addModelDSLOption (const std::string &, const std::string &)
 add an option that will be passed to DSLs related to models.
void addDSLOption (const std::string &, const tfel::utilities::Data &)
 add an option that will be passed to all DSLs
void addMaterialPropertyDSLOption (const std::string &, const tfel::utilities::Data &)
 add an option that will be passed to DSLs related to material properties.
void addBehaviourDSLOption (const std::string &, const tfel::utilities::Data &)
 add an option that will be passed to DSLs related to behaviours.
void addModelDSLOption (const std::string &, const tfel::utilities::Data &)
 add an option that will be passed to DSLs related to models.
tfel::utilities::DataMap getMaterialPropertyDSLOptions () const
tfel::utilities::DataMap getBehaviourDSLOptions () const
tfel::utilities::DataMap getModelDSLOptions () const

Static Public Member Functions

static Language getLanguage (std::string_view)
 return the language associated with the given string
static LanguageOptionCategory getLanguageOptionsCategory (std::string_view)
 return the language options category associated with the given string
static LinkerOptionCategory getLinkerOptionsCategory (std::string_view)
 return the language options category associated with the given string
static ConfigurationManager & get () noexcept
 return the unique instance of this class

Additional Inherited Members

Protected Member Functions inherited from mfront::GlobalDomainSpecificLanguageOptionsManager
 GlobalDomainSpecificLanguageOptionsManager ()
 default constructor
 ~GlobalDomainSpecificLanguageOptionsManager ()
 destructor

Detailed Description

class holding the global configuration of MFront

Member Function Documentation

◆ addBehaviourInterfaceOptions()

void mfront::ConfigurationManager::addBehaviourInterfaceOptions ( const std::string & ,
const DataMap &  )

declare options for the given interface

Parameters
[in]iinterface name
[in]optsoptions
Note
the interface must be declared in the BehaviourInterfaceFactory factory, otherwise an exception is thrown

◆ addCompilationOption()

void mfront::ConfigurationManager::addCompilationOption ( const Language ,
const LanguageOptionCategory ,
const std::string &  )

add a compilation option of the given language

Parameters
[in]llanguage
[in]ccategory
[in]ooption

◆ addCompilationOptions()

void mfront::ConfigurationManager::addCompilationOptions ( const Language ,
const LanguageOptionCategory ,
const std::vector< std::string > &  )

add a compilation option of the given language

Parameters
[in]llanguage
[in]ccategory
[in]optsoptions

◆ addIncludePath()

void mfront::ConfigurationManager::addIncludePath ( const std::string & )

add a include path

Parameters
[in]ppath

◆ addIncludePaths()

void mfront::ConfigurationManager::addIncludePaths ( const std::vector< std::string > & )

add a include path

Parameters
[in]ccategory
[in]pathpaths

◆ addInterfaceOptions()

void mfront::ConfigurationManager::addInterfaceOptions ( const std::string & ,
const DataMap &  )

declare options for the given interface

Parameters
[in]iinterface name
[in]optsoptions
Note
the interface must be declared in the one of interface factories (MaterialPropertyInterfaceFactory, BehaviourInterfaceFactory, or ModelInterfaceFactory), otherwise an exception is thrown

◆ addLinkerOption()

void mfront::ConfigurationManager::addLinkerOption ( const LinkerOptionCategory ,
const std::string &  )

add a linker option

Parameters
[in]ccategory
[in]ooption

◆ addLinkerOptions()

void mfront::ConfigurationManager::addLinkerOptions ( const LinkerOptionCategory ,
const std::vector< std::string > &  )

add a linker option

Parameters
[in]ccategory
[in]optsoptions

◆ addMaterialPropertyInterfaceOptions()

void mfront::ConfigurationManager::addMaterialPropertyInterfaceOptions ( const std::string & ,
const DataMap &  )

declare options for the given interface

Parameters
[in]iinterface name
[in]optsoptions
Note
the interface must be declared in the MaterialPropertyInterfaceFactory factory, otherwise an exception is thrown

◆ addModelInterfaceOptions()

void mfront::ConfigurationManager::addModelInterfaceOptions ( const std::string & ,
const DataMap &  )

declare options for the given interface

Parameters
[in]iinterface name
[in]optsoptions
Note
the interface must be declared in the ModelInterfaceFactory factory, otherwise an exception is thrown

◆ getBehaviourInterfaceOptions()

DataMap mfront::ConfigurationManager::getBehaviourInterfaceOptions ( const std::string & ) const
Returns
the options for the given interface
Parameters
[in]iinterface name
Note
the options returned include the ones declared with addBehaviourInterfaceOptions and addInterfaceOptions
the interface must be declared in the BehaviourInterfaceFactory factory, otherwise an exception is thrown

◆ getCompilationOptions()

std::optional< std::vector< std::string > > mfront::ConfigurationManager::getCompilationOptions ( const Language ,
const LanguageOptionCategory  ) const
nodiscard
Returns
the compilation options for the given language and category
Parameters
[in]llanguage
[in]ccategory

◆ getCompiler()

std::optional< std::string > mfront::ConfigurationManager::getCompiler ( const Language ) const
nodiscard
Returns
the compiler for the given language, if set

◆ getIncludePaths()

std::set< std::string > mfront::ConfigurationManager::getIncludePaths ( ) const
nodiscard
Returns
the include paths

◆ getLanguage()

Language mfront::ConfigurationManager::getLanguage ( std::string_view )
staticnodiscard

return the language associated with the given string

Parameters
[in]sstring

◆ getLanguageOptionsCategory()

LanguageOptionCategory mfront::ConfigurationManager::getLanguageOptionsCategory ( std::string_view )
staticnodiscard

return the language options category associated with the given string

Parameters
[in]sstring

◆ getLinkerOptions()

std::optional< std::vector< std::string > > mfront::ConfigurationManager::getLinkerOptions ( const LinkerOptionCategory ) const
nodiscard
Returns
the linker options of the given category
Parameters
[in]ccategory

◆ getLinkerOptionsCategory()

LinkerOptionCategory mfront::ConfigurationManager::getLinkerOptionsCategory ( std::string_view )
staticnodiscard

return the language options category associated with the given string

Parameters
[in]sstring

◆ getMaterialPropertyInterfaceOptions()

DataMap mfront::ConfigurationManager::getMaterialPropertyInterfaceOptions ( const std::string & ) const
Returns
the options for the given interface
Parameters
[in]iinterface name
Note
the options returned include the ones declared with addMaterialPropertyInterfaceOptions and addInterfaceOptions
the interface must be declared in the MaterialPropertyInterfaceFactory factory, otherwise an exception is thrown
if no option is declared for this interface, an empty data map is returned.

◆ getModelInterfaceOptions()

DataMap mfront::ConfigurationManager::getModelInterfaceOptions ( const std::string & ) const
Returns
the options for the given interface
Parameters
[in]iinterface name
Note
the options returned include the ones declared with addModelInterfaceOptions and addInterfaceOptions
the interface must be declared in the ModelInterfaceFactory factory, otherwise an exception is thrown

◆ setCompiler()

void mfront::ConfigurationManager::setCompiler ( const Language ,
const std::string &  )

set the compiler for the given language

Parameters
[in]ccompiler
Note
an exception is thrown if the compiler is already set for the given language

The documentation for this struct was generated from the following file: