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

A 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 stored Chem::Atom objects. More...
 
virtual const AtomgetAtom (std::size_t idx) const =0
 Returns a const reference to the Chem::Atom instance 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 Chem::Atom instance is stored in this container. More...
 
virtual std::size_t getAtomIndex (const Atom &atom) const =0
 Returns the index of the specified Chem::Atom instance in this container. 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...
 

Protected Member Functions

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...
 

Detailed Description

A 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 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].

Implemented in CDPL::Chem::Molecule, 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 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].

Implemented in CDPL::Chem::Molecule, 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 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.

Implemented in CDPL::ConfGen::CanonicalFragment, CDPL::Chem::Molecule, 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 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.

Implemented in CDPL::ConfGen::CanonicalFragment, CDPL::Chem::Molecule, 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.

Returns
The number of stored Chem::Entity3D objects.

Implements CDPL::Chem::Entity3DContainer.

Reimplemented in CDPL::ConfGen::CanonicalFragment.

◆ getEntity() [1/2]

virtual const Entity3D& CDPL::Chem::AtomContainer::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].

Implements CDPL::Chem::Entity3DContainer.

Reimplemented in CDPL::ConfGen::CanonicalFragment.

◆ getEntity() [2/2]

virtual Entity3D& CDPL::Chem::AtomContainer::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].

Implements CDPL::Chem::Entity3DContainer.

Reimplemented in CDPL::ConfGen::CanonicalFragment.

◆ orderAtoms()

virtual void CDPL::Chem::AtomContainer::orderAtoms ( const AtomCompareFunction func)
pure 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.

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

Assignment operator.

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

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