Public Types | |
| enum | { VT_INT, VT_DOUBLE, VT_STRING } |
| Parameter types. More... | |
|
typedef std::map< std::string, value_type > | parameter_map |
| A type providing a mapping from parameter names to their values. | |
| typedef std::vector< std::string > | parameter_list |
| A type providing a list of parameter names. | |
Public Member Functions | |
| parameter_exchange () | |
| Constructs the object. | |
| virtual | ~parameter_exchange () |
| Destructs the object. | |
| void | init (const std::string &name, int *var, const int defval=0, const std::string &message="") |
| Defines an integer parameter. | |
| void | init (const std::string &name, double *var, const double defval=0, const std::string &message="") |
| Defines a double parameter. | |
| void | init (const std::string &name, std::string *var, const std::string &defval="", const std::string &message="") |
| Defines a string parameter. | |
| void | set (const std::string &name, const int value, bool unk=true) |
| Sets a value of a parameter. | |
| void | set (const std::string &name, const double value, bool unk=true) |
| Sets a value of a parameter. | |
| void | set (const std::string &name, const std::string &value, bool unk=true) |
| Sets a value of a parameter. | |
| int | get_stamp (const std::string &name) |
| Gets the time stamp when the parameter value is set. | |
| std::ostream & | show (std::ostream &os) |
| Shows the parameter values. | |
| std::ostream & | help (std::ostream &os) |
| Shows the help message of parameters. | |
Data Fields | |
| parameter_map | pmap |
| A parameter map. | |
| parameter_list | plist |
| A parameter list. | |
| int | stamp |
| A time stamp. | |
Data Structures | |
| struct | value_type |
| Parameter value. More... | |
| anonymous enum |
| void classias::parameter_exchange::init | ( | const std::string & | name, | |
| int * | var, | |||
| const int | defval = 0, |
|||
| const std::string & | message = "" | |||
| ) | [inline] |
Defines an integer parameter.
| name | The name of the parameter. | |
| var | The pointer to the parameter variable. | |
| defval | The default value of the parameter. | |
| message | The help message for the parameter. |
| void classias::parameter_exchange::init | ( | const std::string & | name, | |
| double * | var, | |||
| const double | defval = 0, |
|||
| const std::string & | message = "" | |||
| ) | [inline] |
Defines a double parameter.
| name | The name of the parameter. | |
| var | The pointer to the parameter variable. | |
| defval | The default value of the parameter. | |
| message | The help message for the parameter. |
| void classias::parameter_exchange::init | ( | const std::string & | name, | |
| std::string * | var, | |||
| const std::string & | defval = "", |
|||
| const std::string & | message = "" | |||
| ) | [inline] |
Defines a string parameter.
| name | The name of the parameter. | |
| var | The pointer to the parameter variable. | |
| defval | The default value of the parameter. | |
| message | The help message for the parameter. |
| void classias::parameter_exchange::set | ( | const std::string & | name, | |
| const int | value, | |||
| bool | unk = true | |||
| ) | [inline] |
Sets a value of a parameter.
| name | The name of the parameter. | |
| value | The integer value. | |
| unk | The indicator specifying whether this function throws an exception unknown_parameter when the parameter is undefined. |
| void classias::parameter_exchange::set | ( | const std::string & | name, | |
| const double | value, | |||
| bool | unk = true | |||
| ) | [inline] |
Sets a value of a parameter.
| name | The name of the parameter. | |
| value | The double value. | |
| unk | The indicator specifying whether this function throws an exception unknown_parameter when the parameter is undefined. |
| void classias::parameter_exchange::set | ( | const std::string & | name, | |
| const std::string & | value, | |||
| bool | unk = true | |||
| ) | [inline] |
Sets a value of a parameter.
| name | The name of the parameter. | |
| value | The string value. | |
| unk | The indicator specifying whether this function throws an exception unknown_parameter when the parameter is undefined. |
| int classias::parameter_exchange::get_stamp | ( | const std::string & | name | ) | [inline] |
Gets the time stamp when the parameter value is set.
| name | The name of the parameter. |
| std::ostream& classias::parameter_exchange::show | ( | std::ostream & | os | ) | [inline] |
Shows the parameter values.
| os | The output stream. |
| std::ostream& classias::parameter_exchange::help | ( | std::ostream & | os | ) | [inline] |
Shows the help message of parameters.
| os | The output stream. |