/* * ContinuousParameter_impl.hpp * * Created on: Sep 30, 2011 * Author: heber */ #ifndef CONTINUOUSPARAMETER_IMPL_HPP_ #define CONTINUOUSPARAMETER_IMPL_HPP_ // include config.h #ifdef HAVE_CONFIG_H #include #endif #include #include "ContinuousParameter.hpp" /** Constructor for class ContinuousParameter. * */ template ContinuousParameter::ContinuousParameter(const std::string &_name) : ParameterInterface(_name), ContinuousValue(range(std::numeric_limits::min(), std::numeric_limits::max())) {}; /** Constructor for class ContinuousParameter. * * @param _name name of this parameter * @param _value initial value to set */ template ContinuousParameter::ContinuousParameter(const std::string &_name, const T &_value) : ParameterInterface(_name), ContinuousValue(range(std::numeric_limits::min(), std::numeric_limits::max())) { setValue(_value); }; /** Constructor for class ContinuousParameter. * * @param _name name of this parameter * @param _ValidRange valid range for this ContinuousValue */ template ContinuousParameter::ContinuousParameter(const std::string &_name, const range &_ValidRange) : ParameterInterface(_name), ContinuousValue(_ValidRange) {}; /** Constructor for class ContinuousParameter. * * @param _name name of this parameter * @param _ValidRange valid range for this ContinuousValue * @param _value initial value to set */ template ContinuousParameter::ContinuousParameter(const std::string &_name, const range &_ValidRange, const T &_value) : ParameterInterface(_name), ContinuousValue(_ValidRange) { set(_value); }; /** Destructor for class ContinuousParameter. * */ template ContinuousParameter::~ContinuousParameter() {}; /** Compares this continuous value against another \a _instance. * * @param _instance other value to compare to * @return true - if contained ContinuousValue and name are the same, false - else */ template bool ContinuousParameter::operator==(const ContinuousParameter &_instance) const { bool status = true; status = status && (*dynamic_cast *>(this) == dynamic_cast &>(_instance)); status = status && (ParameterInterface::getName() == _instance.ParameterInterface::getName()); return status; } /** Creates a clone of this Parameter instance. * * @return cloned instance */ template ParameterInterface* ContinuousParameter::clone() const { ContinuousParameter *instance = new ContinuousParameter(ParameterInterface::getName(), ContinuousValue::getValidRange()); instance->setValue(ContinuousValue::getValue()); return instance; } #endif /* CONTINUOUSPARAMETER_IMPL_HPP_ */