29 #ifndef CDPL_CHEM_PROPERTYMATCHEXPRESSION_HPP
30 #define CDPL_CHEM_PROPERTYMATCHEXPRESSION_HPP
63 template <
typename ValueType,
typename MatchFunc,
typename ObjType1,
typename ObjType2 =
void>
87 value(), matchFunc(), propertyFunc(property_func), fixed(false) {}
96 value(value), matchFunc(), propertyFunc(property_func), fixed(true) {}
112 bool operator()(
const ObjType1& query_obj1,
const ObjType2& query_obj2,
const ObjType1& target_obj1,
113 const ObjType2& target_obj2,
const Base::Any& aux_data)
const;
137 template <
typename ValueType,
typename MatchFunc,
typename ObjType>
161 value(), matchFunc(), propertyFunc(property_func), fixed(false) {}
170 value(value), matchFunc(), propertyFunc(property_func), fixed(true) {}
184 bool operator()(
const ObjType& query_obj,
const ObjType& target_obj,
const Base::Any& aux_data)
const;
198 template <
typename ValueType,
typename MatchFunc,
typename ObjType1,
typename ObjType2>
200 const ObjType1& target_obj1,
const ObjType2& target_obj2,
204 return matchFunc(propertyFunc(target_obj1, target_obj2), value);
206 return matchFunc(propertyFunc(target_obj1, target_obj2), propertyFunc(query_obj1, query_obj2));
210 template <
typename ValueType,
typename MatchFunc,
typename ObjType>
215 return matchFunc(propertyFunc(target_obj), value);
217 return matchFunc(propertyFunc(target_obj), propertyFunc(query_obj));
Definition of class CDPL::Chem::MatchExpression.
Safe, type checked container for arbitrary data of variable type.
Definition: Any.hpp:60
Generic boolean expression interface for the implementation of query/target object equivalence tests ...
Definition: MatchExpression.hpp:75
PropertyMatchExpression(const PropertyFunction &property_func)
Constructs a PropertyMatchExpression instance that performs query/target object equivalence tests bas...
Definition: PropertyMatchExpression.hpp:160
PropertyMatchExpression(const ValueType &value, const PropertyFunction &property_func)
Constructs a PropertyMatchExpression instance that performs query/target object equivalence tests bas...
Definition: PropertyMatchExpression.hpp:169
std::function< ValueType(const ObjType &)> PropertyFunction
Type of the generic functor class used to store user-defined property accessor functions.
Definition: PropertyMatchExpression.hpp:153
std::shared_ptr< PropertyMatchExpression > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated PropertyMatchExpression instances...
Definition: PropertyMatchExpression.hpp:145
Generic Chem::MatchExpression specialisation that evaluates a binary comparison between a query- and ...
Definition: PropertyMatchExpression.hpp:65
PropertyMatchExpression(const PropertyFunction &property_func)
Constructs a PropertyMatchExpression instance that performs query/target object equivalence tests bas...
Definition: PropertyMatchExpression.hpp:86
std::function< ValueType(const ObjType1 &, const ObjType2 &)> PropertyFunction
Type of the generic functor class used to store user-defined property accessor functions.
Definition: PropertyMatchExpression.hpp:79
PropertyMatchExpression(const ValueType &value, const PropertyFunction &property_func)
Constructs a PropertyMatchExpression instance that performs query/target object equivalence tests bas...
Definition: PropertyMatchExpression.hpp:95
bool operator()(const ObjType1 &query_obj1, const ObjType2 &query_obj2, const ObjType1 &target_obj1, const ObjType2 &target_obj2, const Base::Any &aux_data) const
Checks whether the value of the target object propery matches the query property value.
Definition: PropertyMatchExpression.hpp:199
std::shared_ptr< PropertyMatchExpression > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated PropertyMatchExpression instances...
Definition: PropertyMatchExpression.hpp:71
The namespace of the Chemical Data Processing Library.