20#include <boost/core/demangle.hpp>
44std::set<ParameterAcceptor *, internal::ParameterAcceptorCompare>
77 boost::core::demangle(
typeid(*this).name()));
84 const std::string & filename,
85 const std::string & output_filename,
91 if (!filename.empty())
97 catch (const ::PathSearch::ExcFileNotFound &)
101 ExcMessage(
"You specified <" + filename +
"> as input " +
102 "parameter file, but it does not exist. " +
103 "We created it for you."));
107 if (!output_filename.empty())
155 instance->enter_my_subsection(
prm);
156 instance->parse_parameters(
prm);
157 instance->parse_parameters_call_back();
158 instance->leave_my_subsection(
prm);
169 instance->enter_my_subsection(
prm);
170 instance->declare_parameters(
prm);
171 instance->declare_parameters_call_back();
172 instance->leave_my_subsection(
prm);
178std::vector<std::string>
182 const bool is_absolute = (my_section_name.front() ==
sep);
184 std::vector<std::string> sections =
191 sections.erase(sections.begin());
202 const auto acceptor = *acceptor_it;
205 bool has_trailing = acceptor->get_section_name().back() ==
sep;
206 auto previous_path = acceptor->get_section_path();
209 if ((previous_path.size() > 0) && has_trailing ==
false)
210 previous_path.resize(previous_path.size() - 1);
212 sections.insert(sections.begin(),
213 previous_path.begin(),
214 previous_path.end());
231 "A subsection name cannot contain the special character '/'"));
234 ExcMessage(
"Cannot create an empty subsection."));
245 ExcMessage(
"There is no subsection to leave here."));
256 for (
const auto &sec : sections)
269 for (
unsigned int i = 0; i < sections.size(); ++i)
288 static std::mutex id_mutex;
289 std::lock_guard<std::mutex> lock(id_mutex);
290 static int current_id = 0;
virtual ~ParameterAcceptor() override
std::string get_section_name() const
static void declare_all_parameters(ParameterHandler &prm=ParameterAcceptor::prm)
unsigned int get_acceptor_id() const
const unsigned int acceptor_id
const std::string section_name
ParameterAcceptor(const std::string §ion_name="")
std::vector< std::string > subsections
static void initialize(const std::string &filename="", const std::string &output_filename="", const ParameterHandler::OutputStyle output_style_for_output_filename=ParameterHandler::Short, ParameterHandler &prm=ParameterAcceptor::prm, const ParameterHandler::OutputStyle output_style_for_filename=ParameterHandler::DefaultStyle)
static ParameterHandler prm
void leave_my_subsection(ParameterHandler &prm)
void enter_subsection(const std::string &subsection)
virtual void parse_parameters(ParameterHandler &prm)
static unsigned int get_next_free_id()
static void parse_all_parameters(ParameterHandler &prm=ParameterAcceptor::prm)
void enter_my_subsection(ParameterHandler &prm)
static std::mutex class_list_mutex
static std::set< ParameterAcceptor *, internal::ParameterAcceptorCompare > class_list
virtual void declare_parameters(ParameterHandler &prm)
std::vector< std::string > get_section_path() const
virtual void parse_input(std::istream &input, const std::string &filename="input file", const std::string &last_line="", const bool skip_undefined=false)
std::ostream & print_parameters(std::ostream &out, const OutputStyle style) const
void enter_subsection(const std::string &subsection)
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
static ::ExceptionBase & ExcIO()
static ::ExceptionBase & ExcMessage(std::string arg1)
#define AssertThrow(cond, exc)
std::vector< std::string > split_string_list(const std::string &s, const std::string &delimiter=",")
bool operator()(const ParameterAcceptor *p1, const ParameterAcceptor *p2) const