EvolvingObjects
|
eoValueParam<ValueType>: templatized derivation of eoParam. More...
#include <eoParam.h>
Public Member Functions | |
eoValueParam (void) | |
Construct a Param. | |
eoValueParam (ValueType _defaultValue, std::string _longName, std::string _description="No description", char _shortHand=0, bool _required=false) | |
Construct a Param. | |
ValueType & | value () |
Get a reference on the parameter value. | |
const ValueType & | value () const |
Get a const reference on the parameter value. | |
void | value (ValueType val) |
Change the parameter value. | |
std::string | getValue (void) const |
Get the string representation of the value. | |
void | setValue (const std::string &_value) |
Set the value according to the speciied string. | |
template<> | |
std::string | getValue (void) const |
Pure virtual function to get the value out. | |
template<> | |
void | setValue (const std::string &_value) |
Pure virtual function to set the value. | |
template<> | |
std::string | getValue (void) const |
Pure virtual function to get the value out. | |
template<> | |
void | setValue (const std::string &_value) |
Pure virtual function to set the value. | |
template<> | |
std::string | getValue (void) const |
Pure virtual function to get the value out. | |
template<> | |
void | setValue (const std::string &) |
Pure virtual function to set the value. | |
Protected Attributes | |
ValueType | repValue |
eoValueParam<ValueType>: templatized derivation of eoParam.
Can be used to contain any scalar value type. It makes use of std::strstream to get and set values.
Note also that there is a template specialization for std::pair<double, double> and for std::vector<double>. These stream their contents delimited with whitespace.
eoValueParam< ValueType >::eoValueParam | ( | void | ) | [inline] |
eoValueParam< ValueType >::eoValueParam | ( | ValueType | _defaultValue, |
std::string | _longName, | ||
std::string | _description = "No description" , |
||
char | _shortHand = 0 , |
||
bool | _required = false |
||
) | [inline] |
ValueType& eoValueParam< ValueType >::value | ( | ) | [inline] |
Get a reference on the parameter value.
Definition at line 176 of file eoParam.h.
Referenced by eoLogger::_createParameters(), do_make_checkpoint(), do_make_checkpoint_assembled(), do_make_genotype(), do_make_pop(), make_help(), eoLinearDecreasingWeightUp< WeightType, StopCriteriaType >::operator()(), eoFDCStat< EOT >::operator()(), eoExpDecayingBoundModifier::operator()(), eoFileSnapshot::operator()(), eoParser::printHelp(), eoParser::readFrom(), eoParser::setStopOnUnknownParam(), eoEsMutationInit::TauBeta(), eoEsMutationInit::TauGlb(), eoEsMutationInit::TauLcl(), eoParser::userNeedsHelp(), and eoParser::valueOf().
const ValueType& eoValueParam< ValueType >::value | ( | ) | const [inline] |
void eoValueParam< ValueType >::setValue | ( | const std::string & | _value | ) | [inline, virtual] |
Set the value according to the speciied string.
For scalar types the textual represenation is typically quite straigtforward.
For vector<double> we expect a list of numbers, where the first is an unsigned integer taken as the length ot the vector and then successively the vector elements. Vector elements can be separated by ',', ';', or ' '. Note, however, that eoParser does not deal correctly with parameter values contianing spaces (' ').
_value | Textual representation of the new value |
Implements eoParam.
Definition at line 224 of file eoParam.h.
Referenced by eoParser::setORcreateParam().