29 #ifndef CDPL_CHEM_ATOMCONTAINER_HPP
30 #define CDPL_CHEM_ATOMCONTAINER_HPP
57 class ConstAtomAccessor;
230 ConstAtomAccessor(
const AtomAccessor& accessor):
231 container(accessor.container) {}
236 const Atom& operator()(std::size_t idx)
const
238 return container->getAtom(idx);
241 bool operator==(
const ConstAtomAccessor& accessor)
const
243 return (container == accessor.container);
246 ConstAtomAccessor& operator=(
const AtomAccessor& accessor)
248 container = accessor.container;
253 const AtomContainer* container;
259 friend class ConstAtomAccessor;
262 AtomAccessor(AtomContainer* cntnr):
265 Atom& operator()(std::size_t idx)
const
267 return container->getAtom(idx);
270 bool operator==(
const AtomAccessor& accessor)
const
272 return (container == accessor.container);
276 AtomContainer* container;
Type declaration of a generic wrapper class for storing user-defined Chem::Atom 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::Chem::Entity3DContainer.
Definition of class CDPL::Util::IndexedElementIterator.
Common interface for data structures that support a random access to stored Chem::Atom instances.
Definition: AtomContainer.hpp:55
virtual void orderAtoms(const AtomCompareFunction &func)=0
Orders the atoms according to criteria implemented by the provided atom comparison function.
virtual std::size_t getNumAtoms() const =0
Returns the number of atoms.
const AtomContainer & getAtoms() const
Returns a const reference to itself.
Definition: AtomContainer.hpp:197
ConstAtomIterator end() const
Returns a constant iterator pointing to the end of the stored const Chem::Atom objects.
virtual Atom & getAtom(std::size_t idx)=0
Returns a non-const reference to the atom at index idx.
virtual std::size_t getAtomIndex(const Atom &atom) const =0
Returns the index of the specified atom.
Util::IndexedElementIterator< Atom, AtomAccessor > AtomIterator
A mutable random access iterator used to iterate over the stored Chem::Atom objects.
Definition: AtomContainer.hpp:69
virtual const Atom & getAtom(std::size_t idx) const =0
Returns a const reference to the atom at index idx.
virtual bool containsAtom(const Atom &atom) const =0
Tells whether the specified atom is part of the atom sequence.
AtomContainer & getAtoms()
Returns a reference to itself.
Definition: AtomContainer.hpp:206
AtomIterator getAtomsEnd()
Returns a mutable iterator pointing to the end of the stored Chem::Atom objects.
Util::IndexedElementIterator< const Atom, ConstAtomAccessor > ConstAtomIterator
A constant random access iterator used to iterate over the stored const Chem::Atom objects.
Definition: AtomContainer.hpp:58
virtual Chem::Entity3D & getEntity(std::size_t idx)
Returns a non-const reference to the entity at index idx.
virtual const Chem::Entity3D & getEntity(std::size_t idx) const
Returns a const reference to the entity at index idx.
virtual ~AtomContainer()
Virtual destructor.
Definition: AtomContainer.hpp:215
AtomIterator begin()
Returns a mutable iterator pointing to the beginning of the stored Chem::Atom objects.
AtomIterator getAtomsBegin()
Returns a mutable iterator pointing to the beginning of the stored Chem::Atom objects.
AtomContainer & operator=(const AtomContainer &cntnr)
Replaces the current set of properties by a copy of the properties of the container cntnr.
ConstAtomIterator begin() const
Returns a constant iterator pointing to the beginning of the stored const Chem::Atom objects.
AtomIterator end()
Returns a mutable iterator pointing to the end of the stored Chem::Atom objects.
virtual std::size_t getNumEntities() const
Returns the number of stored Chem::Entity3D objects.
ConstAtomIterator getAtomsBegin() const
Returns a constant iterator pointing to the beginning of the stored const Chem::Atom objects.
ConstAtomIterator getAtomsEnd() const
Returns a constant iterator pointing to the end of the stored const Chem::Atom objects.
Abstract base class representing a chemical atom and its bonded neighborhood.
Definition: Atom.hpp:58
Common interface for data structures that support a random access to stored Chem::Entity3D instances.
Definition: Entity3DContainer.hpp:53
Base class for objects that have a position in 3D space (e.g. Chem::Atom and Chem::Feature).
Definition: Entity3D.hpp:46
STL compatible random access iterator for container elements accessible by index.
Definition: IndexedElementIterator.hpp:125
std::function< bool(const Atom &, const Atom &)> AtomCompareFunction
Generic wrapper class used to store a user-defined atom compare function.
Definition: AtomCompareFunction.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.