Open Babel  3.0
Public Member Functions | Protected Attributes | Friends | List of all members
OBQueryBond Class Reference

#include <openbabel/query.h>

Public Member Functions

 OBQueryBond (OBQueryAtom *begin, OBQueryAtom *end, int order=1, bool aromatic=false)
 
virtual ~OBQueryBond ()
 
unsigned int GetIndex () const
 
OBQueryAtomGetBeginAtom () const
 
OBQueryAtomGetEndAtom () const
 
virtual bool Matches (const OBBond *bond) const
 

Protected Attributes

unsigned int m_index
 
OBQueryAtomm_begin
 
OBQueryAtomm_end
 
unsigned int m_order
 
bool m_aromatic
 

Friends

class OBQuery
 

Detailed Description

Bond in an OBQuery.

The OBQueryBond class defines an interface for query bonds. The class provides some general methods and properties to access the topology information. The Matches method can be reimplemented in subclasses to get custom matching behavior.

The default Matches implementation only checks if the bonds are both aromatic, otherwise the bond orders are compared.

See Substructure Search for more information.

See also
OBQuery OBQueryAtom OBIsomorphismMapper
Since
version 2.3

Constructor & Destructor Documentation

◆ OBQueryBond()

OBQueryBond ( OBQueryAtom begin,
OBQueryAtom end,
int  order = 1,
bool  aromatic = false 
)
inline

Constructor.

◆ ~OBQueryBond()

virtual ~OBQueryBond ( )
inlinevirtual

Member Function Documentation

◆ GetIndex()

unsigned int GetIndex ( ) const
inline

Get the index for this query bonds. Query bonds are indexed starting from 0.

◆ GetBeginAtom()

OBQueryAtom* GetBeginAtom ( ) const
inline

Get the begin atom.

◆ GetEndAtom()

OBQueryAtom* GetEndAtom ( ) const
inline

Get the end atom.

◆ Matches()

virtual bool Matches ( const OBBond bond) const
inlinevirtual

This is the match method to verify if an OBQueryBond and OBBond class match. The default implementation checks if both bonds are aromatic and compares the bond orders otherwise. Reimplement this method in a subclass for more advances matching. This method is used by OBIsomorphismMapper implementations.

Parameters
bondThe OBBond object to compare this OBQueryBond with.

Friends And Related Function Documentation

◆ OBQuery

friend class OBQuery
friend

Member Data Documentation

◆ m_index

unsigned int m_index
protected

Referenced by OBQuery::AddBond().

◆ m_begin

OBQueryAtom* m_begin
protected

◆ m_end

OBQueryAtom * m_end
protected

◆ m_order

unsigned int m_order
protected

◆ m_aromatic

bool m_aromatic
protected

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