29 #ifndef CDPL_CHEM_ATOMCONTAINER_HPP
30 #define CDPL_CHEM_ATOMCONTAINER_HPP
57 class ConstAtomAccessor;
204 ConstAtomAccessor(
const AtomAccessor& accessor):
205 container(accessor.container) {}
210 const Atom& operator()(std::size_t idx)
const
212 return container->getAtom(idx);
215 bool operator==(
const ConstAtomAccessor& accessor)
const
217 return (container == accessor.container);
220 ConstAtomAccessor& operator=(
const AtomAccessor& accessor)
222 container = accessor.container;
227 const AtomContainer* container;
233 friend class ConstAtomAccessor;
236 AtomAccessor(AtomContainer* cntnr):
239 Atom& operator()(std::size_t idx)
const
241 return container->getAtom(idx);
244 bool operator==(
const AtomAccessor& accessor)
const
246 return (container == accessor.container);
250 AtomContainer* container;
Type definition 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 the class CDPL::Chem::Entity3DContainer.
Definition of the class CDPL::Util::IndexedElementIterator.
A 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 stored atoms according to criteria implemented by the provided atom comparison function.
virtual std::size_t getNumAtoms() const =0
Returns the number of stored Chem::Atom objects.
const AtomContainer & getAtoms() const
Returns a const reference to itself.
Definition: AtomContainer.hpp:172
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 Chem::Atom instance in this container.
virtual const Entity3D & getEntity(std::size_t idx) const
Returns a const reference to the Chem::Entity3D instance at index idx.
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 Chem::Atom instance at index idx.
virtual bool containsAtom(const Atom &atom) const =0
Tells whether the specified Chem::Atom instance is stored in this container.
AtomContainer & getAtoms()
Returns a reference to itself.
Definition: AtomContainer.hpp:181
virtual Entity3D & getEntity(std::size_t idx)
Returns a non-const reference to the entity at index idx.
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 ~AtomContainer()
Virtual destructor.
Definition: AtomContainer.hpp:190
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)
Assignment operator.
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.
Atom.
Definition: Atom.hpp:52
A common interface for data-structures that support a random access to stored Chem::Entity3D instance...
Definition: Entity3DContainer.hpp:53
Entity3D.
Definition: Entity3D.hpp:46
A STL compatible random access iterator for container elements accessible by index.
Definition: IndexedElementIterator.hpp:125
std::function< bool(const Chem::Atom &, const Chem::Atom &)> AtomCompareFunction
A 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)
Definition: GridExpression.hpp:339
The namespace of the Chemical Data Processing Library.