25 #ifndef WPROPERTYCONSTRAINTMAX_H
26 #define WPROPERTYCONSTRAINTMAX_H
30 #include "../WPropertyTypes.h"
31 #include "WPropertyConstraintTypes.h"
36 template<
typename T >
74 virtual PROPERTYCONSTRAINT_TYPE
getType();
81 virtual std::shared_ptr< typename WPropertyVariable< T >::PropertyConstraint >
clone();
90 template <
typename T >
96 template <
typename T >
101 template <
typename T >
104 return value <= m_max;
107 template <
typename T >
113 template <
typename T >
119 template <
typename T >
This class allows constraining properties using a maximum value and the corresponding <= operator.
T getMax()
Returns the current max value.
T m_max
The maximal value the property should have.
virtual PROPERTYCONSTRAINT_TYPE getType()
Allows simple identification of the real constraint type.
virtual ~WPropertyConstraintMax()
Destructor.
virtual bool accept(std::shared_ptr< WPropertyVariable< T > > property, const T &value)
Checks whether the specified new value is smaller or equal to the specified max value.
virtual std::shared_ptr< typename WPropertyVariable< T >::PropertyConstraint > clone()
Method to clone the constraint and create a new one with the correct dynamic type.
WPropertyConstraintMax(T max)
Constructor.
PropertyConstraint()
Default constructor.
A named property class with a concrete type.