CParamList Class Reference
Command line and parameter parsing

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

## 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)

## 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

## PParameter

typedef std::shared_ptr<CParameter > CParamList::PParameter

a shared pointer to a parameter to make handling easier

Definition at line 48 of file optparam.hh.

## Member Function Documentation

## add_dependend_handlers()

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_map | the map to add the handlers to

## check_required()

void CParamList::check_required | ( |  | ) | const

checks whether all required parameters have been set and throws an invalid_argument exception if not.

## get_help_xml()

void CParamList::get_help_xml | ( | CXMLElement & | root | ) | const

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

Parameters

  [in,out] | root | the root node of the XML tree

## has_key()

bool CParamList::has_key | ( | const std::string & | key | ) | const

Parameters

  key |

Returns
  true if the parameter list already has a parameter named key

## operator[]()

PParameter & CParamList::operator[] | ( | const std::string & | key | ) |

The operator to access the parameters in the list

Parameters

  key | the name of the parameter

Returns
  (shared) pointer to the associated parameter (or creates a new empty one)

## print_help()

void CParamList::print_help | ( | std::ostream & | os | ) | const

prints out help strings for all parameters in the list

Parameters

  os | the output stream to write the help to.

## set()

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

  options | a map of <key, value> string pairs

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

- optparam.hh