dune-fem  2.8-git
parametertree.hh
Go to the documentation of this file.
1 #ifndef DUNE_FEM_IO_PARAMETER_PARAMETERTREE_HH
2 #define DUNE_FEM_IO_PARAMETER_PARAMETERTREE_HH
3 
4 #include <dune/common/parametertree.hh>
5 
7 
8 namespace Dune
9 {
10 
11  namespace Fem
12  {
13 
14  // parameterReader
15  // ---------------
16 
17  inline static ParameterReader parameterReader ( const ParameterTree &parameterTree )
18  {
19  return ParameterReader( [ &parameterTree ] ( const std::string &key, const std::string *defaultValue ) {
20  return (parameterTree.hasKey( key ) ? &parameterTree[ key ] : defaultValue);
21  } );
22  }
23 
24  } // namespace Fem
25 
26 } // namespace Dune
27 
28 #endif // #ifndef DUNE_FEM_IO_PARAMETER_PARAMETERTREE_HH
Definition: bindguard.hh:11
static ParameterReader parameterReader(const ParameterTree &parameterTree)
Definition: parametertree.hh:17
BasicParameterReader< std::function< const std::string *(const std::string &, const std::string *) > > ParameterReader
Definition: reader.hh:315