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

BondDirectionMatchExpression. More...

#include <BondDirectionMatchExpression.hpp>

+ Inheritance diagram for CDPL::Chem::BondDirectionMatchExpression:

Public Types

typedef std::shared_ptr< BondDirectionMatchExpressionSharedPointer
 A reference-counted smart pointer [SHPTR] for dynamically allocated BondDirectionMatchExpression instances. More...
 
- Public Types inherited from CDPL::Chem::MatchExpression< Bond, MolecularGraph >
typedef std::shared_ptr< MatchExpressionSharedPointer
 A reference-counted smart pointer [SHPTR] for dynamically allocated MatchExpression instances. More...
 

Public Member Functions

 BondDirectionMatchExpression (unsigned int dir_flags, bool not_match)
 Constructs an BondDirectionMatchExpression instance for the specified matching mode and bond direction constraints. More...
 
bool operator() (const Bond &query_bond, const MolecularGraph &query_molgraph, const Bond &target_bond, const MolecularGraph &target_molgraph, const AtomBondMapping &mapping, const Base::Any &target_bond_dir) const
 Checks whether the direction given by target_bond_dir matches (or does not match) the direction constraints specified in the constructor. More...
 
- Public Member Functions inherited from CDPL::Chem::MatchExpression< Bond, MolecularGraph >
virtual ~MatchExpression ()
 Virtual Destructor. More...
 
virtual bool operator() (const Bond &query_obj1, const MolecularGraph &query_obj2, const Bond &target_obj1, const MolecularGraph &target_obj2, const Base::Any &aux_data) const
 Performs an evaluation of the expression for the given query and target objects. More...
 
virtual bool operator() (const Bond &query_obj1, const MolecularGraph &query_obj2, const Bond &target_obj1, const MolecularGraph &target_obj2, 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

BondDirectionMatchExpression.

Member Typedef Documentation

◆ SharedPointer

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

Constructor & Destructor Documentation

◆ BondDirectionMatchExpression()

CDPL::Chem::BondDirectionMatchExpression::BondDirectionMatchExpression ( unsigned int  dir_flags,
bool  not_match 
)

Constructs an BondDirectionMatchExpression instance for the specified matching mode and bond direction constraints.

Parameters
dir_flagsA bitwise OR combination of the flags defined in namespace Chem::BondDirection that specifies constraints on the direction of matching target bonds.
not_matchSpecifies whether the direction of a target bond actually has to match (true) or not match (false) the query direction constraints.

Member Function Documentation

◆ operator()()

bool CDPL::Chem::BondDirectionMatchExpression::operator() ( const Bond query_bond,
const MolecularGraph query_molgraph,
const Bond target_bond,
const MolecularGraph target_molgraph,
const AtomBondMapping mapping,
const Base::Any target_bond_dir 
) const

Checks whether the direction given by target_bond_dir matches (or does not match) the direction constraints specified in the constructor.

The specified query direction constraint flags are interpreted in a 'logical OR' manner. That is, the target bond direction specified by target_bond_dir only has to match (or not match) one of the specified query directions to satisfy the overall direction constraints. Note that only the flags defined in namespace Chem::BondDirection are supported - any other flags will be ignored.

Parameters
query_bondThe query bond (ignored).
query_molgraphThe molecular graph containing the query bond (ignored).
target_bondThe target bond (ignored).
target_molgraphThe molecular graph containing the target bond (ignored).
mappingThe current query to target atom/bond mapping candidate (ignored).
target_bond_dirSpecifies the direction of the target bond by one of the flags defined in namespace Chem::BondDirection.
Returns
If the matching mode is 'not match' (see constructor), the method returns false if the direction of the target bond (given by target_bond_dir) matches one of the directions specified in the constructor, and true if not. If the matching mode is 'match', the expression evaluates to true if the target bond matches one of the query directions, and false otherwise.
Note
If no valid query direction flags were specified or target_bond_dir does not hold a value, the method will return true - irrespective of matching mode and actual target bond direction!

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