dune-fem  2.4.1-rc
Public Member Functions | Protected Attributes | List of all members
Dune::Fem::BasicParameterReader< Parameter > Struct Template Reference

#include </local/tomalk/somewhere/tmp/dune-fem/dune/fem/io/parameter/reader.hh>

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

Public Member Functions

 BasicParameterReader (Parameter parameter=Parameter())
 
bool exists (const std::string &key) const
 check, whether a parameter is defined More...
 
template<class T >
void get (const std::string &key, T &value) const
 get mandatory parameter More...
 
template<class T >
void get (const std::string &key, const T &defaultValue, T &value) const
 get optional parameter More...
 
void get (const std::string &key, const char *defaultValue, std::string &value) const
 get optional parameter (special case for string) More...
 
template<class T , class Validator >
void getValid (const std::string &key, const Validator &validator, T &value) const
 get mandatory parameter More...
 
template<class T , class Validator >
void getValid (const std::string &key, const T &defaultValue, const Validator &validator, T &value) const
 get optional parameter More...
 
template<class T >
getValue (const std::string &key) const
 get mandatory parameter More...
 
template<class T >
getValue (const std::string &key, const T &defaultValue) const
 get optional parameter More...
 
template<class T , class Validator >
getValidValue (const std::string &key, const Validator &validator) const
 get optional parameter More...
 
template<class T , class Validator >
getValidValue (const std::string &key, const T &defaultValue, const Validator &validator) const
 get optional parameter More...
 
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
 

Protected Attributes

Parameter parameter_
 

Constructor & Destructor Documentation

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

Member Function Documentation

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

Referenced by Dune::Fem::IOInterface::defaultGridKey(), and Dune::Fem::Parameter::exists().

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

Referenced by Dune::Fem::Parameter::get().

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

Referenced by Dune::Fem::Parameter::getValid(), and Dune::Fem::BasicParameterReader< std::function< const std::string *(const std::string &, const std::string *) > >::getValidValue().

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
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

Referenced by Dune::Fem::TimeProvider< Grid::Traits::CollectiveCommunication >::getCflFactor(), Dune::Fem::TimeProvider< Grid::Traits::CollectiveCommunication >::getUpdateStep(), and Dune::Fem::Parameter::getValidValue().

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
template<class Parameter>
template<class T >
T Dune::Fem::BasicParameterReader< Parameter >::getValue ( const std::string &  key) const
inline
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

Member Data Documentation

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

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