knowL: Knowledge Libraries
Loading...
Searching...
No Matches
knowCore::ConstrainedValue Class Reference

#include <ConstrainedValue.h>

Classes

struct  Constraint
 
struct  Private
 

Public Types

enum class  Type {
  Equal , Different , Inferior , Superior ,
  InferiorEqual , SuperiorEqual , GeoOverlaps , GeoWithin ,
  GeoContains , GeoIntersects , GeoTouches , GeoDisjoint ,
  Contains , NotContains , In , NotIn
}
 

Public Member Functions

 ConstrainedValue (const ConstrainedValue &_rhs)
 
ConstrainedValueoperator= (const ConstrainedValue &_rhs)
 
bool operator== (const ConstrainedValue &_value) const
 
bool hasConstraints () const
 
QList< Constraintconstraints () const
 
cres_qresult< bool > check (const Value &_value)
 
cres_qresult< ValueRangeupdate (const ValueRange &_range)
 
template<typename _T_ >
cres_qresult< bool > check (const _T_ &_value)
 
ConstrainedValueapply (const Constraint &_constraint)
 
ConstrainedValueapply (const Value &_value, Type _type)
 
template<typename _T_ >
ConstrainedValueapply (const _T_ &_value, Type _type)
 

Detailed Description

This class allows to represent a ConstrainedValue with lower, upper or equality constraint.

Member Enumeration Documentation

◆ Type

Enumerator
Inferior 

such as value < constraint.value

Superior 

such as constraint.value < value

InferiorEqual 

such as value <= constraint.value

SuperiorEqual 

such as constraint.value <= value

GeoOverlaps 

such as value overlaps with constraint.value (but they cannot share a boundary)

GeoWithin 

such as value is within the constraint.value

GeoContains 

such as constraint.value is within the value

GeoIntersects 

such as value intersects with constraint.value,

GeoTouches 

such as value touches with constraint.value,

GeoDisjoint 

such as value disjoint with constraint.value,

Contains 

such as list contains a value

NotContains 

such as list does not contains a value

In 

such as one value is part of a list

NotIn 

such as one value is not part of a list

Member Function Documentation

◆ apply() [1/2]

ConstrainedValue & ConstrainedValue::apply ( const Constraint & _constraint)

Apply a constraint on this value.

Returns
a reference to self

◆ apply() [2/2]

ConstrainedValue & ConstrainedValue::apply ( const Value & _value,
ConstrainedValue::Type _type )

Apply a constraint on this value, with the given _value and _type.

Returns
a reference to self

◆ hasConstraints()

bool ConstrainedValue::hasConstraints ( ) const
Returns
true if this constrained value has constrained

◆ update()

cres_qresult< ValueRange > ConstrainedValue::update ( const ValueRange & _range)

Update a range according to the constraint.


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