Public Types | Public Member Functions
CParamList Class Reference

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 (xmlpp::Element &root) const
 
bool has_key (const std::string &key) const
 
PParameteroperator[] (const std::string &key)
 
void print_help (std::ostream &os) const
 
void set (const CParsedOptions &options)
 

Detailed Description

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.

Member Typedef Documentation

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.

Member Function Documentation

void CParamList::add_dependend_handlers ( HandlerHelpMap handler_map) const

Add all plug-in handlers that may be called by processing this parameter list

Parameters
[in,out]handler_mapthe 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 ( xmlpp::Element &  root) const

Append the help for this parameter list to the given root node

Parameters
[in,out]rootthe root node of the XML tree
bool CParamList::has_key ( const std::string &  key) const
Parameters
key
Returns
true if the parameter list already has a parameter named key
PParameter& CParamList::operator[] ( const std::string &  key)

The operator to access the parameters in the list

Parameters
keythe name of the parameter
Returns
(shared) pointer to the associated parameter (or creates a new empty one)
void CParamList::print_help ( std::ostream &  os) const

prints out help strings for all parameters in the list

Parameters
osthe 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

Parameters
optionsa map of <key, value> string pairs

The documentation for this class was generated from the following file: