16 #ifndef _d2k_parameter_acceptor_h 17 #define _d2k_parameter_acceptor_h 19 #include <deal2lkit/config.h> 25 #include <boost/any.hpp> 404 static void initialize(
const std::string filename=
"",
405 const std::string outfilename=
"");
429 virtual void parse_parameters_call_back();
463 static void log_info();
480 std::string get_section_name()
const;
486 std::vector<std::string> get_section_path()
const;
496 const std::string &entry,
497 const std::string &default_value,
499 const std::string &documentation=std::string())
502 ExcMessage(
"You tried to add a parameter using a const " 503 "variable. This is not allowed, since these " 504 "variables will be filled later on when " 505 "parsing the parameter."));
507 prm.
declare_entry(entry, default_value, pattern, documentation);
508 parameters[entry] = boost::any(parameter);
530 const std::string &entry,
531 const std::string &documentation=std::string(),
535 ExcMessage(
"You tried to add a parameter using a const " 536 "variable. This is not allowed, since these " 537 "variables will be filled later on when " 538 "parsing the parameter."));
540 enter_my_subsection(prm);
542 *to_pattern(parameter),
544 leave_my_subsection(prm);
545 parameters[entry] = boost::any(¶meter);
565 static std_cxx11::shared_ptr<Patterns::PatternBase> to_pattern(
const T &);
571 static T to_type(
const std::string &);
589 static std::vector<SmartPointer<ParameterAcceptor> >
class_list;
603 static const char sep =
'/';
A parameter acceptor base class.
static ParameterHandler prm
Static parameter.
virtual void declare_parameters(ParameterHandler &)
Generate entries in the given parameter file.
#define AssertThrow(cond, exc)
void add_parameter(T ¶meter, const std::string &entry, const std::string &documentation=std::string(), ParameterHandler &prm=ParameterAcceptor::prm)
Add a parameter to the global parameter handler ParameterAcceptor::prm.
std::string to_string(const number value, const unsigned int digits=numbers::invalid_unsigned_int)
static::ExceptionBase & ExcMessage(std::string arg1)
const std::string section_name
The subsection name for this class.
void declare_entry(const std::string &entry, const std::string &default_value, const Patterns::PatternBase &pattern=Patterns::Anything(), const std::string &documentation=std::string())
static std::vector< SmartPointer< ParameterAcceptor > > class_list
A list containing all constructed classes of type ParameterAcceptor.
std::map< std::string, boost::any > parameters
A map of parameters that are initialized in this class with the functions add_parameters.
void add_parameter(ParameterHandler &prm, T *parameter, const std::string &entry, const std::string &default_value, const Patterns::PatternBase &pattern=Patterns::Anything(), const std::string &documentation=std::string())
Add a parameter the given parameter list.
const unsigned int acceptor_id
The index of this specific class within the class list.