eoValueParam< ValueType > Class Template Reference

eoValueParam<ValueType>: templatized derivation of eoParam. More...

#include <eoParam.h>

Inheritance diagram for eoValueParam< ValueType >:

eoParam eoPerf2Worth< Dummy, EOT::Fitness >

List of all members.

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 ()
 Parameter value.
const ValueType & value () const
 Parameter value.
std::string getValue (void) const
 Pure virtual function to get the value out.
void setValue (const std::string &_value)
 Set 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


Detailed Description

template<class ValueType>
class eoValueParam< ValueType >

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. This should be changed to std::stringstream when that class is available in g++.

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.

Definition at line 136 of file eoParam.h.


Constructor & Destructor Documentation

template<class ValueType>
eoValueParam< ValueType >::eoValueParam ( void   )  [inline]

Construct a Param.

Definition at line 141 of file eoParam.h.

template<class ValueType>
eoValueParam< ValueType >::eoValueParam ( ValueType  _defaultValue,
std::string  _longName,
std::string  _description = "No description",
char  _shortHand = 0,
bool  _required = false 
) [inline]

Construct a Param.

Parameters:
_defaultValue The default value
_longName Long name of the argument
_description Description of the parameter. What is useful for.
_shortName Short name of the argument (Optional)
_required If it is a necessary parameter or not

Definition at line 151 of file eoParam.h.


Member Function Documentation

template<class ValueType>
ValueType& eoValueParam< ValueType >::value (  )  [inline]

template<class ValueType>
const ValueType& eoValueParam< ValueType >::value (  )  const [inline]

Parameter value.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Returns:
parameter value

Definition at line 175 of file eoParam.h.

template<class ValueType>
void eoValueParam< ValueType >::setValue ( const std::string &  _value  )  [inline, virtual]

Set 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 (' ').

Parameters:
_value Textual representation of the new value

Implements eoParam.

Definition at line 200 of file eoParam.h.

Referenced by eoParser::setORcreateParam().


The documentation for this class was generated from the following file:

Generated on Thu Jan 1 23:19:52 2009 for EvolvingObjects by  doxygen 1.5.5