21#include <boost/core/demangle.hpp>
22#include <boost/iterator/iterator_facade.hpp>
23#include <boost/move/utility_core.hpp>
24#include <boost/signals2/optional_last_value.hpp>
25#include <boost/smart_ptr/make_shared_object.hpp>
55std::set<ParameterAcceptor *, internal::ParameterAcceptorCompare>
86 boost::core::demangle(
typeid(*this).name()));
93 const std::string &filename,
94 const std::string &output_filename,
100 if (!filename.empty())
106 catch (const ::ExcFileNotOpen &)
110 ExcMessage(
"You specified <" + filename +
"> as input " +
111 "parameter file, but it does not exist. " +
112 "We created it for you."));
116 if (!output_filename.empty())
164 instance->enter_my_subsection(
prm);
165 instance->parse_parameters(
prm);
166 instance->parse_parameters_call_back();
167 instance->leave_my_subsection(
prm);
178 instance->enter_my_subsection(
prm);
179 instance->declare_parameters(
prm);
180 instance->declare_parameters_call_back();
181 instance->leave_my_subsection(
prm);
187std::vector<std::string>
191 const bool is_absolute = (my_section_name.front() ==
sep);
193 std::vector<std::string> sections =
200 sections.erase(sections.begin());
211 const auto *
const acceptor = *acceptor_it;
214 bool has_trailing = acceptor->get_section_name().back() ==
sep;
215 auto previous_path = acceptor->get_section_path();
218 if ((previous_path.size() > 0) && has_trailing ==
false)
219 previous_path.resize(previous_path.size() - 1);
221 sections.insert(sections.begin(),
222 previous_path.begin(),
223 previous_path.end());
240 "A subsection name cannot contain the special character '/'"));
243 ExcMessage(
"Cannot create an empty subsection."));
254 ExcMessage(
"There is no subsection to leave here."));
265 for (
const auto &sec : sections)
278 for (
unsigned int i = 0; i < sections.size(); ++i)
297 static std::mutex id_mutex;
298 std::scoped_lock lock(id_mutex);
299 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