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

Common interface for data structures that support a random access to stored Chem::Atom instances. More...

#include <AtomContainer.hpp>

+ Inheritance diagram for CDPL::Chem::AtomContainer:

Public Types

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 Member Functions

virtual std::size_t getNumAtoms () const =0
 Returns the number of atoms. 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...
 
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 bool containsAtom (const Atom &atom) const =0
 Tells whether the specified atom is part of the atom sequence. More...
 
virtual std::size_t getAtomIndex (const Atom &atom) const =0
 Returns the index of the specified atom. More...
 
virtual std::size_t getNumEntities () const
 Returns the number of stored Chem::Entity3D objects. More...
 
virtual const Chem::Entity3DgetEntity (std::size_t idx) const
 Returns a const reference to the entity at index idx. More...
 
virtual Chem::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 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...
 

Protected Member Functions

virtual ~AtomContainer ()
 Virtual destructor. More...
 
AtomContaineroperator= (const AtomContainer &cntnr)
 Replaces the current set of properties by a copy of the properties of the container cntnr. More...
 
- Protected Member Functions inherited from CDPL::Chem::Entity3DContainer
virtual ~Entity3DContainer ()
 Virtual destructor. More...
 
Entity3DContaineroperator= (const Entity3DContainer &cntnr)
 Assignment operator. More...
 

Detailed Description

Common interface for data structures that support a random access to stored Chem::Atom instances.

Implementations have to guarantee that a given Chem::Atom object is stored only once and its index is unique amongst all contained Chem::Atom instances. Otherwise algorithms that rely on this behaviour may not work correctly!

Member Typedef Documentation

◆ ConstAtomIterator

A constant random access iterator used to iterate over the stored const Chem::Atom objects.

◆ AtomIterator

A mutable random access iterator used to iterate over the stored Chem::Atom objects.

Constructor & Destructor Documentation

◆ ~AtomContainer()

virtual CDPL::Chem::AtomContainer::~AtomContainer ( )
inlineprotectedvirtual

Virtual destructor.

Member Function Documentation

◆ getNumAtoms()

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

◆ getAtom() [1/2]

virtual const Atom& CDPL::Chem::AtomContainer::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 idx is not in the range [0, getNumAtoms()).

Implemented in CDPL::Chem::Bond, CDPL::Chem::Atom, CDPL::ConfGen::CanonicalFragment, CDPL::Chem::Fragment, CDPL::Chem::ElectronSystem, CDPL::Chem::BasicMolecule, CDPL::Chem::BasicBond, and CDPL::Chem::BasicAtom.

◆ getAtom() [2/2]

virtual Atom& CDPL::Chem::AtomContainer::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 idx is not in the range [0, getNumAtoms()).

Implemented in CDPL::Chem::Bond, CDPL::Chem::Atom, CDPL::ConfGen::CanonicalFragment, CDPL::Chem::Fragment, CDPL::Chem::ElectronSystem, CDPL::Chem::BasicMolecule, CDPL::Chem::BasicBond, and CDPL::Chem::BasicAtom.

◆ getAtomsBegin() [1/2]

ConstAtomIterator CDPL::Chem::AtomContainer::getAtomsBegin ( ) const

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.

◆ getAtomsEnd() [1/2]

ConstAtomIterator CDPL::Chem::AtomContainer::getAtomsEnd ( ) const

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.

◆ 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() [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.

◆ begin() [1/2]

ConstAtomIterator CDPL::Chem::AtomContainer::begin ( ) const

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.

◆ end() [1/2]

ConstAtomIterator CDPL::Chem::AtomContainer::end ( ) const

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.

◆ begin() [2/2]

AtomIterator CDPL::Chem::AtomContainer::begin ( )

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.

◆ end() [2/2]

AtomIterator CDPL::Chem::AtomContainer::end ( )

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.

◆ containsAtom()

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

Tells whether the specified atom is part of the atom sequence.

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

Implemented in CDPL::ConfGen::CanonicalFragment, CDPL::Chem::Bond, CDPL::Chem::Atom, CDPL::Chem::Fragment, CDPL::Chem::ElectronSystem, CDPL::Chem::BasicMolecule, CDPL::Chem::BasicBond, and CDPL::Chem::BasicAtom.

◆ getAtomIndex()

virtual std::size_t CDPL::Chem::AtomContainer::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 could not be found.

Implemented in CDPL::ConfGen::CanonicalFragment, CDPL::Chem::Bond, CDPL::Chem::Atom, CDPL::Chem::Fragment, CDPL::Chem::ElectronSystem, CDPL::Chem::BasicMolecule, CDPL::Chem::BasicBond, and CDPL::Chem::BasicAtom.

◆ getNumEntities()

virtual std::size_t CDPL::Chem::AtomContainer::getNumEntities ( ) const
virtual

Returns the number of stored Chem::Entity3D objects.

Forwards to getNumAtoms() and exists to satisfy the Chem::Entity3DContainer interface.

Returns
The number of contained atoms.

Implements CDPL::Chem::Entity3DContainer.

Reimplemented in CDPL::ConfGen::CanonicalFragment.

◆ getEntity() [1/2]

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

Returns a const reference to the entity at index idx.

Forwards to getAtom() and exists to satisfy the Chem::Entity3DContainer interface.

Parameters
idxThe zero-based entity index.
Returns
A const reference to the entity at the specified index.
Exceptions
Base::IndexErrorif idx is not in the range [0, getNumAtoms()).

Implements CDPL::Chem::Entity3DContainer.

Reimplemented in CDPL::ConfGen::CanonicalFragment.

◆ getEntity() [2/2]

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

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

Forwards to getAtom() and exists to satisfy the Chem::Entity3DContainer interface.

Parameters
idxThe zero-based entity index.
Returns
A non-const reference to the entity at the specified index.
Exceptions
Base::IndexErrorif idx is not in the range [0, getNumAtoms()).

Implements CDPL::Chem::Entity3DContainer.

Reimplemented in CDPL::ConfGen::CanonicalFragment.

◆ orderAtoms()

virtual void CDPL::Chem::AtomContainer::orderAtoms ( const AtomCompareFunction func)
pure virtual

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

Parameters
funcThe atom comparison function implementing the applied ordering criteria.

Implemented in CDPL::ConfGen::CanonicalFragment, CDPL::Chem::Fragment, CDPL::Chem::ElectronSystem, CDPL::Chem::BasicMolecule, CDPL::Chem::BasicBond, and CDPL::Chem::BasicAtom.

◆ getAtoms() [1/2]

const AtomContainer& CDPL::Chem::AtomContainer::getAtoms ( ) const
inline

Returns a const reference to itself.

Returns
A const reference to itself.

◆ getAtoms() [2/2]

AtomContainer& CDPL::Chem::AtomContainer::getAtoms ( )
inline

Returns a reference to itself.

Returns
A reference to itself.

◆ operator=()

AtomContainer& CDPL::Chem::AtomContainer::operator= ( const AtomContainer cntnr)
protected

Replaces the current set of properties by a copy of the properties of the container cntnr.

Parameters
cntnrThe container to copy.
Returns
A reference to itself.

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