![]() |
Chemical Data Processing Library C++ API - Version 1.4.0
|
Describes a single attribute-comparison constraint between a query and a target object used by molecular graph matching algorithms. 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::Any & | getValue () 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... | |
Describes a single attribute-comparison constraint between a query and a target object used by molecular graph matching algorithms.
Each constraint is identified by an integer id (typically a Chem::*MatchConstraint constant such as Chem::AtomMatchConstraint::AROMATICITY) and pairs it with a Relation (LESS, EQUAL, GREATER, LESS_OR_EQUAL, GREATER_OR_EQUAL, NOT_EQUAL, or ANY) plus an optional query-side value stored in a Base::Any. The matching algorithm reads back id, relation and value to decide whether a query/target attribute pair satisfies the constraint.
Defines constants for the specification of relational constraints on the values of query/target attribute pairs.
|
inline |
Constructs a MatchConstraint object with the given identifier and relational constraint on the values of matching query/target attribute pairs.
| id | The identifier of the match constraint. |
| relation | The relational constraint on the values of matching query/target attribute pairs. |
|
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.
| id | The identifier of the match constraint. |
| rel | The relational constraint on the values of matching query/target attribute pairs. |
| val | The value of the query attribute. |
| unsigned int CDPL::Chem::MatchConstraint::getID | ( | ) | const |
Returns the identifier of the match constraint.
| void CDPL::Chem::MatchConstraint::setID | ( | unsigned int | id | ) |
Sets the match constraint identifier to id.
| id | The identifier of the match constraint. |
| Relation CDPL::Chem::MatchConstraint::getRelation | ( | ) | const |
Returns the relational constraint that must be fulfilled by the values of matching query/target attribute pairs.
| void CDPL::Chem::MatchConstraint::setRelation | ( | Relation | rel | ) |
Sets the relational constraint that must be fulfilled by the values of matching query/target attribute pairs.
| rel | The relational constraint on the values of matching query/target attribute pairs. |
| const Base::Any& CDPL::Chem::MatchConstraint::getValue | ( | ) | const |
Returns the value of the query attribute.
|
inline |
Returns a const reference to the value of the query attribute of type T.
const reference to the value of the stored query attribute. | Base::BadCast | if the stored Any instance is empty, or the stored value is not of the specified type T. |
|
inline |
Sets the value of the query attribute.
| val | The value of the query attribute. |
| bool CDPL::Chem::MatchConstraint::hasValue | ( | ) | const |
Tells wether a query attribute value has been set.
true if the value of the query attribute has been set, false otherwise.