The base class for parameters used in complex options.
More...
#include <mia/core/parameter.hh>
|
virtual void | do_descr (std::ostream &os) const =0 |
|
const std::string | errmsg (const std::string &err_value) const |
| create an error message by using the given value that raises the error More...
|
|
The base class for parameters used in complex options.
The base class for parameters that might be set based on strings. The main use-case is to provide parameters to plug-ins.
Definition at line 48 of file parameter.hh.
CParameter::CParameter |
( |
const char |
type[], |
|
|
bool |
required, |
|
|
const char * |
descr |
|
) |
| |
Base parameter type constructor
- Parameters
-
type | a type description string that will show up in the help |
required | set to true if the parameter has to be set by the user |
descr | a short description of the parameter |
virtual CParameter::~CParameter |
( |
) | |
|
|
virtual |
ensure virtual destructor and avoid warnings because we have a virtual function
void CParameter::add_dependend_handler |
( |
HandlerHelpMap & |
handler_map) | |
const |
Interface to add the plug-in handler this parameter calls to translate the input string Only for CFactoryParameter this actually does something
- Parameters
-
[in,out] | handler_map | the map to store then pointers to handlers used by this parameter |
void CParameter::descr |
( |
std::ostream & |
os) | |
const |
- Returns
- the description string of the parameter
virtual void CParameter::do_descr |
( |
std::ostream & |
os) | |
const |
|
protectedpure virtual |
const std::string CParameter::errmsg |
( |
const std::string & |
err_value) | |
const |
|
protected |
create an error message by using the given value that raises the error
std::string CParameter::get_default_value |
( |
) | |
const |
- Returns
- the default value of this parameter as a string
const char* CParameter::get_descr |
( |
) | |
const |
- Returns
- the help description of the parameter
void CParameter::get_help_xml |
( |
xmlpp::Element & |
root) | |
const |
Add the help for this parameter to a given XML tree
- Parameters
-
root | the root node to add the help entry to. |
std::string CParameter::get_value_as_string |
( |
) | |
const |
Get the curent parameter value as string
- Returns
- the current parameter value
virtual void CParameter::post_set |
( |
) | |
|
|
virtual |
This command is run after the parsing has been done in most cases it will do nothing, only for factory parameters and the like it must set the final parameter value from the init string
bool CParameter::required_set |
( |
) | |
const |
- Returns
- wheather the required flag is (still) set
void CParameter::reset |
( |
) | |
|
clear the required flag and reset to default value
bool CParameter::set |
( |
const std::string & |
str_value) | |
|
set the parameter based on the string value
const char* CParameter::type |
( |
) | |
const |
- Returns
- the type string of the parameter q
void CParameter::value |
( |
std::ostream & |
os) | |
const |
Write the current value plus information to a stream,
- Parameters
-
The documentation for this class was generated from the following file: