Chemical Data Processing Library C++ API - Version 1.1.1
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
CDPL::Chem::Molecule Class Referenceabstract

Molecule. More...

#include <Molecule.hpp>

+ Inheritance diagram for CDPL::Chem::Molecule:

Public Types

typedef std::shared_ptr< MoleculeSharedPointer
 A reference-counted smart pointer [SHPTR] for dynamically allocated Molecule instances. More...
 
typedef AtomContainer::ConstAtomIterator ConstAtomIterator
 A constant random access iterator used to iterate over the atoms of the molecule. More...
 
typedef AtomContainer::AtomIterator AtomIterator
 A mutable random access iterator used to iterate over the atoms of the molecule. More...
 
typedef BondContainer::ConstBondIterator ConstBondIterator
 A constant random access iterator used to iterate over the bonds of the molecule. More...
 
typedef BondContainer::BondIterator BondIterator
 A mutable random access iterator used to iterate over the bonds of the molecule. More...
 
typedef std::function< void(Molecule &, const MolecularGraph &)> CopyPostprocessingFunction
 
- 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

virtual ~Molecule ()
 Virtual destructor. More...
 
virtual void clear ()=0
 Removes all atoms and bonds and clears all properties of the molecule. More...
 
virtual std::size_t getNumAtoms () const =0
 Returns the number of explicit atoms. More...
 
virtual std::size_t getNumBonds () const =0
 Returns the number of explicit bonds. More...
 
virtual const AtomgetAtom (std::size_t idx) const =0
 Returns a const reference to the atom at index idx. More...
 
virtual AtomgetAtom (std::size_t idx)=0
 Returns a non-const reference to the atom at index idx. More...
 
virtual AtomaddAtom ()=0
 Creates a new atom and adds it to the molecule. More...
 
virtual void removeAtom (std::size_t idx)=0
 Removes the atom at the specified index. More...
 
AtomIterator removeAtom (const AtomIterator &it)
 Removes the atom specified by the iterator it. More...
 
virtual const BondgetBond (std::size_t idx) const =0
 Returns a const reference to the bond at index idx. More...
 
virtual BondgetBond (std::size_t idx)=0
 Returns a non-const reference to the bond at index idx. More...
 
virtual BondaddBond (std::size_t atom1_idx, std::size_t atom2_idx)=0
 Creates a new or returns an already existing bond between the atoms specified by atom1_idx and atom2_idx. More...
 
virtual void removeBond (std::size_t idx)=0
 Removes the bond at the specified index. More...
 
BondIterator removeBond (const BondIterator &it)
 Removes the bond specified by the iterator it. More...
 
virtual bool containsAtom (const Atom &atom) const =0
 Tells whether the specified atom is part of this molecule. More...
 
virtual bool containsBond (const Bond &bond) const =0
 Tells whether the specified bond is part of this molecule. More...
 
virtual std::size_t getAtomIndex (const Atom &atom) const =0
 Returns the index of the specified atom. More...
 
virtual std::size_t getBondIndex (const Bond &bond) const =0
 Returns the index of the specified bond. More...
 
virtual void copy (const Molecule &mol)=0
 Replaces the current set of atoms, bonds and properties by a copy of the atoms, bonds and properties of the molecule mol. More...
 
virtual void copy (const MolecularGraph &molgraph)=0
 Replaces the current set of atoms, bonds and properties by a copy of the atoms, bonds and properties of the molecular graph molgraph. More...
 
virtual void append (const Molecule &mol)=0
 Extends the current set of atoms and bonds by a copy of the atoms and bonds in the molecule mol. More...
 
virtual void append (const MolecularGraph &molgraph)=0
 Extends the current set of atoms and bonds by a copy of the atoms and bonds in the molecular graph molgraph. More...
 
virtual void remove (const MolecularGraph &molgraph)=0
 Removes atoms and bonds referenced by the molecular graph molgraph that are part of this Molecule instance. More...
 
virtual void reserveMemoryForAtoms (std::size_t num_atoms)
 Reserves memory for num_atoms atoms. More...
 
virtual void reserveMemoryForBonds (std::size_t num_bonds)
 Reserves memory for num_bonds bonds. More...
 
Moleculeoperator= (const Molecule &mol)
 Replaces the current set of atoms, bonds and properties by a copy of the atoms, bonds and properties of the molecule mol. More...
 
Moleculeoperator= (const MolecularGraph &molgraph)
 Replaces the current set of atoms, bonds and properties by a copy of the atoms, bonds and properties of the molecular graph molgraph. More...
 
Moleculeoperator+= (const Molecule &mol)
 Extends the current set of atoms and bonds by a copy of the atoms and bonds in the molecule mol. More...
 
Moleculeoperator+= (const MolecularGraph &molgraph)
 Extends the current set of atoms and bonds by a copy of the atoms and bonds in the molecular graph molgraph. More...
 
Moleculeoperator-= (const MolecularGraph &molgraph)
 Removes atoms and bonds referenced by the molecular graph molgraph that are part of this Molecule instance. More...
 
ConstAtomIterator getAtomsBegin () const
 Returns a constant iterator pointing to the beginning 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...
 
ConstAtomIterator getAtomsEnd () const
 Returns a constant iterator pointing to the end of the stored const Chem::Atom objects. More...
 
AtomIterator getAtomsEnd ()
 Returns a mutable iterator pointing to the end of the stored Chem::Atom objects. More...
 
ConstBondIterator getBondsBegin () const
 Returns a constant iterator pointing to the beginning 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...
 
ConstBondIterator getBondsEnd () const
 Returns a constant iterator pointing to the end of the stored const Chem::Bond objects. More...
 
BondIterator getBondsEnd ()
 Returns a mutable iterator pointing to the end of the stored Chem::Bond objects. More...
 
- Public Member Functions inherited from CDPL::Chem::MolecularGraph
virtual ~MolecularGraph ()
 Virtual destructor. More...
 
virtual SharedPointer clone () const =0
 Creates a copy of the molecular graph. 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...
 
virtual std::size_t getNumEntities () const
 Returns the number of stored Chem::Entity3D objects. More...
 
virtual const Entity3DgetEntity (std::size_t idx) const
 Returns a const reference to the Chem::Entity3D instance at index idx. More...
 
virtual Entity3DgetEntity (std::size_t idx)
 Returns a non-const reference to the entity at index idx. More...
 
virtual void orderAtoms (const AtomCompareFunction &func)=0
 Orders the stored atoms according to criteria implemented by the provided atom comparison function. 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...
 
virtual void orderBonds (const BondCompareFunction &func)=0
 Orders the stored bonds according to criteria implemented by the provided bond comparison function. 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...
 

Static Public Member Functions

static void registerCopyPostprocessingFunction (const CopyPostprocessingFunction &func)
 

Protected Member Functions

void invokeCopyPostprocessingFunctions (const MolecularGraph &src_molgraph)
 
- 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

Molecule.

Member Typedef Documentation

◆ SharedPointer

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

◆ ConstAtomIterator

A constant random access iterator used to iterate over the atoms of the molecule.

◆ AtomIterator

A mutable random access iterator used to iterate over the atoms of the molecule.

◆ ConstBondIterator

A constant random access iterator used to iterate over the bonds of the molecule.

◆ BondIterator

A mutable random access iterator used to iterate over the bonds of the molecule.

◆ CopyPostprocessingFunction

Constructor & Destructor Documentation

◆ ~Molecule()

virtual CDPL::Chem::Molecule::~Molecule ( )
inlinevirtual

Virtual destructor.

Destroys the Molecule instance and frees all allocated resources.

Member Function Documentation

◆ clear()

virtual void CDPL::Chem::Molecule::clear ( )
pure virtual

Removes all atoms and bonds and clears all properties of the molecule.

Implemented in CDPL::Chem::BasicMolecule.

◆ getNumAtoms()

virtual std::size_t CDPL::Chem::Molecule::getNumAtoms ( ) const
pure virtual

Returns the number of explicit atoms.

Returns
The number of explicit atoms.

Implements CDPL::Chem::AtomContainer.

Implemented in CDPL::Chem::BasicMolecule.

◆ getNumBonds()

virtual std::size_t CDPL::Chem::Molecule::getNumBonds ( ) const
pure virtual

Returns the number of explicit bonds.

Returns
The number of explicit bonds.

Implements CDPL::Chem::BondContainer.

Implemented in CDPL::Chem::BasicMolecule.

◆ getAtom() [1/2]

virtual const Atom& CDPL::Chem::Molecule::getAtom ( std::size_t  idx) const
pure virtual

Returns a const reference to the atom at index idx.

Parameters
idxThe zero-based index of the atom to return.
Returns
A 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.

Implemented in CDPL::Chem::BasicMolecule.

◆ getAtom() [2/2]

virtual Atom& CDPL::Chem::Molecule::getAtom ( std::size_t  idx)
pure virtual

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

Parameters
idxThe zero-based index of the atom 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.

Implemented in CDPL::Chem::BasicMolecule.

◆ addAtom()

virtual Atom& CDPL::Chem::Molecule::addAtom ( )
pure virtual

Creates a new atom and adds it to the molecule.

Note that this method does not create any bonds - the returned atom is always unconnected.

Returns
A reference to the newly created atom.

Implemented in CDPL::Chem::BasicMolecule.

◆ removeAtom() [1/2]

virtual void CDPL::Chem::Molecule::removeAtom ( std::size_t  idx)
pure virtual

Removes the atom at the specified index.

If the specified atom is connected to any other atoms of the molecule, the connecting bonds will also be removed.

Parameters
idxThe index of the atom to remove.
Exceptions
Base::IndexErrorif the number of atoms is zero or idx is not in the range [0, getNumAtoms() - 1].

Implemented in CDPL::Chem::BasicMolecule.

◆ removeAtom() [2/2]

AtomIterator CDPL::Chem::Molecule::removeAtom ( const AtomIterator it)

Removes the atom specified by the iterator it.

If the specified atom is connected to any other atoms of the molecule, the connecting bonds will also be removed.

Parameters
itAn iterator that specifies the atom to remove.
Returns
A mutable iterator pointing to the next atom in the list.
Exceptions
Base::RangeErrorif the number of atoms is zero or it is not in the range [getAtomsBegin(), getAtomsEnd() - 1].

◆ getBond() [1/2]

virtual const Bond& CDPL::Chem::Molecule::getBond ( std::size_t  idx) const
pure virtual

Returns a const reference to the bond at index idx.

Parameters
idxThe zero-based index of the bond to return.
Returns
A 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.

Implemented in CDPL::Chem::BasicMolecule.

◆ getBond() [2/2]

virtual Bond& CDPL::Chem::Molecule::getBond ( std::size_t  idx)
pure virtual

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

Parameters
idxThe zero-based index of the bond 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.

Implemented in CDPL::Chem::BasicMolecule.

◆ addBond()

virtual Bond& CDPL::Chem::Molecule::addBond ( std::size_t  atom1_idx,
std::size_t  atom2_idx 
)
pure virtual

Creates a new or returns an already existing bond between the atoms specified by atom1_idx and atom2_idx.

If a bond between the specified atoms already exists, then the existing bond will be returned. If a bond does not yet exist, a new bond will be created. The atom specified by atom1_idx becomes the start atom and the atom specified by atom2_idx the end atom of the newly created bond.

Parameters
atom1_idxThe zero-based index of the first atom of the bond.
atom2_idxThe zero-based index of the second atom of the bond.
Returns
A reference to the newly created or already existing bond between the specified atoms.
Exceptions
Base::IndexErrorif the number of atoms is zero or atom1_idx and/or atom2_idx is not in the range [0, getNumAtoms() - 1].

Implemented in CDPL::Chem::BasicMolecule.

◆ removeBond() [1/2]

virtual void CDPL::Chem::Molecule::removeBond ( std::size_t  idx)
pure virtual

Removes the bond at the specified index.

Parameters
idxThe zero-based index of the bond to remove.
Exceptions
Base::IndexErrorif the number of bonds is zero or idx is not in the range [0, getNumBonds() - 1].

Implemented in CDPL::Chem::BasicMolecule.

◆ removeBond() [2/2]

BondIterator CDPL::Chem::Molecule::removeBond ( const BondIterator it)

Removes the bond specified by the iterator it.

Parameters
itAn iterator that specifies the bond to remove.
Returns
A mutable iterator pointing to the next bond in the list.
Exceptions
Base::RangeErrorif the number of bonds is zero or it is not in the range [getBondsBegin(), getBondsEnd() - 1].

◆ containsAtom()

virtual bool CDPL::Chem::Molecule::containsAtom ( const Atom atom) const
pure virtual

Tells whether the specified atom is part of this molecule.

Parameters
atomThe atom to look for.
Returns
true if atom is part of the molecule, and false otherwise.

Implements CDPL::Chem::AtomContainer.

Implemented in CDPL::Chem::BasicMolecule.

◆ containsBond()

virtual bool CDPL::Chem::Molecule::containsBond ( const Bond bond) const
pure virtual

Tells whether the specified bond is part of this molecule.

Parameters
bondThe bond to look for.
Returns
true if bond is part of the molecule, and false otherwise.

Implements CDPL::Chem::BondContainer.

Implemented in CDPL::Chem::BasicMolecule.

◆ getAtomIndex()

virtual std::size_t CDPL::Chem::Molecule::getAtomIndex ( const Atom atom) const
pure virtual

Returns the index of the specified atom.

Parameters
atomThe atom for which to return the index.
Returns
The zero-based index of the specified atom.
Exceptions
Base::ItemNotFoundif the specified atom is not part of the molecule.

Implements CDPL::Chem::AtomContainer.

Implemented in CDPL::Chem::BasicMolecule.

◆ getBondIndex()

virtual std::size_t CDPL::Chem::Molecule::getBondIndex ( const Bond bond) const
pure virtual

Returns the index of the specified bond.

Parameters
bondThe bond for which to return the index.
Returns
The zero-based index of the specified bond.
Exceptions
Base::ItemNotFoundif the specified bond is not part of the molecule.

Implements CDPL::Chem::BondContainer.

Implemented in CDPL::Chem::BasicMolecule.

◆ copy() [1/2]

virtual void CDPL::Chem::Molecule::copy ( const Molecule mol)
pure virtual

Replaces the current set of atoms, bonds and properties by a copy of the atoms, bonds and properties of the molecule mol.

Parameters
molThe molecule to copy.

Implemented in CDPL::Chem::BasicMolecule.

◆ copy() [2/2]

virtual void CDPL::Chem::Molecule::copy ( const MolecularGraph molgraph)
pure virtual

Replaces the current set of atoms, bonds and properties by a copy of the atoms, bonds and properties of the molecular graph molgraph.

Parameters
molgraphThe Chem::MolecularGraph instance providing the atoms, bonds and properties to copy.

Implemented in CDPL::Chem::BasicMolecule.

◆ append() [1/2]

virtual void CDPL::Chem::Molecule::append ( const Molecule mol)
pure virtual

Extends the current set of atoms and bonds by a copy of the atoms and bonds in the molecule mol.

Parameters
molThe molecule providing the atoms and bonds to append.
Note
Does not affect any properties.

Implemented in CDPL::Chem::BasicMolecule.

◆ append() [2/2]

virtual void CDPL::Chem::Molecule::append ( const MolecularGraph molgraph)
pure virtual

Extends the current set of atoms and bonds by a copy of the atoms and bonds in the molecular graph molgraph.

Parameters
molgraphThe Chem::MolecularGraph instance providing the atoms and bonds to append.
Note
Does not affect any properties.

Implemented in CDPL::Chem::BasicMolecule.

◆ remove()

virtual void CDPL::Chem::Molecule::remove ( const MolecularGraph molgraph)
pure virtual

Removes atoms and bonds referenced by the molecular graph molgraph that are part of this Molecule instance.

Parameters
molgraphThe Chem::MolecularGraph instance specifying the atoms and bonds to remove.
Note
Does not affect any properties if this != &molgraph.

Implemented in CDPL::Chem::BasicMolecule.

◆ reserveMemoryForAtoms()

virtual void CDPL::Chem::Molecule::reserveMemoryForAtoms ( std::size_t  num_atoms)
inlinevirtual

Reserves memory for num_atoms atoms.

Allows implementors to speed up the creation of molecules with a known large number of atoms.

Parameters
num_atomsThe expected number of atoms for which memory shall be allocated in advance.

Reimplemented in CDPL::Chem::BasicMolecule.

◆ reserveMemoryForBonds()

virtual void CDPL::Chem::Molecule::reserveMemoryForBonds ( std::size_t  num_bonds)
inlinevirtual

Reserves memory for num_bonds bonds.

Allows implementors to speed up the creation of molecules with a known large number of bonds.

Parameters
num_bondsThe expected number of bonds for which memory shall be allocated in advance.

Reimplemented in CDPL::Chem::BasicMolecule.

◆ operator=() [1/2]

Molecule& CDPL::Chem::Molecule::operator= ( const Molecule mol)

Replaces the current set of atoms, bonds and properties by a copy of the atoms, bonds and properties of the molecule mol.

Internally calls copy() to perform the actual work.

Parameters
molThe molecule to copy.
Returns
A reference to itself.

◆ operator=() [2/2]

Molecule& CDPL::Chem::Molecule::operator= ( const MolecularGraph molgraph)

Replaces the current set of atoms, bonds and properties by a copy of the atoms, bonds and properties of the molecular graph molgraph.

Internally calls copy() to perform the actual work.

Parameters
molgraphThe Chem::MolecularGraph instance providing the atoms and bonds to copy.
Returns
A reference to itself.

◆ operator+=() [1/2]

Molecule& CDPL::Chem::Molecule::operator+= ( const Molecule mol)

Extends the current set of atoms and bonds by a copy of the atoms and bonds in the molecule mol.

Internally calls append() to perform the actual work.

Parameters
molThe molecule providing the atoms and bonds to append.
Returns
A reference to itself.

◆ operator+=() [2/2]

Molecule& CDPL::Chem::Molecule::operator+= ( const MolecularGraph molgraph)

Extends the current set of atoms and bonds by a copy of the atoms and bonds in the molecular graph molgraph.

Internally calls append() to perform the actual work.

Parameters
molgraphThe Chem::MolecularGraph instance providing the atoms and bonds to append.
Returns
A reference to itself.

◆ operator-=()

Molecule& CDPL::Chem::Molecule::operator-= ( const MolecularGraph molgraph)

Removes atoms and bonds referenced by the molecular graph molgraph that are part of this Molecule instance.

Internally calls remove() to perform the actual work.

Parameters
molgraphThe Chem::MolecularGraph instance specifying the atoms and bonds to remove.
Returns
A reference to itself.

◆ registerCopyPostprocessingFunction()

static void CDPL::Chem::Molecule::registerCopyPostprocessingFunction ( const CopyPostprocessingFunction func)
static

◆ invokeCopyPostprocessingFunctions()

void CDPL::Chem::Molecule::invokeCopyPostprocessingFunctions ( const MolecularGraph src_molgraph)
protected

◆ getAtomsBegin() [1/2]

ConstAtomIterator CDPL::Chem::AtomContainer::getAtomsBegin

Returns a constant iterator pointing to the beginning of the stored const Chem::Atom objects.

Returns
A constant iterator pointing to the beginning of the stored const Chem::Atom objects.

◆ getAtomsBegin() [2/2]

AtomIterator CDPL::Chem::AtomContainer::getAtomsBegin

Returns a mutable iterator pointing to the beginning of the stored Chem::Atom objects.

Returns
A mutable iterator pointing to the beginning of the stored Chem::Atom objects.

◆ getAtomsEnd() [1/2]

ConstAtomIterator CDPL::Chem::AtomContainer::getAtomsEnd

Returns a constant iterator pointing to the end of the stored const Chem::Atom objects.

Returns
A constant iterator pointing to the end of the stored const Chem::Atom objects.

◆ getAtomsEnd() [2/2]

AtomIterator CDPL::Chem::AtomContainer::getAtomsEnd

Returns a mutable iterator pointing to the end of the stored Chem::Atom objects.

Returns
A mutable iterator pointing to the end of the stored Chem::Atom objects.

◆ getBondsBegin() [1/2]

ConstBondIterator CDPL::Chem::BondContainer::getBondsBegin

Returns a constant iterator pointing to the beginning of the stored const Chem::Bond objects.

Returns
A constant iterator pointing to the beginning of the stored const Chem::Bond objects.

◆ getBondsBegin() [2/2]

BondIterator CDPL::Chem::BondContainer::getBondsBegin

Returns a mutable iterator pointing to the beginning of the stored Chem::Bond objects.

Returns
A mutable iterator pointing to the beginning of the stored Chem::Bond objects.

◆ getBondsEnd() [1/2]

ConstBondIterator CDPL::Chem::BondContainer::getBondsEnd

Returns a constant iterator pointing to the end of the stored const Chem::Bond objects.

Returns
A constant iterator pointing to the end of the stored const Chem::Bond objects.

◆ getBondsEnd() [2/2]

BondIterator CDPL::Chem::BondContainer::getBondsEnd

Returns a mutable iterator pointing to the end of the stored Chem::Bond objects.

Returns
A mutable iterator pointing to the end of the stored Chem::Bond objects.

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