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;
139 template <
typename ValueType,
typename MatchFunc,
typename ObjType>
163 value(), matchFunc(), propertyFunc(property_func), fixed(false) {}
172 value(value), matchFunc(), propertyFunc(property_func), fixed(true) {}
186 bool operator()(
const ObjType& query_obj,
const ObjType& target_obj,
const Base::Any& aux_data)
const;
200 template <
typename ValueType,
typename MatchFunc,
typename ObjType1,
typename ObjType2>
202 const ObjType1& target_obj1,
const ObjType2& target_obj2,
206 return matchFunc(propertyFunc(target_obj1, target_obj2), value);
208 return matchFunc(propertyFunc(target_obj1, target_obj2), propertyFunc(query_obj1, query_obj2));
212 template <
typename ValueType,
typename MatchFunc,
typename ObjType>
217 return matchFunc(propertyFunc(target_obj), value);
219 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:162
PropertyMatchExpression(const ValueType &value, const PropertyFunction &property_func)
Constructs a PropertyMatchExpression instance that performs query/target object equivalence tests bas...
Definition: PropertyMatchExpression.hpp:171
std::function< ValueType(const ObjType &)> PropertyFunction
Type of the generic functor class used to store user-defined property accessor functions.
Definition: PropertyMatchExpression.hpp:155
std::shared_ptr< PropertyMatchExpression > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated PropertyMatchExpression instances...
Definition: PropertyMatchExpression.hpp:147
Generic Chem::MatchExpression specialization for the binary comparison between a query- and a target-...
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:201
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.