Chemical Data Processing Library C++ API - Version 1.2.0
|
A common interface for data-structures that support a random access to stored Chem::Bond instances. More...
#include <BondContainer.hpp>
Public Types | |
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 Member Functions | |
virtual std::size_t | getNumBonds () const =0 |
Returns the number of stored Chem::Bond objects. More... | |
virtual const Bond & | getBond (std::size_t idx) const =0 |
Returns a const reference to the Chem::Bond instance at index idx. More... | |
virtual Bond & | getBond (std::size_t idx)=0 |
Returns a non-const reference to the bond at index idx. More... | |
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 bool | containsBond (const Bond &bond) const =0 |
Tells whether the specified Chem::Bond instance is stored in this container. More... | |
virtual std::size_t | getBondIndex (const Bond &bond) const =0 |
Returns the index of the specified Chem::Bond instance in this container. More... | |
virtual void | orderBonds (const BondCompareFunction &func)=0 |
Orders the stored bonds according to criteria implemented by the provided bond comparison function. More... | |
const BondContainer & | getBonds () const |
Returns a const reference to itself. More... | |
BondContainer & | getBonds () |
Returns a reference to itself. More... | |
Protected Member Functions | |
virtual | ~BondContainer () |
Virtual destructor. More... | |
BondContainer & | operator= (const BondContainer &cntnr) |
Assignment operator. More... | |
A common interface for data-structures that support a random access to stored Chem::Bond instances.
Implementations have to guarantee that a given Chem::Bond object is stored only once and its index is unique amongst all contained Chem::Bond instances. Otherwise algorithms that rely on this behaviour may not work correctly!
typedef Util::IndexedElementIterator<const Bond, ConstBondAccessor> CDPL::Chem::BondContainer::ConstBondIterator |
A constant random access iterator used to iterate over the stored const
Chem::Bond objects.
typedef Util::IndexedElementIterator<Bond, BondAccessor> CDPL::Chem::BondContainer::BondIterator |
A mutable random access iterator used to iterate over the stored Chem::Bond objects.
|
inlineprotectedvirtual |
Virtual destructor.
|
pure virtual |
Returns the number of stored Chem::Bond objects.
Implemented in CDPL::Chem::Molecule, CDPL::Chem::Atom, CDPL::ConfGen::CanonicalFragment, CDPL::Chem::Fragment, CDPL::Chem::BasicMolecule, and CDPL::Chem::BasicAtom.
|
pure virtual |
Returns a const
reference to the Chem::Bond instance at index idx.
idx | The zero-based index of the Chem::Bond instance to return. |
const
reference to the Chem::Bond instance at the specified index. Base::IndexError | if the container is empty or idx is not in the range [0, getNumBonds() - 1]. |
Implemented in CDPL::Chem::Molecule, CDPL::Chem::Atom, CDPL::ConfGen::CanonicalFragment, CDPL::Chem::Fragment, CDPL::Chem::BasicMolecule, and CDPL::Chem::BasicAtom.
|
pure virtual |
Returns a non-const
reference to the bond at index idx.
idx | The zero-based index of the Chem::Bond instance to return. |
const
reference to the bond at the specified index. Base::IndexError | if the number of bonds is zero or idx is not in the range [0, getNumBonds() - 1]. |
Implemented in CDPL::Chem::Molecule, CDPL::Chem::Atom, CDPL::ConfGen::CanonicalFragment, CDPL::Chem::Fragment, CDPL::Chem::BasicMolecule, and CDPL::Chem::BasicAtom.
ConstBondIterator CDPL::Chem::BondContainer::getBondsBegin | ( | ) | const |
Returns a constant iterator pointing to the beginning of the stored const
Chem::Bond objects.
const
Chem::Bond objects. ConstBondIterator CDPL::Chem::BondContainer::getBondsEnd | ( | ) | const |
Returns a constant iterator pointing to the end of the stored const
Chem::Bond objects.
const
Chem::Bond objects. BondIterator CDPL::Chem::BondContainer::getBondsBegin | ( | ) |
Returns a mutable iterator pointing to the beginning of the stored Chem::Bond objects.
BondIterator CDPL::Chem::BondContainer::getBondsEnd | ( | ) |
Returns a mutable iterator pointing to the end of the stored Chem::Bond objects.
ConstBondIterator CDPL::Chem::BondContainer::begin | ( | ) | const |
Returns a constant iterator pointing to the beginning of the stored const
Chem::Bond objects.
const
Chem::Bond objects. ConstBondIterator CDPL::Chem::BondContainer::end | ( | ) | const |
Returns a constant iterator pointing to the end of the stored const
Chem::Bond objects.
const
Chem::Bond objects. BondIterator CDPL::Chem::BondContainer::begin | ( | ) |
Returns a mutable iterator pointing to the beginning of the stored Chem::Bond objects.
BondIterator CDPL::Chem::BondContainer::end | ( | ) |
Returns a mutable iterator pointing to the end of the stored Chem::Bond objects.
Tells whether the specified Chem::Bond instance is stored in this container.
bond | The Chem::Bond instance to look for. |
true
if bond is stored in the container, and false
otherwise. Implemented in CDPL::ConfGen::CanonicalFragment, CDPL::Chem::Molecule, CDPL::Chem::Atom, CDPL::Chem::Fragment, CDPL::Chem::BasicMolecule, and CDPL::Chem::BasicAtom.
|
pure virtual |
Returns the index of the specified Chem::Bond instance in this container.
bond | The Chem::Bond instance for which to return the index. |
Base::ItemNotFound | if the specified Chem::Bond instance could not be found. |
Implemented in CDPL::ConfGen::CanonicalFragment, CDPL::Chem::Molecule, CDPL::Chem::Atom, CDPL::Chem::Fragment, CDPL::Chem::BasicMolecule, and CDPL::Chem::BasicAtom.
|
pure virtual |
Orders the stored bonds according to criteria implemented by the provided bond comparison function.
func | The bond comparison function implementing the applied ordering criteria. |
Implemented in CDPL::ConfGen::CanonicalFragment, CDPL::Chem::Fragment, CDPL::Chem::BasicMolecule, and CDPL::Chem::BasicAtom.
|
inline |
Returns a const
reference to itself.
const
reference to itself.
|
inline |
Returns a reference to itself.
|
protected |
Assignment operator.
cntnr | The other container to copy. |