29 #ifndef CDPL_CHEM_BONDCONTAINER_HPP
30 #define CDPL_CHEM_BONDCONTAINER_HPP
56 class ConstBondAccessor;
198 ConstBondAccessor(
const BondAccessor& accessor):
199 container(accessor.container) {}
204 const Bond& operator()(std::size_t idx)
const
206 return container->getBond(idx);
209 bool operator==(
const ConstBondAccessor& accessor)
const
211 return (container == accessor.container);
214 ConstBondAccessor& operator=(
const BondAccessor& accessor)
216 container = accessor.container;
221 const BondContainer* container;
227 friend class ConstBondAccessor;
230 BondAccessor(BondContainer* cntnr):
233 Bond& operator()(std::size_t idx)
const
235 return container->getBond(idx);
238 bool operator==(
const BondAccessor& accessor)
const
240 return (container == accessor.container);
244 BondContainer* container;
Type definition of a generic wrapper class for storing user-defined Chem::Bond compare functions.
Definition of the preprocessor macro CDPL_CHEM_API.
#define CDPL_CHEM_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
Definition of class CDPL::Util::IndexedElementIterator.
Common interface for data structures that support a random access to stored Chem::Bond instances.
Definition: BondContainer.hpp:54
Util::IndexedElementIterator< Bond, BondAccessor > BondIterator
A mutable random access iterator used to iterate over the stored Chem::Bond objects.
Definition: BondContainer.hpp:68
virtual std::size_t getNumBonds() const =0
Returns the number of bonds.
BondIterator begin()
Returns a mutable iterator pointing to the beginning of the stored Chem::Bond objects.
virtual bool containsBond(const Bond &bond) const =0
Tells whether the specified bond is part of the bond sequence.
ConstBondIterator end() const
Returns a constant iterator pointing to the end of the stored const Chem::Bond objects.
BondIterator getBondsEnd()
Returns a mutable iterator pointing to the end of the stored Chem::Bond objects.
const BondContainer & getBonds() const
Returns a const reference to itself.
Definition: BondContainer.hpp:165
virtual Bond & getBond(std::size_t idx)=0
Returns a non-const reference to the bond at index idx.
BondContainer & operator=(const BondContainer &cntnr)
Replaces the current set of properties by a copy of the properties of the container cntnr.
ConstBondIterator getBondsEnd() const
Returns a constant iterator pointing to the end of the stored const Chem::Bond objects.
BondIterator end()
Returns a mutable iterator pointing to the end of the stored Chem::Bond objects.
ConstBondIterator getBondsBegin() const
Returns a constant iterator pointing to the beginning of the stored const Chem::Bond objects.
virtual ~BondContainer()
Virtual destructor.
Definition: BondContainer.hpp:183
virtual const Bond & getBond(std::size_t idx) const =0
Returns a const reference to the bond at index idx.
virtual void orderBonds(const BondCompareFunction &func)=0
Orders the bonds according to criteria implemented by the provided bond comparison function.
ConstBondIterator begin() const
Returns a constant iterator pointing to the beginning of the stored const Chem::Bond objects.
virtual std::size_t getBondIndex(const Bond &bond) const =0
Returns the index of the specified bond.
Util::IndexedElementIterator< const Bond, ConstBondAccessor > ConstBondIterator
A constant random access iterator used to iterate over the stored const Chem::Bond objects.
Definition: BondContainer.hpp:57
BondContainer & getBonds()
Returns a reference to itself.
Definition: BondContainer.hpp:174
BondIterator getBondsBegin()
Returns a mutable iterator pointing to the beginning of the stored Chem::Bond objects.
Abstract base class representing a chemical bond between two atoms (represented by Chem::Atom instanc...
Definition: Bond.hpp:54
STL compatible random access iterator for container elements accessible by index.
Definition: IndexedElementIterator.hpp:125
std::function< bool(const Chem::Bond &, const Chem::Bond &)> BondCompareFunction
Generic wrapper class used to store a user-defined bond compare function.
Definition: BondCompareFunction.hpp:41
GridEquality< E1, E2 >::ResultType operator==(const GridExpression< E1 > &e1, const GridExpression< E2 > &e2)
Tells whether the grid expressions e1 and e2 are element-wise equal.
Definition: GridExpression.hpp:677
The namespace of the Chemical Data Processing Library.