Parameters

class Parameters

Class for user-defined parameters.

Unnamed Group

template<typename T, typename S>
void add_param(const std::string &name, const S &value, const std::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>
void add_private_param(const std::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<std::string, Parameters::Value*>::iterator

Parameter map iterator.

using const_iterator = std::map<std::string, Parameters::Value*>::const_iterator

Constant parameter map iterator.

Public Functions

template<typename T>
inline bool has(const std::string &name) const

Check if parameter exist.

template<typename T>
inline const T &get(const std::string &name) const

Get parameter value.

template<typename T>
inline T &set(const std::string &name)

Set parameter.

template<typename T>
void add_required_param(const std::string &name, const std::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

inline bool is_param_required(const std::string &name) const

Returns a boolean indicating whether the specified parameter is required or not.

inline bool is_param_valid(const std::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

inline Parameters::iterator begin()

Iterator pointing to the beginning of the set of parameters.

inline Parameters::const_iterator begin() const

Iterator pointing to the beginning of the set of parameters.

inline Parameters::iterator end()

Iterator pointing to the end of the set of parameters.

inline Parameters::const_iterator end() const

Iterator pointing to the end of the set of parameters.

Parameters &operator=(const Parameters &rhs)

Assignment operator.

inline Parameters &operator+=(const Parameters &rhs)

Add rhs Parameters into this Parameters object.