Parameters
-
class Parameters
Class for user-defined parameters.
Unnamed Group
-
template<typename T, typename S>
inline Parameters &add_param(String name, const S &value, String doc_string) These methods add an option parameter and a documentation string to the Parameters object. The first version of this function takes a default value which is used if the parameter is not found in the input file. The second method will leave the parameter uninitialized but can be checked with “is_param_valid” before use.
Unnamed Group
-
template<typename T>
inline Parameters &add_private_param(String name, const T &value) These methods add a parameter to the Parameters object which can be retrieved like any other parameter. This parameter however is not printed in the Input file syntax dump or web page dump so does not take a documentation string. The first version of this function takes an optional default value.
Public Types
-
using iterator = std::map<String, Qtr<Parameters::Value>>::iterator
Parameter map iterator.
-
using const_iterator = std::map<String, Qtr<Parameters::Value>>::const_iterator
Constant parameter map iterator.
Public Functions
-
Parameters(const Parameters &other)
Copy operator.
-
Parameters(Parameters &&other) noexcept
Move operator.
-
Parameters &operator=(const Parameters &other)
Assignment operator.
-
Parameters &operator=(Parameters &&other) noexcept
Move assignment.
-
template<typename T>
inline bool has(String name) const Check if parameter exist.
-
template<typename T>
inline Parameters &set(String name, T value) Set parameter.
-
template<typename T>
inline Parameters &add_required_param(String name, String doc_string) This method adds a parameter and documentation string to the Parameters object that will be extracted from the input file.
If the parameter is missing in the input file, and error will be thrown
-
bool is_param_required(String name) const
Returns a boolean indicating whether the specified parameter is required or not.
-
bool is_param_valid(String name) const
This method returns parameters that have been initialized in one fashion or another, i.e.
The value was supplied as a default argument or read and properly converted from the input file
-
Parameters::iterator begin()
Iterator pointing to the beginning of the set of parameters.
-
Parameters::const_iterator begin() const
Iterator pointing to the beginning of the set of parameters.
-
Parameters::iterator end()
Iterator pointing to the end of the set of parameters.
-
Parameters::const_iterator end() const
Iterator pointing to the end of the set of parameters.
-
Parameters &operator+=(const Parameters &other)
Add
otherParameters into this Parameters object.
-
template<typename T, typename S>