OpenWalnut  1.4.0
Public Member Functions | Static Public Member Functions | List of all members
WPropertyVariable< T >::PropertyConstraint Class Referenceabstract

Class building the base for user defined constraints on a property instance. More...

#include <WPropertyVariable.h>

+ Inheritance diagram for WPropertyVariable< T >::PropertyConstraint:

Public Member Functions

 PropertyConstraint ()
 Default constructor. More...
 
virtual ~PropertyConstraint ()
 Destructor. More...
 
virtual bool accept (boost::shared_ptr< WPropertyVariable< T > > property, const T &value)=0
 This method decides whether the specified value is valid for a specific property. More...
 
virtual PROPERTYCONSTRAINT_TYPE getType ()
 Allows simple identification of the real constraint type. More...
 
virtual boost::shared_ptr
< PropertyConstraint
clone ()=0
 Method to clone the constraint and create a new one with the correct dynamic type. More...
 

Static Public Member Functions

static boost::shared_ptr
< PropertyConstraint
create (PROPERTYCONSTRAINT_TYPE type)
 This method creates a constraint using the specified type. More...
 

Detailed Description

template<typename T>
class WPropertyVariable< T >::PropertyConstraint

Class building the base for user defined constraints on a property instance.

Definition at line 174 of file WPropertyVariable.h.

Constructor & Destructor Documentation

template<typename T>
WPropertyVariable< T >::PropertyConstraint::PropertyConstraint ( )

Default constructor.

Definition at line 884 of file WPropertyVariable.h.

template<typename T>
WPropertyVariable< T >::PropertyConstraint::~PropertyConstraint ( )
virtual

Destructor.

Definition at line 889 of file WPropertyVariable.h.

Member Function Documentation

template<typename T>
virtual bool WPropertyVariable< T >::PropertyConstraint::accept ( boost::shared_ptr< WPropertyVariable< T > >  property,
const T &  value 
)
pure virtual

This method decides whether the specified value is valid for a specific property.

Parameters
valuethe new value.
propertythe property to which the value should be set.
Returns
true whenever the new value is acceptable for the property.

Implemented in WPropertyConstraintMax< T >, WPropertyConstraintMin< T >, WPropertyConstraintIsValid< T >, WPropertyConstraintNotEmpty< T >, WPropertyConstraintIsDirectory< T >, WPropertyConstraintPathExists< T >, and WPropertyConstraintSelectOnlyOne< T >.

template<typename T>
virtual boost::shared_ptr< PropertyConstraint > WPropertyVariable< T >::PropertyConstraint::clone ( )
pure virtual
template<typename T>
static boost::shared_ptr< PropertyConstraint > WPropertyVariable< T >::PropertyConstraint::create ( PROPERTYCONSTRAINT_TYPE  type)
static

This method creates a constraint using the specified type.

This is a useful convenience class for easily adding constraints.

Parameters
typethe type of the constraint to create
Returns
NULL if the type is unknown or an constraint instance
template<typename T>
PROPERTYCONSTRAINT_TYPE WPropertyVariable< T >::PropertyConstraint::getType ( )
virtual

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