Chemical Data Processing Library C++ API - Version 1.1.1
Public Types | Public Member Functions | List of all members
CDPL::Chem::PropertyMatchExpression< ValueType, MatchFunc, ObjType, void > Class Template Reference

PropertyMatchExpression. More...

#include <PropertyMatchExpression.hpp>

+ Inheritance diagram for CDPL::Chem::PropertyMatchExpression< ValueType, MatchFunc, ObjType, void >:

Public Types

typedef std::shared_ptr< PropertyMatchExpressionSharedPointer
 A reference-counted smart pointer [SHPTR] for dynamically allocated PropertyMatchExpression instances. More...
 
typedef std::function< ValueType(const ObjType &)> PropertyFunction
 Type of the generic functor class used to store user-defined property accessor functions. More...
 
- Public Types inherited from CDPL::Chem::MatchExpression< ObjType, void >
typedef std::shared_ptr< MatchExpressionSharedPointer
 A reference-counted smart pointer [SHPTR] for dynamically allocated MatchExpression instances. More...
 

Public Member Functions

 PropertyMatchExpression (const PropertyFunction &property_func)
 Constructs a PropertyMatchExpression instance that performs query/target object equivalence tests based on the property values returned by property_func. More...
 
 PropertyMatchExpression (const ValueType &value, const PropertyFunction &property_func)
 Constructs a PropertyMatchExpression instance that performs query/target object equivalence tests based on the target object property values returned by property_func and the specified query value. More...
 
bool operator() (const ObjType &query_obj, const ObjType &target_obj, const Base::Any &aux_data) const
 Checks whether the value of the target object propery matches the query property value. More...
 
- Public Member Functions inherited from CDPL::Chem::MatchExpression< ObjType, void >
virtual ~MatchExpression ()
 Virtual Destructor. More...
 
virtual bool operator() (const ObjType &query_obj, const ObjType &target_obj, const AtomBondMapping &mapping, const Base::Any &aux_data) const
 Performs an evaluation of the expression for the given query and target objects under consideration of the provided candidate atom/bond mapping. More...
 
virtual bool requiresAtomBondMapping () const
 Tells whether the expression must be reevaluated after a query to target atom/bond mapping candidate has been found. More...
 

Detailed Description

template<typename ValueType, typename MatchFunc, typename ObjType>
class CDPL::Chem::PropertyMatchExpression< ValueType, MatchFunc, ObjType, void >

PropertyMatchExpression.

Template Parameters
ValueTypeThe type of the checked property values.
MatchFuncThe type of a binary functor class that implements the logic of testing the target property values against the query property values. The overloaded function call operator is required to take the target property value as its first argument and the query value as the second argument (both provided as const reference to ValueType). The returned result must be implicitly convertible to type bool (true indicates a match, false a mismatch).
ObjTypeThe type of the query/target objects for which the expression gets evaluated.

Member Typedef Documentation

◆ SharedPointer

template<typename ValueType , typename MatchFunc , typename ObjType >
typedef std::shared_ptr<PropertyMatchExpression> CDPL::Chem::PropertyMatchExpression< ValueType, MatchFunc, ObjType, void >::SharedPointer

A reference-counted smart pointer [SHPTR] for dynamically allocated PropertyMatchExpression instances.

◆ PropertyFunction

template<typename ValueType , typename MatchFunc , typename ObjType >
typedef std::function<ValueType(const ObjType&)> CDPL::Chem::PropertyMatchExpression< ValueType, MatchFunc, ObjType, void >::PropertyFunction

Type of the generic functor class used to store user-defined property accessor functions.

PropertyFunction allows to wrap any function pointer or function object compatible with a return type of ValueType and an argument of type const ObjType& (see [FUNWRP]).

Constructor & Destructor Documentation

◆ PropertyMatchExpression() [1/2]

template<typename ValueType , typename MatchFunc , typename ObjType >
CDPL::Chem::PropertyMatchExpression< ValueType, MatchFunc, ObjType, void >::PropertyMatchExpression ( const PropertyFunction property_func)
inline

Constructs a PropertyMatchExpression instance that performs query/target object equivalence tests based on the property values returned by property_func.

Parameters
property_funcA PropertyMatchExpression::PropertyFunction instance that wraps the specified property value accessor function.

◆ PropertyMatchExpression() [2/2]

template<typename ValueType , typename MatchFunc , typename ObjType >
CDPL::Chem::PropertyMatchExpression< ValueType, MatchFunc, ObjType, void >::PropertyMatchExpression ( const ValueType &  value,
const PropertyFunction property_func 
)
inline

Constructs a PropertyMatchExpression instance that performs query/target object equivalence tests based on the target object property values returned by property_func and the specified query value.

Parameters
valueThe query property value.
property_funcA PropertyMatchExpression::PropertyFunction instance that wraps the specified target property value accessor function.

Member Function Documentation

◆ operator()()

template<typename ValueType , typename MatchFunc , typename ObjType >
bool CDPL::Chem::PropertyMatchExpression< ValueType, MatchFunc, ObjType, void >::operator() ( const ObjType &  query_obj,
const ObjType &  target_obj,
const Base::Any aux_data 
) const
virtual

Checks whether the value of the target object propery matches the query property value.

The actual equivalence test between the query and target property values is performed by an instance of the function object type that was provided as template argument for MatchFunc.

Parameters
query_objThe query object.
target_objThe target object.
aux_dataProvides auxiliary information for the evaluation of the expression (ignored).
Returns
true if the target property value matches the query property value under the conditions defined by MatchFunc, and false otherwise.

Reimplemented from CDPL::Chem::MatchExpression< ObjType, void >.


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