OpenWalnut
1.5.0dev
|
This class allows constraining properties using a maximum value and the corresponding <= operator. More...
#include <WPropertyConstraintMax.h>
Public Member Functions | |
WPropertyConstraintMax (T max) | |
Constructor. More... | |
virtual | ~WPropertyConstraintMax () |
Destructor. More... | |
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. More... | |
T | getMax () |
Returns the current max value. More... | |
virtual PROPERTYCONSTRAINT_TYPE | getType () |
Allows simple identification of the real constraint type. More... | |
virtual std::shared_ptr< typename WPropertyVariable< T >::PropertyConstraint > | clone () |
Method to clone the constraint and create a new one with the correct dynamic type. More... | |
Public Member Functions inherited from WPropertyVariable< T >::PropertyConstraint | |
PropertyConstraint () | |
Default constructor. More... | |
virtual | ~PropertyConstraint () |
Destructor. More... | |
Private Attributes | |
T | m_max |
The maximal value the property should have. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from WPropertyVariable< T >::PropertyConstraint | |
static std::shared_ptr< PropertyConstraint > | create (PROPERTYCONSTRAINT_TYPE type) |
This method creates a constraint using the specified type. More... | |
This class allows constraining properties using a maximum value and the corresponding <= operator.
Definition at line 37 of file WPropertyConstraintMax.h.
|
explicit |
Constructor.
max | the maximum value which the new property value should have. |
Definition at line 91 of file WPropertyConstraintMax.h.
|
virtual |
Destructor.
Definition at line 97 of file WPropertyConstraintMax.h.
|
virtual |
Checks whether the specified new value is smaller or equal to the specified max value.
property | the property whose new value should be set. |
value | the new value to check |
Implements WPropertyVariable< T >::PropertyConstraint.
Definition at line 102 of file WPropertyConstraintMax.h.
|
virtual |
Method to clone the constraint and create a new one with the correct dynamic type.
Implements WPropertyVariable< T >::PropertyConstraint.
Definition at line 120 of file WPropertyConstraintMax.h.
T WPropertyConstraintMax< T >::getMax |
Returns the current max value.
Definition at line 108 of file WPropertyConstraintMax.h.
|
virtual |
Allows simple identification of the real constraint type.
Reimplemented from WPropertyVariable< T >::PropertyConstraint.
Definition at line 114 of file WPropertyConstraintMax.h.
|
private |
The maximal value the property should have.
Definition at line 87 of file WPropertyConstraintMax.h.