/* * Parameter_impl.hpp * * Created on: Apr 16, 2012 * Author: ankele */ #ifndef PARAMETER_IMPL_HPP_ #define PARAMETER_IMPL_HPP_ // include config.h #ifdef HAVE_CONFIG_H #include #endif #include "Parameter.hpp" /** Constructor for class Parameter. * */ template Parameter::Parameter(const std::string &_name) : ParameterInterface(_name), Value() {}; /** Constructor for class Parameter. * * @param _name name of this parameter * @param _value initial value to set */ template Parameter::Parameter(const std::string &_name, const T &_value) : ParameterInterface(_name), Value() { Value::set(_value); }; /** Constructor for class Parameter. * * @param _name name of this parameter * @param _ValidRange valid range for this ContinuousValue */ template Parameter::Parameter(const std::string &_name, const Validator &_Validator) : ParameterInterface(_name), Value(_Validator) {}; /** Constructor for class Parameter. * * @param _name name of this parameter * @param _ValidRange valid range for this ContinuousValue * @param _value initial value to set */ template Parameter::Parameter(const std::string &_name, const Validator &_Validator, const T &_value) : ParameterInterface(_name), Value(_Validator) { Value::set(_value); }; /** Constructor for class Parameter. * * @param _name name of this parameter * @param _ValidRange valid range for this ContinuousValue */ template Parameter::Parameter(const std::string &_name, const std::vector &_ValidValues) : ParameterInterface(_name), Value(_ValidValues) {}; /** Constructor for class Parameter. * * @param _name name of this parameter * @param _ValidRange valid range for this ContinuousValue * @param _value initial value to set */ template Parameter::Parameter(const std::string &_name, const std::vector &_ValidValues, const T &_value) : ParameterInterface(_name), Value(_ValidValues) { Value::set(_value); }; /** Constructor for class Parameter. * * @param _name name of this parameter * @param _ValidRange valid range for this ContinuousValue */ template Parameter::Parameter(const std::string &_name, const range &_ValidRange) : ParameterInterface(_name), Value(_ValidRange) {}; /** Constructor for class Parameter. * * @param _name name of this parameter * @param _ValidRange valid range for this ContinuousValue * @param _value initial value to set */ template Parameter::Parameter(const std::string &_name, const range &_ValidRange, const T &_value) : ParameterInterface(_name), Value(_ValidRange) { Value::set(_value); }; /** Destructor for class Parameter. * */ template Parameter::~Parameter() {}; /** 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 Parameter::operator==(const Parameter &_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* Parameter::clone() const { Parameter *instance = new Parameter(ParameterInterface::getName(), Value::getValidator()); instance->set(Value::get()); return instance; } #endif /* Parameter_IMPL_HPP_ */