A class to hold a list of named parameters. More...
#include <mia/core/optparam.hh>
Public Types | |
typedef std::shared_ptr< CParameter > | PParameter |
a shared pointer to a parameter to make handling easier More... | |
Public Member Functions | |
void | add_dependend_handlers (HandlerHelpMap &handler_map) const |
void | check_required () const |
void | get_help_xml (CXMLElement &root) const |
bool | has_key (const std::string &key) const |
PParameter & | operator[] (const std::string &key) |
void | print_help (std::ostream &os) const |
void | set (const CParsedOptions &options) |
A class to hold a list of named parameters.
It takes care of setting the parameters based on its names, and can check whether required parameters are really set.
Definition at line 42 of file optparam.hh.
typedef std::shared_ptr<CParameter > CParamList::PParameter |
a shared pointer to a parameter to make handling easier
Definition at line 47 of file optparam.hh.
void CParamList::add_dependend_handlers | ( | HandlerHelpMap & | handler_map | ) | const |
Add all plug-in handlers that may be called by processing this parameter list
[in,out] | handler_map | the map to add the handlers to |
void CParamList::check_required | ( | ) | const |
checks whether all required parameters have been set and throws an invalid_argument exception if not.
void CParamList::get_help_xml | ( | CXMLElement & | root | ) | const |
Append the help for this parameter list to the given root node
[in,out] | root | the root node of the XML tree |
bool CParamList::has_key | ( | const std::string & | key | ) | const |
key |
PParameter& CParamList::operator[] | ( | const std::string & | key | ) |
The operator to access the parameters in the list
key | the name of the parameter |
void CParamList::print_help | ( | std::ostream & | os | ) | const |
prints out help strings for all parameters in the list
os | the output stream to write the help to. |
void CParamList::set | ( | const CParsedOptions & | options | ) |
Set all the parameters that are given in the option list. If a parameter is unknown to the list, it throws an invalid_argument exception
options | a map of <key, value> string pairs |