|
Chemical Data Processing Library C++ API - Version 1.1.1
|
Go to the documentation of this file.
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;
256 #endif // CDPL_CHEM_ATOMCONTAINER_HPP
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
Definition of the preprocessor macro CDPL_CHEM_API.
Definition of the class CDPL::Util::IndexedElementIterator.
#define CDPL_CHEM_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
GridEquality< E1, E2 >::ResultType operator==(const GridExpression< E1 > &e1, const GridExpression< E2 > &e2)
Definition: GridExpression.hpp:339
ConstAtomIterator begin() const
Returns a constant iterator pointing to the beginning of the stored const Chem::Atom objects.
virtual std::size_t getNumEntities() const
Returns the number of stored Chem::Entity3D objects.
Type definition of a generic wrapper class for storing user-defined Chem::Atom compare functions.
AtomIterator end()
Returns a mutable iterator pointing to the end of the stored Chem::Atom objects.
const AtomContainer & getAtoms() const
Returns a const reference to itself.
Definition: AtomContainer.hpp:172
A STL compatible random access iterator for container elements accessible by index.
Definition: IndexedElementIterator.hpp:125
Atom.
Definition: Atom.hpp:52
virtual std::size_t getNumAtoms() const =0
Returns the number of stored Chem::Atom objects.
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 Entity3D & getEntity(std::size_t idx) const
Returns a const reference to the Chem::Entity3D instance at index idx.
virtual Entity3D & getEntity(std::size_t idx)
Returns a non-const reference to the entity at index idx.
A common interface for data-structures that support a random access to stored Chem::Entity3D instance...
Definition: Entity3DContainer.hpp:53
virtual Atom & getAtom(std::size_t idx)=0
Returns a non-const reference to the atom at index idx.
AtomIterator begin()
Returns a mutable iterator pointing to the beginning of the stored Chem::Atom objects.
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.
Definition of the class CDPL::Chem::Entity3DContainer.
virtual const Atom & getAtom(std::size_t idx) const =0
Returns a const reference to the Chem::Atom instance at index idx.
virtual ~AtomContainer()
Virtual destructor.
Definition: AtomContainer.hpp:190
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 std::size_t getAtomIndex(const Atom &atom) const =0
Returns the index of the specified Chem::Atom instance in this container.
The namespace of the Chemical Data Processing Library.
virtual bool containsAtom(const Atom &atom) const =0
Tells whether the specified Chem::Atom instance is stored in this container.
ConstAtomIterator end() const
Returns a constant iterator pointing to the end of the stored const Chem::Atom objects.
Entity3D.
Definition: Entity3D.hpp:46
AtomContainer & operator=(const AtomContainer &cntnr)
Assignment operator.
AtomContainer & getAtoms()
Returns a reference to itself.
Definition: AtomContainer.hpp:181