25 #ifndef WPROPERTYCONSTRAINTMAX_H
26 #define WPROPERTYCONSTRAINTMAX_H
28 #include "../WPropertyTypes.h"
29 #include "WPropertyConstraintTypes.h"
34 template<
typename T >
72 virtual PROPERTYCONSTRAINT_TYPE
getType();
79 virtual boost::shared_ptr< typename WPropertyVariable< T >::PropertyConstraint >
clone();
88 template <
typename T >
94 template <
typename T >
99 template <
typename T >
102 return value <= m_max;
105 template <
typename T >
111 template <
typename T >
117 template <
typename T >
123 #endif // WPROPERTYCONSTRAINTMAX_H
This class allows constraining properties using a maximum value and the corresponding <= operator...
WPropertyConstraintMax(T max)
Constructor.
A named property class with a concrete type.
T getMax()
Returns the current max value.
T m_max
The maximal value the property should have.
virtual ~WPropertyConstraintMax()
Destructor.
virtual boost::shared_ptr< typename WPropertyVariable< T >::PropertyConstraint > clone()
Method to clone the constraint and create a new one with the correct dynamic type.
virtual PROPERTYCONSTRAINT_TYPE getType()
Allows simple identification of the real constraint type.
virtual bool accept(boost::shared_ptr< WPropertyVariable< T > > property, const T &value)
Checks whether the specified new value is smaller or equal to the specified max value.
PropertyConstraint()
Default constructor.