charon-core
0.3.1
|
Parameter object handling. More...
#include <charon-core/Parameter.h>
Public Member Functions | |
virtual std::string | getDefaultString ()=0 |
Get default value. More... | |
std::string | getName () const |
Get parameter name. | |
ParameteredObject & | getParent () |
get parent object | |
const ParameteredObject & | getParent () const |
get parent object (const version) | |
virtual std::string | guessType () const =0 |
Try to guess type. More... | |
void | init (ParameteredObject *parent, const std::string &name) |
Initialize new parameter. More... | |
virtual void | intoStream (std::ostream &os) const =0 |
Inserts the value of the Parameter at the end of a stream. More... | |
virtual void | load (const ParameterFile &pf)=0 |
Load from ParameterFile. More... | |
virtual void | save (ParameterFile &pf) const =0 |
Save to ParameterFile. More... | |
Protected Member Functions | |
std::string | _followLink (const ParameterFile &pf, const std::string paramName) const |
Follow reference to targeted parameter. More... | |
Protected Attributes | |
std::string | _name |
Parameter name. | |
ParameteredObject * | _parent |
Parent ParameteredObject. | |
Private Member Functions | |
charon_core_LOCAL | AbstractParameter (const AbstractParameter &) |
Forbid copying. | |
Provides assignment and setters/getters. Load and save routines are purely virtual.
Definition at line 57 of file Parameter.h.
|
protected |
Tries to get the name of the targeted parameter if a reference is present. Returns input if no reference exists.
pf | ParameterFile to be used |
paramName | Name of the parameter that could contain a reference and should therefore be resolved |
Definition at line 66 of file Parameter.cpp.
References ParameterFile::get(), and ParameterFile::isSet().
|
pure virtual |
This string representation will be saved in the metadata parameter file.
Implemented in ParameterList< T >, ParameterList< std::string >, Parameter< T >, Parameter< std::string >, Parameter< int >, and Parameter< bool >.
|
pure virtual |
Implemented in ParameterList< T >, ParameterList< std::string >, Parameter< T >, Parameter< std::string >, Parameter< int >, and Parameter< bool >.
void AbstractParameter::init | ( | ParameteredObject * | parent, |
const std::string & | name | ||
) |
Assign name, parent etc. Set these variables to their final values, they can not be changed later because this would mess up the parameter store
parent | parent object |
name | parameter name |
Definition at line 32 of file Parameter.cpp.
|
pure virtual |
Overloaded in class Parametery<T>.
os | Stream ot insert the value in |
Implemented in ParameterList< T >, ParameterList< std::string >, Parameter< T >, Parameter< std::string >, Parameter< int >, and Parameter< bool >.
|
pure virtual |
This restores the value from the paremeter named "name"."_name" in the given parameter file.
pf | ParameterFile to load from. |
Implemented in ParameterList< T >, ParameterList< std::string >, Parameter< T >, Parameter< std::string >, Parameter< int >, and Parameter< bool >.
|
pure virtual |
This stores the value to the paremeter name parent_name._name in the given parameter file. If the parameter has not been changed (i.e. has the same value as its default value), the parameter string will not be written to the parameter file.
pf | ParameterFile to write to. |
Implemented in ParameterList< T >, ParameterList< std::string >, Parameter< T >, Parameter< std::string >, Parameter< int >, and Parameter< bool >.