/* * DiscreteParameter_impl.hpp * * Created on: Sep 30, 2011 * Author: heber */ #ifndef DISCRETEPARAMETER_IMPL_HPP_ #define DISCRETEPARAMETER_IMPL_HPP_ // include config.h #ifdef HAVE_CONFIG_H #include #endif #include "DiscreteParameter.hpp" #include /** Constructor for class DiscreteParameter. * */ template DiscreteParameter::DiscreteParameter(const std::string &_name) : Parameter(_name) {}; /** Constructor for class DiscreteParameter. * * @param _name name of this parameter * @param _ValidValues valid values for this DiscreteValue */ template DiscreteParameter::DiscreteParameter(const std::string &_name, const std::vector &_ValidValues) : Parameter(_name), DiscreteValue(_ValidValues) {}; /** Destructor for class DiscreteParameter. * */ template DiscreteParameter::~DiscreteParameter() {}; /** Compares this discrete value against another \a _instance. * * @param _instance other value to compare to * @return true - if contained DiscreteValue and name are the same, false - else */ template bool DiscreteParameter::operator==(const DiscreteParameter &_instance) const { bool status = true; status = status && (*dynamic_cast *>(this) == dynamic_cast &>(_instance)); status = status && (Parameter::getName() == _instance.Parameter::getName()); return status; } /** Creates a clone of this Parameter instance. * * @return cloned instance */ template Parameter* DiscreteParameter::clone() const { DiscreteParameter *instance = new DiscreteParameter(Parameter::getName(), DiscreteValue::getValidValues()); instance->setValue(DiscreteValue::getValue()); return instance; } #endif /* DISCRETEPARAMETER_IMPL_HPP_ */