OpenWalnut  1.4.0
Public Member Functions | Private Attributes
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 >:

List of all members.

Public Member Functions

 WPropertyConstraintMax (T max)
 Constructor.
virtual ~WPropertyConstraintMax ()
 Destructor.
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.
getMax ()
 Returns the current max value.
virtual PROPERTYCONSTRAINT_TYPE getType ()
 Allows simple identification of the real constraint type.
virtual boost::shared_ptr
< typename WPropertyVariable
< T >::PropertyConstraint
clone ()
 Method to clone the constraint and create a new one with the correct dynamic type.

Private Attributes

m_max
 The maximal value the property should have.

Detailed Description

template<typename T>
class WPropertyConstraintMax< T >

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

Definition at line 35 of file WPropertyConstraintMax.h.


Constructor & Destructor Documentation

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

Constructor.

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

Definition at line 89 of file WPropertyConstraintMax.h.

template<typename T >
WPropertyConstraintMax< T >::~WPropertyConstraintMax ( ) [virtual]

Destructor.

Definition at line 95 of file WPropertyConstraintMax.h.


Member Function Documentation

template<typename T >
bool WPropertyConstraintMax< T >::accept ( boost::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 100 of file WPropertyConstraintMax.h.

template<typename T >
boost::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 118 of file WPropertyConstraintMax.h.

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

Returns the current max value.

Returns:
the max value.

Definition at line 106 of file WPropertyConstraintMax.h.

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 112 of file WPropertyConstraintMax.h.


Member Data Documentation

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

The maximal value the property should have.

Definition at line 85 of file WPropertyConstraintMax.h.


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