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

CanonicalFragment. More...

#include <CanonicalFragment.hpp>

+ Inheritance diagram for CDPL::ConfGen::CanonicalFragment:

Public Types

typedef std::shared_ptr< CanonicalFragmentSharedPointer
 A reference-counted smart pointer [SHPTR] for dynamically allocated CanonicalFragment instances. More...
 
typedef Chem::BasicMolecule::AtomIterator AtomIterator
 
typedef Chem::BasicMolecule::ConstAtomIterator ConstAtomIterator
 
typedef Chem::BasicMolecule::BondIterator BondIterator
 
typedef Chem::BasicMolecule::ConstBondIterator ConstBondIterator
 
typedef std::vector< const Chem::Atom * > AtomMapping
 
- Public Types inherited from CDPL::Chem::MolecularGraph
typedef std::shared_ptr< MolecularGraphSharedPointer
 A reference-counted smart pointer [SHPTR] for dynamically allocated MolecularGraph instances. More...
 
- Public Types inherited from CDPL::Chem::AtomContainer
typedef Util::IndexedElementIterator< const Atom, ConstAtomAccessor > ConstAtomIterator
 A constant random access iterator used to iterate over the stored const Chem::Atom objects. More...
 
typedef Util::IndexedElementIterator< Atom, AtomAccessor > AtomIterator
 A mutable random access iterator used to iterate over the stored Chem::Atom objects. More...
 
- Public Types inherited from CDPL::Chem::Entity3DContainer
typedef Util::IndexedElementIterator< const Entity3D, ConstEntityAccessor > ConstEntityIterator
 A constant random access iterator used to iterate over the stored const Chem::Entity3D objects. More...
 
typedef Util::IndexedElementIterator< Entity3D, EntityAccessor > EntityIterator
 A mutable random access iterator used to iterate over the stored Chem::Entity3D objects. More...
 
- Public Types inherited from CDPL::Chem::BondContainer
typedef Util::IndexedElementIterator< const Bond, ConstBondAccessor > ConstBondIterator
 A constant random access iterator used to iterate over the stored const Chem::Bond objects. More...
 
typedef Util::IndexedElementIterator< Bond, BondAccessor > BondIterator
 A mutable random access iterator used to iterate over the stored Chem::Bond objects. More...
 
- Public Types inherited from CDPL::Base::PropertyContainer
typedef PropertyMap::value_type PropertyEntry
 A Base::LookupKey / Base::Any pair that stores the property value for a given property key. More...
 
typedef PropertyMap::const_iterator ConstPropertyIterator
 A constant iterator used to iterate over the property entries. More...
 

Public Member Functions

 CanonicalFragment ()
 Constructs an empty CanonicalFragment instance. More...
 
 CanonicalFragment (const Chem::MolecularGraph &molgraph, const Chem::MolecularGraph &parent)
 Constructs a CanonicalFragment instance that contains the relevant atoms and bonds of the molecular graph molgraph. More...
 
 CanonicalFragment (const CanonicalFragment &frag)
 
void clear ()
 
std::size_t getNumAtoms () const
 Returns the number of stored Chem::Atom objects. More...
 
const Chem::AtomgetAtom (std::size_t idx) const
 Returns a const reference to the Chem::Atom instance at index idx. More...
 
Chem::AtomgetAtom (std::size_t idx)
 Returns a non-const reference to the atom at index idx. More...
 
ConstAtomIterator getAtomsBegin () const
 
ConstAtomIterator getAtomsEnd () const
 
AtomIterator getAtomsBegin ()
 
AtomIterator getAtomsEnd ()
 
bool containsAtom (const Chem::Atom &atom) const
 Tells whether the specified Chem::Atom instance is stored in this container. More...
 
std::size_t getAtomIndex (const Chem::Atom &atom) const
 Returns the index of the specified Chem::Atom instance in this container. More...
 
std::size_t getNumEntities () const
 Returns the number of stored Chem::Entity3D objects. More...
 
const Chem::Entity3DgetEntity (std::size_t idx) const
 Returns a const reference to the Chem::Entity3D instance at index idx. More...
 
Chem::Entity3DgetEntity (std::size_t idx)
 Returns a non-const reference to the entity at index idx. More...
 
std::size_t getNumBonds () const
 Returns the number of stored Chem::Bond objects. More...
 
const Chem::BondgetBond (std::size_t idx) const
 Returns a const reference to the Chem::Bond instance at index idx. More...
 
Chem::BondgetBond (std::size_t idx)
 Returns a non-const reference to the bond at index idx. More...
 
ConstBondIterator getBondsBegin () const
 
ConstBondIterator getBondsEnd () const
 
BondIterator getBondsBegin ()
 
BondIterator getBondsEnd ()
 
bool containsBond (const Chem::Bond &bond) const
 Tells whether the specified Chem::Bond instance is stored in this container. More...
 
std::size_t getBondIndex (const Chem::Bond &bond) const
 Returns the index of the specified Chem::Bond instance in this container. More...
 
void orderAtoms (const Chem::AtomCompareFunction &func)
 Orders the stored atoms according to criteria implemented by the provided atom comparison function. More...
 
void orderBonds (const Chem::BondCompareFunction &func)
 Orders the stored bonds according to criteria implemented by the provided bond comparison function. More...
 
std::uint64_t getHashCode () const
 
Chem::MolecularGraph::SharedPointer clone () const
 Creates a copy of the molecular graph. More...
 
CanonicalFragmentoperator= (const CanonicalFragment &frag)
 
void create (const Chem::MolecularGraph &molgraph, const Chem::MolecularGraph &parent, bool modify=true, bool strip_aro_subst=true)
 
const AtomMappinggetAtomMapping () const
 
void perceiveSSSR ()
 
- Public Member Functions inherited from CDPL::Chem::MolecularGraph
virtual ~MolecularGraph ()
 Virtual destructor. More...
 
- Public Member Functions inherited from CDPL::Chem::AtomContainer
ConstAtomIterator getAtomsBegin () const
 Returns a constant iterator pointing to the beginning of the stored const Chem::Atom objects. More...
 
ConstAtomIterator getAtomsEnd () const
 Returns a constant iterator pointing to the end of the stored const Chem::Atom objects. More...
 
AtomIterator getAtomsBegin ()
 Returns a mutable iterator pointing to the beginning of the stored Chem::Atom objects. More...
 
AtomIterator getAtomsEnd ()
 Returns a mutable iterator pointing to the end of the stored Chem::Atom objects. More...
 
ConstAtomIterator begin () const
 Returns a constant iterator pointing to the beginning of the stored const Chem::Atom objects. More...
 
ConstAtomIterator end () const
 Returns a constant iterator pointing to the end of the stored const Chem::Atom objects. More...
 
AtomIterator begin ()
 Returns a mutable iterator pointing to the beginning of the stored Chem::Atom objects. More...
 
AtomIterator end ()
 Returns a mutable iterator pointing to the end of the stored Chem::Atom objects. More...
 
const AtomContainergetAtoms () const
 Returns a const reference to itself. More...
 
AtomContainergetAtoms ()
 Returns a reference to itself. More...
 
- Public Member Functions inherited from CDPL::Chem::Entity3DContainer
ConstEntityIterator getEntitiesBegin () const
 Returns a constant iterator pointing to the beginning of the stored const Chem::Entity3D objects. More...
 
ConstEntityIterator getEntitiesEnd () const
 Returns a constant iterator pointing to the end of the stored const Chem::Entity3D objects. More...
 
EntityIterator getEntitiesBegin ()
 Returns a mutable iterator pointing to the beginning of the stored Chem::Entity3D objects. More...
 
EntityIterator getEntitiesEnd ()
 Returns a mutable iterator pointing to the end of the stored Chem::Entity3D objects. More...
 
ConstEntityIterator begin () const
 Returns a constant iterator pointing to the beginning of the stored const Chem::Entity3D objects. More...
 
ConstEntityIterator end () const
 Returns a constant iterator pointing to the end of the stored const Chem::Entity3D objects. More...
 
EntityIterator begin ()
 Returns a mutable iterator pointing to the beginning of the stored Chem::Entity3D objects. More...
 
EntityIterator end ()
 Returns a mutable iterator pointing to the end of the stored Chem::Entity3D objects. More...
 
const Entity3DContainergetEntities () const
 Returns a const reference to itself. More...
 
Entity3DContainergetEntities ()
 Returns a reference to itself. More...
 
- Public Member Functions inherited from CDPL::Chem::BondContainer
ConstBondIterator getBondsBegin () const
 Returns a constant iterator pointing to the beginning of the stored const Chem::Bond objects. More...
 
ConstBondIterator getBondsEnd () const
 Returns a constant iterator pointing to the end of the stored const Chem::Bond objects. More...
 
BondIterator getBondsBegin ()
 Returns a mutable iterator pointing to the beginning of the stored Chem::Bond objects. More...
 
BondIterator getBondsEnd ()
 Returns a mutable iterator pointing to the end of the stored Chem::Bond objects. More...
 
ConstBondIterator begin () const
 Returns a constant iterator pointing to the beginning of the stored const Chem::Bond objects. More...
 
ConstBondIterator end () const
 Returns a constant iterator pointing to the end of the stored const Chem::Bond objects. More...
 
BondIterator begin ()
 Returns a mutable iterator pointing to the beginning of the stored Chem::Bond objects. More...
 
BondIterator end ()
 Returns a mutable iterator pointing to the end of the stored Chem::Bond objects. More...
 
const BondContainergetBonds () const
 Returns a const reference to itself. More...
 
BondContainergetBonds ()
 Returns a reference to itself. More...
 
- Public Member Functions inherited from CDPL::Base::PropertyContainer
std::size_t getNumProperties () const
 Returns the number of property entries. More...
 
template<typename T >
void setProperty (const LookupKey &key, T &&val)
 Sets the value of the property specified by key to val. More...
 
template<typename T >
const T & getProperty (const LookupKey &key) const
 Returns the value of the property specified by key as a const reference to an object of type T. More...
 
template<typename T >
const T & getPropertyOrDefault (const LookupKey &key, const T &def_val) const
 Returns the value of the property specified by key as a const reference to an object of type T, or the default value def_val if a stored value does not exist. More...
 
const AnygetProperty (const LookupKey &key, bool throw_=false) const
 Returns the value of the property specified by key. More...
 
bool isPropertySet (const LookupKey &key) const
 Tells whether or not a value has been assigned to the property specified by key. More...
 
ConstPropertyIterator getPropertiesBegin () const
 Returns a constant iterator pointing to the beginning of the property entries. More...
 
ConstPropertyIterator getPropertiesEnd () const
 Returns a constant iterator pointing to the end of the property entries. More...
 
ConstPropertyIterator begin () const
 Returns a constant iterator pointing to the beginning of the property entries. More...
 
ConstPropertyIterator end () const
 Returns a constant iterator pointing to the end of the property entries. More...
 
bool removeProperty (const LookupKey &key)
 Clears the value of the property specified by key. More...
 
void clearProperties ()
 Clears all property values. More...
 
void addProperties (const PropertyContainer &cntnr)
 Adds the property value entries in the PropertyContainer instance cntnr. More...
 
void copyProperties (const PropertyContainer &cntnr)
 Replaces the current set of properties by a copy of the entries in cntnr. More...
 
void swap (PropertyContainer &cntnr)
 Exchanges the properties of this container with the properties of the container cntnr. More...
 
const PropertyContainergetProperties () const
 Returns a const reference to itself. More...
 

Additional Inherited Members

- Protected Member Functions inherited from CDPL::Chem::MolecularGraph
MolecularGraphoperator= (const MolecularGraph &molgraph)
 Assignment operator. More...
 
- Protected Member Functions inherited from CDPL::Chem::AtomContainer
virtual ~AtomContainer ()
 Virtual destructor. More...
 
AtomContaineroperator= (const AtomContainer &cntnr)
 Assignment operator. More...
 
- Protected Member Functions inherited from CDPL::Chem::Entity3DContainer
virtual ~Entity3DContainer ()
 Virtual destructor. More...
 
Entity3DContaineroperator= (const Entity3DContainer &cntnr)
 Assignment operator. More...
 
- Protected Member Functions inherited from CDPL::Chem::BondContainer
virtual ~BondContainer ()
 Virtual destructor. More...
 
BondContaineroperator= (const BondContainer &cntnr)
 Assignment operator. More...
 
- Protected Member Functions inherited from CDPL::Base::PropertyContainer
 PropertyContainer ()
 Constructs an empty PropertyContainer instance. More...
 
 PropertyContainer (const PropertyContainer &cntnr)
 Constructs a copy of the PropertyContainer instance cntnr. More...
 
virtual ~PropertyContainer ()
 Virtual destructor. More...
 
PropertyContaineroperator= (const PropertyContainer &cntnr)
 Assignment operator. More...
 

Detailed Description

CanonicalFragment.

Member Typedef Documentation

◆ SharedPointer

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

◆ AtomIterator

◆ ConstAtomIterator

◆ BondIterator

◆ ConstBondIterator

◆ AtomMapping

Constructor & Destructor Documentation

◆ CanonicalFragment() [1/3]

CDPL::ConfGen::CanonicalFragment::CanonicalFragment ( )

Constructs an empty CanonicalFragment instance.

◆ CanonicalFragment() [2/3]

CDPL::ConfGen::CanonicalFragment::CanonicalFragment ( const Chem::MolecularGraph molgraph,
const Chem::MolecularGraph parent 
)

Constructs a CanonicalFragment instance that contains the relevant atoms and bonds of the molecular graph molgraph.

Parameters
molgraphThe molecular graph for which to generate the fragments.
parentThe parent molecular graph the fragment is coming from.

◆ CanonicalFragment() [3/3]

CDPL::ConfGen::CanonicalFragment::CanonicalFragment ( const CanonicalFragment frag)

Member Function Documentation

◆ clear()

void CDPL::ConfGen::CanonicalFragment::clear ( )

◆ getNumAtoms()

std::size_t CDPL::ConfGen::CanonicalFragment::getNumAtoms ( ) const
virtual

Returns the number of stored Chem::Atom objects.

Returns
The number of stored Chem::Atom objects.

Implements CDPL::Chem::AtomContainer.

◆ getAtom() [1/2]

const Chem::Atom& CDPL::ConfGen::CanonicalFragment::getAtom ( std::size_t  idx) const
virtual

Returns a const reference to the Chem::Atom instance at index idx.

Parameters
idxThe zero-based index of the Chem::Atom instance to return.
Returns
A const reference to the Chem::Atom instance at the specified index.
Exceptions
Base::IndexErrorif the container is empty or idx is not in the range [0, getNumAtoms() - 1].

Implements CDPL::Chem::AtomContainer.

◆ getAtom() [2/2]

Chem::Atom& CDPL::ConfGen::CanonicalFragment::getAtom ( std::size_t  idx)
virtual

Returns a non-const reference to the atom at index idx.

Parameters
idxThe zero-based index of the Chem::Atom instance to return.
Returns
A non-const reference to the atom at the specified index.
Exceptions
Base::IndexErrorif the number of atoms is zero or idx is not in the range [0, getNumAtoms() - 1].

Implements CDPL::Chem::AtomContainer.

◆ getAtomsBegin() [1/2]

ConstAtomIterator CDPL::ConfGen::CanonicalFragment::getAtomsBegin ( ) const

◆ getAtomsEnd() [1/2]

ConstAtomIterator CDPL::ConfGen::CanonicalFragment::getAtomsEnd ( ) const

◆ getAtomsBegin() [2/2]

AtomIterator CDPL::ConfGen::CanonicalFragment::getAtomsBegin ( )

◆ getAtomsEnd() [2/2]

AtomIterator CDPL::ConfGen::CanonicalFragment::getAtomsEnd ( )

◆ containsAtom()

bool CDPL::ConfGen::CanonicalFragment::containsAtom ( const Chem::Atom atom) const
virtual

Tells whether the specified Chem::Atom instance is stored in this container.

Parameters
atomThe Chem::Atom instance to look for.
Returns
true if atom is stored in the container, and false otherwise.

Implements CDPL::Chem::AtomContainer.

◆ getAtomIndex()

std::size_t CDPL::ConfGen::CanonicalFragment::getAtomIndex ( const Chem::Atom atom) const
virtual

Returns the index of the specified Chem::Atom instance in this container.

Parameters
atomThe Chem::Atom instance for which to return the index.
Returns
The zero-based index of the specified Chem::Atom instance.
Exceptions
Base::ItemNotFoundif the specified Chem::Atom instance could not be found.

Implements CDPL::Chem::AtomContainer.

◆ getNumEntities()

std::size_t CDPL::ConfGen::CanonicalFragment::getNumEntities ( ) const
virtual

Returns the number of stored Chem::Entity3D objects.

Returns
The number of stored Chem::Entity3D objects.

Reimplemented from CDPL::Chem::AtomContainer.

◆ getEntity() [1/2]

const Chem::Entity3D& CDPL::ConfGen::CanonicalFragment::getEntity ( std::size_t  idx) const
virtual

Returns a const reference to the Chem::Entity3D instance at index idx.

Parameters
idxThe zero-based index of the Chem::Entity3D instance to return.
Returns
A const reference to the Chem::Entity3D instance at the specified index.
Exceptions
Base::IndexErrorif the container is empty or idx is not in the range [0, getNumEntities() - 1].

Reimplemented from CDPL::Chem::AtomContainer.

◆ getEntity() [2/2]

Chem::Entity3D& CDPL::ConfGen::CanonicalFragment::getEntity ( std::size_t  idx)
virtual

Returns a non-const reference to the entity at index idx.

Parameters
idxThe zero-based index of the Chem::Entity3D instance to return.
Returns
A non-const reference to the entity at the specified index.
Exceptions
Base::IndexErrorif the number of entities is zero or idx is not in the range [0, getNumEntities() - 1].

Reimplemented from CDPL::Chem::AtomContainer.

◆ getNumBonds()

std::size_t CDPL::ConfGen::CanonicalFragment::getNumBonds ( ) const
virtual

Returns the number of stored Chem::Bond objects.

Returns
The number of stored Chem::Bond objects.

Implements CDPL::Chem::BondContainer.

◆ getBond() [1/2]

const Chem::Bond& CDPL::ConfGen::CanonicalFragment::getBond ( std::size_t  idx) const
virtual

Returns a const reference to the Chem::Bond instance at index idx.

Parameters
idxThe zero-based index of the Chem::Bond instance to return.
Returns
A const reference to the Chem::Bond instance at the specified index.
Exceptions
Base::IndexErrorif the container is empty or idx is not in the range [0, getNumBonds() - 1].

Implements CDPL::Chem::BondContainer.

◆ getBond() [2/2]

Chem::Bond& CDPL::ConfGen::CanonicalFragment::getBond ( std::size_t  idx)
virtual

Returns a non-const reference to the bond at index idx.

Parameters
idxThe zero-based index of the Chem::Bond instance to return.
Returns
A non-const reference to the bond at the specified index.
Exceptions
Base::IndexErrorif the number of bonds is zero or idx is not in the range [0, getNumBonds() - 1].

Implements CDPL::Chem::BondContainer.

◆ getBondsBegin() [1/2]

ConstBondIterator CDPL::ConfGen::CanonicalFragment::getBondsBegin ( ) const

◆ getBondsEnd() [1/2]

ConstBondIterator CDPL::ConfGen::CanonicalFragment::getBondsEnd ( ) const

◆ getBondsBegin() [2/2]

BondIterator CDPL::ConfGen::CanonicalFragment::getBondsBegin ( )

◆ getBondsEnd() [2/2]

BondIterator CDPL::ConfGen::CanonicalFragment::getBondsEnd ( )

◆ containsBond()

bool CDPL::ConfGen::CanonicalFragment::containsBond ( const Chem::Bond bond) const
virtual

Tells whether the specified Chem::Bond instance is stored in this container.

Parameters
bondThe Chem::Bond instance to look for.
Returns
true if bond is stored in the container, and false otherwise.

Implements CDPL::Chem::BondContainer.

◆ getBondIndex()

std::size_t CDPL::ConfGen::CanonicalFragment::getBondIndex ( const Chem::Bond bond) const
virtual

Returns the index of the specified Chem::Bond instance in this container.

Parameters
bondThe Chem::Bond instance for which to return the index.
Returns
The zero-based index of the specified Chem::Bond instance.
Exceptions
Base::ItemNotFoundif the specified Chem::Bond instance could not be found.

Implements CDPL::Chem::BondContainer.

◆ orderAtoms()

void CDPL::ConfGen::CanonicalFragment::orderAtoms ( const Chem::AtomCompareFunction func)
virtual

Orders the stored atoms according to criteria implemented by the provided atom comparison function.

Parameters
funcThe atom comparison function implementing the applied ordering criteria.

Implements CDPL::Chem::AtomContainer.

◆ orderBonds()

void CDPL::ConfGen::CanonicalFragment::orderBonds ( const Chem::BondCompareFunction func)
virtual

Orders the stored bonds according to criteria implemented by the provided bond comparison function.

Parameters
funcThe bond comparison function implementing the applied ordering criteria.

Implements CDPL::Chem::BondContainer.

◆ getHashCode()

std::uint64_t CDPL::ConfGen::CanonicalFragment::getHashCode ( ) const

◆ clone()

Chem::MolecularGraph::SharedPointer CDPL::ConfGen::CanonicalFragment::clone ( ) const
virtual

Creates a copy of the molecular graph.

Returns
A smart pointer to the copy of the molecular graph.

Implements CDPL::Chem::MolecularGraph.

◆ operator=()

CanonicalFragment& CDPL::ConfGen::CanonicalFragment::operator= ( const CanonicalFragment frag)

◆ create()

void CDPL::ConfGen::CanonicalFragment::create ( const Chem::MolecularGraph molgraph,
const Chem::MolecularGraph parent,
bool  modify = true,
bool  strip_aro_subst = true 
)

◆ getAtomMapping()

const AtomMapping& CDPL::ConfGen::CanonicalFragment::getAtomMapping ( ) const

◆ perceiveSSSR()

void CDPL::ConfGen::CanonicalFragment::perceiveSSSR ( )

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