/* * ContinuousValue.hpp * * Created on: Sep 28, 2011 * Author: heber */ #ifndef CONTINUOUSVALUE_HPP_ #define CONTINUOUSVALUE_HPP_ // include config.h #ifdef HAVE_CONFIG_H #include #endif #include #include "CodePatterns/Range.hpp" #include "Value.hpp" #include "ValueInterface.hpp" class ContinuousValueTest; class ParameterException; class ParameterValidatorException; class ParameterValueException; /** This class represents a discrete value, it implements ValueInterface. * */ template class ContinuousValue : public Value { //!> unit test needs to have access to internal values friend class ContinuousValueTest; public: ContinuousValue(); ContinuousValue(const range &_ValidRange); virtual ~ContinuousValue(); // functions for ValueInterface bool isValid(const T & _value) const throw(ParameterValidatorException); // comfortable setter void operator=(const T &_value) { set(_value); } // comparator bool operator==(const ContinuousValue &_instance) const throw(ParameterException); bool operator!=(const ContinuousValue &_instance) const throw(ParameterException) { return !((*this)==(_instance)); } // getter/setter for valid ranges void setValidRange(const range &_range) throw(ParameterValueException); const range & getValidRange() const throw(ParameterValidatorException); // string functions for ValueInterface, taken from Value private: //!> whether \a value has been set bool ValueSet; //!> contained value T value; //!> whether \a min, i.e. a minimal value, has been set range ValidRangeSet; //!> valid range of values range ValidRange; }; #include "ContinuousValue_impl.hpp" #endif /* CONTINUOUSVALUE_HPP_ */