19#include <boost/core/demangle.hpp>
43std::set<ParameterAcceptor *, internal::ParameterAcceptorCompare>
74 boost::core::demangle(
typeid(*this).name()));
81 const std::string &filename,
82 const std::string &output_filename,
88 if (!filename.empty())
94 catch (const ::ExcFileNotOpen &)
98 ExcMessage(
"You specified <" + filename +
"> as input " +
99 "parameter file, but it does not exist. " +
100 "We created it for you."));
104 if (!output_filename.empty())
152 instance->enter_my_subsection(
prm);
153 instance->parse_parameters(
prm);
154 instance->parse_parameters_call_back();
155 instance->leave_my_subsection(
prm);
166 instance->enter_my_subsection(
prm);
167 instance->declare_parameters(
prm);
168 instance->declare_parameters_call_back();
169 instance->leave_my_subsection(
prm);
175std::vector<std::string>
179 const bool is_absolute = (my_section_name.front() ==
sep);
181 std::vector<std::string> sections =
188 sections.erase(sections.begin());
199 const auto *
const acceptor = *acceptor_it;
202 bool has_trailing = acceptor->get_section_name().back() ==
sep;
203 auto previous_path = acceptor->get_section_path();
206 if ((previous_path.size() > 0) && has_trailing ==
false)
207 previous_path.resize(previous_path.size() - 1);
209 sections.insert(sections.begin(),
210 previous_path.begin(),
211 previous_path.end());
228 "A subsection name cannot contain the special character '/'"));
231 ExcMessage(
"Cannot create an empty subsection."));
242 ExcMessage(
"There is no subsection to leave here."));
253 for (
const auto &sec : sections)
266 for (
unsigned int i = 0; i < sections.size(); ++i)
285 static std::mutex id_mutex;
286 std::lock_guard<std::mutex> lock(id_mutex);
287 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)
void enter_subsection(const std::string &subsection, const bool create_path_if_needed=true)
std::ostream & print_parameters(std::ostream &out, const OutputStyle style) const
#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