Chemical Data Processing Library C++ API - Version 1.1.1
Public Types | Public Member Functions | List of all members
CDPL::Chem::MatchConstraint Class Reference

MatchConstraint. More...

#include <MatchConstraintList.hpp>

Public Types

enum  Relation {
  ANY,
  LESS,
  EQUAL,
  GREATER,
  LESS_OR_EQUAL,
  GREATER_OR_EQUAL,
  NOT_EQUAL
}
 Defines constants for the specification of relational constraints on the values of query/target attribute pairs. More...
 

Public Member Functions

 MatchConstraint (unsigned int id, Relation relation)
 Constructs a MatchConstraint object with the given identifier and relational constraint on the values of matching query/target attribute pairs. More...
 
template<typename T >
 MatchConstraint (unsigned int id, Relation rel, T &&val)
 Constructs a MatchConstraint object with the given identifier, relational constraint on the values of matching query/target attribute pairs and value of the query attribute. More...
 
unsigned int getID () const
 Returns the identifier of the match constraint. More...
 
void setID (unsigned int id)
 Sets the match constraint identifier to id. More...
 
Relation getRelation () const
 Returns the relational constraint that must be fulfilled by the values of matching query/target attribute pairs. More...
 
void setRelation (Relation rel)
 Sets the relational constraint that must be fulfilled by the values of matching query/target attribute pairs. More...
 
const Base::AnygetValue () const
 Returns the value of the query attribute. More...
 
template<typename T >
const T & getValue () const
 Returns a const reference to the value of the query attribute of type T. More...
 
template<typename T >
void setValue (T &&val)
 Sets the value of the query attribute. More...
 
bool hasValue () const
 Tells wether a query attribute value has been set. More...
 

Detailed Description

MatchConstraint.

Member Enumeration Documentation

◆ Relation

Defines constants for the specification of relational constraints on the values of query/target attribute pairs.

Enumerator
ANY 

Specifies that the relation between the query and target attribute value is not constrained.

LESS 

Specifies that the value of the query attribute must be less than the corresponding value of the target attribute to fulfill the constraint.

EQUAL 

Specifies that the value of the query attribute must be equal to the corresponding value of the target attribute to fulfill the constraint.

GREATER 

Specifies that the value of the query attribute must be greater than the corresponding value of the target attribute to fulfill the constraint.

LESS_OR_EQUAL 

Specifies that the value of the query attribute must be less than or equal to the corresponding value of the target attribute to fulfill the constraint.

GREATER_OR_EQUAL 

Specifies that the value of the query attribute must be greater than or equal to the corresponding value of the target attribute to fulfill the constraint.

NOT_EQUAL 

Specifies that the value of the query attribute must not be equal to the corresponding value of the target attribute to fulfill the constraint.

Constructor & Destructor Documentation

◆ MatchConstraint() [1/2]

CDPL::Chem::MatchConstraint::MatchConstraint ( unsigned int  id,
Relation  relation 
)
inline

Constructs a MatchConstraint object with the given identifier and relational constraint on the values of matching query/target attribute pairs.

Parameters
idThe identifier of the match constraint.
relationThe relational constraint on the values of matching query/target attribute pairs.

◆ MatchConstraint() [2/2]

template<typename T >
CDPL::Chem::MatchConstraint::MatchConstraint ( unsigned int  id,
Relation  rel,
T &&  val 
)
inline

Constructs a MatchConstraint object with the given identifier, relational constraint on the values of matching query/target attribute pairs and value of the query attribute.

Parameters
idThe identifier of the match constraint.
relThe relational constraint on the values of matching query/target attribute pairs.
valThe value of the query attribute.

Member Function Documentation

◆ getID()

unsigned int CDPL::Chem::MatchConstraint::getID ( ) const

Returns the identifier of the match constraint.

Returns
The identifier of the match constraint.

◆ setID()

void CDPL::Chem::MatchConstraint::setID ( unsigned int  id)

Sets the match constraint identifier to id.

Parameters
idThe identifier of the match constraint.

◆ getRelation()

Relation CDPL::Chem::MatchConstraint::getRelation ( ) const

Returns the relational constraint that must be fulfilled by the values of matching query/target attribute pairs.

Returns
The relational constraint on the values of matching query/target attribute pairs.

◆ setRelation()

void CDPL::Chem::MatchConstraint::setRelation ( Relation  rel)

Sets the relational constraint that must be fulfilled by the values of matching query/target attribute pairs.

Parameters
relThe relational constraint on the values of matching query/target attribute pairs.

◆ getValue() [1/2]

const Base::Any& CDPL::Chem::MatchConstraint::getValue ( ) const

Returns the value of the query attribute.

Returns
The value of the query attribute.

◆ getValue() [2/2]

template<typename T >
const T& CDPL::Chem::MatchConstraint::getValue ( ) const
inline

Returns a const reference to the value of the query attribute of type T.

Returns
A const reference to the value of the stored query attribute.
Exceptions
Base::BadCastif the stored Any instance is empty, or the stored value is not of the specified type T.

◆ setValue()

template<typename T >
void CDPL::Chem::MatchConstraint::setValue ( T &&  val)
inline

Sets the value of the query attribute.

Parameters
valThe value of the query attribute.

◆ hasValue()

bool CDPL::Chem::MatchConstraint::hasValue ( ) const

Tells wether a query attribute value has been set.

Returns
true if the value of the query attribute has been set, false otherwise.

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