dune-fem 2.8.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Attributes | List of all members
Dune::Fem::BasicParameterReader< Parameter > Struct Template Reference

#include <dune/fem/io/parameter/reader.hh>

Inheritance diagram for Dune::Fem::BasicParameterReader< Parameter >:
Inheritance graph

Public Types

typedef BasicParameterReader< ParameterThisType
 

Public Member Functions

 BasicParameterReader (Parameter parameter=Parameter())
 
bool exists (const std::string &key) const
 check, whether a parameter is defined
 
template<class T >
void get (const std::string &key, T &value) const
 get mandatory parameter
 
template<class T >
void get (const std::string &key, const T &defaultValue, T &value) const
 get optional parameter
 
void get (const std::string &key, const char *defaultValue, std::string &value) const
 get optional parameter (special case for string)
 
template<class T , class Validator >
void getValid (const std::string &key, const Validator &validator, T &value) const
 get mandatory parameter
 
template<class T , class Validator >
void getValid (const std::string &key, const T &defaultValue, const Validator &validator, T &value) const
 get optional parameter
 
template<class T >
getValue (const std::string &key) const
 get mandatory parameter
 
template<class T >
getValue (const std::string &key, const T &defaultValue) const
 get optional parameter
 
template<class T , class Validator >
getValidValue (const std::string &key, const Validator &validator) const
 get optional parameter
 
template<class T , class Validator >
getValidValue (const std::string &key, const T &defaultValue, const Validator &validator) const
 get optional parameter
 
template<int n>
int getEnum (const std::string &key, const std::string(&values)[n]) const
 
template<int n>
int getEnum (const std::string &key, const std::string(&values)[n], int defaultValue) const
 
int getEnum (const std::string &key, const std::vector< std::string > &values) const
 
int getEnum (const std::string &key, const std::vector< std::string > &values, int defaultValue) const
 
ThisTypeclone () const
 
Parameter parameter ()
 
const Parameter parameter () const
 
void reset ()
 

Protected Attributes

Parameter parameter_
 

Member Typedef Documentation

◆ ThisType

Constructor & Destructor Documentation

◆ BasicParameterReader()

template<class Parameter >
Dune::Fem::BasicParameterReader< Parameter >::BasicParameterReader ( Parameter  parameter = Parameter())
inlineexplicit

Member Function Documentation

◆ clone()

template<class Parameter >
ThisType * Dune::Fem::BasicParameterReader< Parameter >::clone ( ) const
inline

◆ exists()

template<class Parameter >
bool Dune::Fem::BasicParameterReader< Parameter >::exists ( const std::string &  key) const
inline

check, whether a parameter is defined

Parameters
[in]keyname of the parameter to check
Returns
true, if the parameter is found, false otherwise

◆ get() [1/3]

template<class Parameter >
void Dune::Fem::BasicParameterReader< Parameter >::get ( const std::string &  key,
const char *  defaultValue,
std::string &  value 
) const
inline

get optional parameter (special case for string)

Note
This method returns a default value, if the parameter cannot be found.
Parameters
[in]keyname of the parameter to get
[in]defaultValuedefault value for this parameter
[out]valuevalue of the parameter

◆ get() [2/3]

template<class Parameter >
template<class T >
void Dune::Fem::BasicParameterReader< Parameter >::get ( const std::string &  key,
const T &  defaultValue,
T &  value 
) const
inline

get optional parameter

Note
This method returns a default value, if the parameter cannot be found.
Parameters
[in]keyname of the parameter to get
[in]defaultValuedefault value for this parameter
[out]valuevalue of the parameter

◆ get() [3/3]

template<class Parameter >
template<class T >
void Dune::Fem::BasicParameterReader< Parameter >::get ( const std::string &  key,
T &  value 
) const
inline

get mandatory parameter

Note
This method throws an exception, if the parameter cannot be found.
Parameters
[in]keyname of the parameter to get
[out]valuevalue of the parameter

◆ getEnum() [1/4]

template<class Parameter >
template<int n>
int Dune::Fem::BasicParameterReader< Parameter >::getEnum ( const std::string &  key,
const std::string(&)  values[n] 
) const
inline

◆ getEnum() [2/4]

template<class Parameter >
template<int n>
int Dune::Fem::BasicParameterReader< Parameter >::getEnum ( const std::string &  key,
const std::string(&)  values[n],
int  defaultValue 
) const
inline

◆ getEnum() [3/4]

template<class Parameter >
int Dune::Fem::BasicParameterReader< Parameter >::getEnum ( const std::string &  key,
const std::vector< std::string > &  values 
) const
inline

◆ getEnum() [4/4]

template<class Parameter >
int Dune::Fem::BasicParameterReader< Parameter >::getEnum ( const std::string &  key,
const std::vector< std::string > &  values,
int  defaultValue 
) const
inline

◆ getValid() [1/2]

template<class Parameter >
template<class T , class Validator >
void Dune::Fem::BasicParameterReader< Parameter >::getValid ( const std::string &  key,
const T &  defaultValue,
const Validator &  validator,
T &  value 
) const
inline

get optional parameter

Note
This method returns a default value, if the parameter cannot be found.
Parameters
[in]keyname of the parameter to get
[in]defaultValuedefault value for this parameter
[in]validatorvalidator for the parameter value
[out]valuevalue of the parameter

◆ getValid() [2/2]

template<class Parameter >
template<class T , class Validator >
void Dune::Fem::BasicParameterReader< Parameter >::getValid ( const std::string &  key,
const Validator &  validator,
T &  value 
) const
inline

get mandatory parameter

Note
This method throws an exception, if the parameter cannot be found.
Parameters
[in]keyname of the parameter to get
[in]validatorvalidator for the parameter value
[out]valuevalue of the parameter

◆ getValidValue() [1/2]

template<class Parameter >
template<class T , class Validator >
T Dune::Fem::BasicParameterReader< Parameter >::getValidValue ( const std::string &  key,
const T &  defaultValue,
const Validator &  validator 
) const
inline

get optional parameter

Note
This method returns a default value, if the parameter cannot be found.
Parameters
[in]keyname of the parameter to get
[in]defaultValuedefault value for this parameter
[in]validatorvalidator for the parameter value
Returns
value of the parameter

◆ getValidValue() [2/2]

template<class Parameter >
template<class T , class Validator >
T Dune::Fem::BasicParameterReader< Parameter >::getValidValue ( const std::string &  key,
const Validator &  validator 
) const
inline

get optional parameter

Note
This method returns a default value, if the parameter cannot be found.
Parameters
[in]keyname of the parameter to get
[in]validatorvalidator for the parameter value
Returns
value of the parameter

◆ getValue() [1/2]

template<class Parameter >
template<class T >
T Dune::Fem::BasicParameterReader< Parameter >::getValue ( const std::string &  key) const
inline

get mandatory parameter

Note
This method throws an exception, if the parameter cannot be found.
Parameters
[in]keyname of the parameter to get
Returns
value of the parameter

◆ getValue() [2/2]

template<class Parameter >
template<class T >
T Dune::Fem::BasicParameterReader< Parameter >::getValue ( const std::string &  key,
const T &  defaultValue 
) const
inline

get optional parameter

Note
This method returns a default value, if the parameter cannot be found.
Parameters
[in]keyname of the parameter to get
[in]defaultValuedefault value for this parameter
Returns
value of the parameter

◆ parameter() [1/2]

template<class Parameter >
Parameter Dune::Fem::BasicParameterReader< Parameter >::parameter ( )
inline

◆ parameter() [2/2]

template<class Parameter >
const Parameter Dune::Fem::BasicParameterReader< Parameter >::parameter ( ) const
inline

◆ reset()

template<class Parameter >
void Dune::Fem::BasicParameterReader< Parameter >::reset ( )
inline

Member Data Documentation

◆ parameter_

template<class Parameter >
Parameter Dune::Fem::BasicParameterReader< Parameter >::parameter_
protected

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