charon-core
0.3.1
|
Implementation of the AbstractParameter interface for a list of parameters. More...
#include <charon-core/Parameter.h>
Public Member Functions | |
ParameterList (std::string defaultValue="") | |
Create parameter list. More... | |
virtual std::string | getDefaultString () |
Get default value. More... | |
virtual std::string | guessType () const |
Try to guess type. More... | |
virtual void | intoStream (std::ostream &os) const |
Inserts the value of the ParameterList at the end of a stream. More... | |
virtual void | load (const ParameterFile &pf) |
Load from ParameterFile. More... | |
operator std::vector< T > () const | |
Cast operator to get copy of internal value. | |
std::vector< T > & | operator() () |
Call operator to get a reference to the parameter list content. | |
const std::vector< T > & | operator() () const |
Call operator to get a const reference to the parameter list content. | |
virtual std::vector< T > & | operator= (const std::vector< T > &B) |
Assign parameter content. More... | |
virtual ParameterList< T > & | operator= (const ParameterList< T > &B) |
Assign parameter content. More... | |
virtual const T & | operator[] (std::size_t pos) const |
Access to specific member (read-only). More... | |
virtual T & | operator[] (std::size_t pos) |
Access to specific member (read-write). More... | |
virtual void | save (ParameterFile &pf) const |
Save to ParameterFile. More... | |
void | setDefault (const std::string &value) |
Set default value. More... | |
virtual std::size_t | size () const |
Access to number of members. More... | |
Public Member Functions inherited from AbstractParameter | |
std::string | getName () const |
Get parameter name. | |
ParameteredObject & | getParent () |
get parent object | |
const ParameteredObject & | getParent () const |
get parent object (const version) | |
void | init (ParameteredObject *parent, const std::string &name) |
Initialize new parameter. More... | |
Private Attributes | |
std::string | _defaultValue |
Default value, string representation, separated by ";". | |
std::vector< T > | _value |
Internal value (list). | |
Additional Inherited Members | |
Protected Member Functions inherited from AbstractParameter | |
std::string | _followLink (const ParameterFile &pf, const std::string paramName) const |
Follow reference to targeted parameter. More... | |
Protected Attributes inherited from AbstractParameter | |
std::string | _name |
Parameter name. | |
ParameteredObject * | _parent |
Parent ParameteredObject. | |
Definition at line 213 of file Parameter.h.
ParameterList< T >::ParameterList | ( | std::string | defaultValue = "" | ) |
Assign parameter name, description and content. Internal value will be set to defaultValue, the given string representation will be split up at ";".
defaultValue | Default value. |
Definition at line 131 of file Parameter.hxx.
References ParameterFile::getList().
|
virtual |
This string representation will be saved in the metadata parameter file.
Implements AbstractParameter.
Definition at line 211 of file Parameter.hxx.
|
virtual |
Implements AbstractParameter.
Definition at line 170 of file Parameter.hxx.
References TypeDetector::type().
|
virtual |
os | Stream ot insert the value in |
Implements AbstractParameter.
Definition at line 216 of file Parameter.hxx.
|
virtual |
This restores the value from the paremeter named "name"."_name" in the given parameter file.
pf | ParameterFile to load from. |
Implements AbstractParameter.
Definition at line 194 of file Parameter.hxx.
References ParameterFile::getList(), ParameterFile::isSet(), and ParameterFile::set().
|
virtual |
Default value remains unchanged.
[in] | B | Copy source. |
Definition at line 142 of file Parameter.hxx.
|
virtual |
Default value remains unchanged.
B | Copy source. |
Definition at line 148 of file Parameter.hxx.
References ParameterList< T >::_defaultValue, and ParameterList< T >::_value.
|
virtual |
pos | data position |
Implements AbstractMultiROData< T >.
Definition at line 231 of file Parameter.hxx.
|
virtual |
pos | data position |
Implements AbstractMultiData< T >.
Definition at line 236 of file Parameter.hxx.
|
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. |
Implements AbstractParameter.
Definition at line 175 of file Parameter.hxx.
References ParameterFile::erase(), ParameterFile::get(), ParameterFile::isSet(), and ParameterFile::set().
void ParameterList< T >::setDefault | ( | const std::string & | value | ) |
value | New default value |
Definition at line 206 of file Parameter.hxx.
|
virtual |
For iterations using operator[]
Implements AbstractMultiROData< T >.
Definition at line 226 of file Parameter.hxx.