OpenWalnut  1.5.0dev
Public Member Functions | Private Attributes | List of all members
WPropertyConstraintMax< T > Class Template Reference

This class allows constraining properties using a maximum value and the corresponding <= operator. More...

#include <WPropertyConstraintMax.h>

+ Inheritance diagram for WPropertyConstraintMax< T >:
+ Collaboration diagram for WPropertyConstraintMax< T >:

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...
 
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 >::PropertyConstraintclone ()
 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

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< PropertyConstraintcreate (PROPERTYCONSTRAINT_TYPE type)
 This method creates a constraint using the specified type. More...
 

Detailed Description

template<typename T>
class WPropertyConstraintMax< T >

This class allows constraining properties using a maximum value and the corresponding <= operator.

Definition at line 37 of file WPropertyConstraintMax.h.

Constructor & Destructor Documentation

◆ WPropertyConstraintMax()

template<typename T >
WPropertyConstraintMax< T >::WPropertyConstraintMax ( max)
explicit

Constructor.

Parameters
maxthe maximum value which the new property value should have.

Definition at line 91 of file WPropertyConstraintMax.h.

◆ ~WPropertyConstraintMax()

template<typename T >
WPropertyConstraintMax< T >::~WPropertyConstraintMax
virtual

Destructor.

Definition at line 97 of file WPropertyConstraintMax.h.

Member Function Documentation

◆ accept()

template<typename T >
bool WPropertyConstraintMax< T >::accept ( std::shared_ptr< WPropertyVariable< T > >  property,
const T &  value 
)
virtual

Checks whether the specified new value is smaller or equal to the specified max value.

Parameters
propertythe property whose new value should be set.
valuethe new value to check
Returns
true if value <= m_max

Implements WPropertyVariable< T >::PropertyConstraint.

Definition at line 102 of file WPropertyConstraintMax.h.

◆ clone()

template<typename T >
std::shared_ptr< typename WPropertyVariable< T >::PropertyConstraint > WPropertyConstraintMax< T >::clone
virtual

Method to clone the constraint and create a new one with the correct dynamic type.

Returns
the constraint.

Implements WPropertyVariable< T >::PropertyConstraint.

Definition at line 120 of file WPropertyConstraintMax.h.

◆ getMax()

template<typename T >
T WPropertyConstraintMax< T >::getMax

Returns the current max value.

Returns
the max value.

Definition at line 108 of file WPropertyConstraintMax.h.

◆ getType()

template<typename T >
PROPERTYCONSTRAINT_TYPE WPropertyConstraintMax< T >::getType
virtual

Allows simple identification of the real constraint type.

Returns
the type

Reimplemented from WPropertyVariable< T >::PropertyConstraint.

Definition at line 114 of file WPropertyConstraintMax.h.

Member Data Documentation

◆ m_max

template<typename T >
T WPropertyConstraintMax< T >::m_max
private

The maximal value the property should have.

Definition at line 87 of file WPropertyConstraintMax.h.


The documentation for this class was generated from the following file: