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

AtomTypeMatchExpression. More...

#include <AtomTypeMatchExpression.hpp>

+ Inheritance diagram for CDPL::Chem::AtomTypeMatchExpression:

Public Types

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

Public Member Functions

 AtomTypeMatchExpression (unsigned int atom_type, bool not_match)
 Constructs an AtomTypeMatchExpression instance for the specified query atom type and matching mode. More...
 
bool operator() (const Atom &query_atom, const MolecularGraph &query_molgraph, const Atom &target_atom, const MolecularGraph &target_molgraph, const Base::Any &aux_data) const
 Checks whether the atom type of target_atom matches (or does not match) the query atom type specified in the constructor. More...
 
- Public Member Functions inherited from CDPL::Chem::MatchExpression< Atom, MolecularGraph >
virtual ~MatchExpression ()
 Virtual Destructor. More...
 
virtual bool operator() (const Atom &query_obj1, const MolecularGraph &query_obj2, const Atom &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 Atom &query_obj1, const MolecularGraph &query_obj2, const Atom &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

AtomTypeMatchExpression.

Member Typedef Documentation

◆ SharedPointer

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

Constructor & Destructor Documentation

◆ AtomTypeMatchExpression()

CDPL::Chem::AtomTypeMatchExpression::AtomTypeMatchExpression ( unsigned int  atom_type,
bool  not_match 
)

Constructs an AtomTypeMatchExpression instance for the specified query atom type and matching mode.

Parameters
atom_typeThe atom type that has to be matched (or not matched) by target atoms.
not_matchSpecifies whether the type of a target atom actually has to match (true) or not match (false) the query atom type.

Member Function Documentation

◆ operator()()

bool CDPL::Chem::AtomTypeMatchExpression::operator() ( const Atom query_atom,
const MolecularGraph query_molgraph,
const Atom target_atom,
const MolecularGraph target_molgraph,
const Base::Any aux_data 
) const

Checks whether the atom type of target_atom matches (or does not match) the query atom type specified in the constructor.

The following table lists all supported query atom types and associated matching target atom types:

Query Atom Type Matching Target Atom Types
Types in the range from Chem::AtomType::H to Chem::AtomType::MAX_ATOMIC_NO Any target atom with the same atom type
Chem::AtomType::ANY Any target atom type
Chem::AtomType::AH Any target atom type
Chem::AtomType::A Any target atom type except Chem::AtomType::H
Chem::AtomType::Q Any target atom type except Chem::AtomType::H and Chem::AtomType::C
Chem::AtomType::QH Any target atom type except Chem::AtomType::C
Chem::AtomType::M Any target atom type for which Chem::AtomTypeDB::isMetal() returns true
Chem::AtomType::MH Chem::AtomType::H or any target atom type for which Chem::AtomTypeDB::isMetal() returns true
Chem::AtomType::X Any target atom type for which Chem::AtomTypeDB::isHalogen() returns true
Chem::AtomType::XH Chem::AtomType::H or any target atom type for which Chem::AtomTypeDB::isHalogen() returns true

For any other query atom types the method will always return true - irrespective of matching mode and target atom type!

Parameters
query_atomThe query atom (ignored).
query_molgraphThe molecular graph containing the query atom (ignored).
target_atomThe checked target atom.
target_molgraphThe molecular graph containing the target atom (ignored).
aux_dataAuxiliary information for expression evaluation (ignored).
Returns
If the matching mode is 'not match' (see constructor), the method returns false if the type of the target atom is equivalent to the query atom type (see table), and true if the atom types do not match. Otherwise, the method will return true if the atom types are equivalent, and false if they are not.
Note
The atom type of target_atom is taken from the Chem::Atom property Chem::AtomProperty::TYPE.

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