#include <baseIterator.h>
Inheritance diagram for BaseIterator< Container, DataType, Position, Traits >:
Public Types | |
Typedefs. | |
The names of these typedefs deviate from the usual BALL class names due to restrictions imposed by STL compliance. | |
typedef DataType | value_type |
typedef Position | difference_type |
typedef const DataType * | pointer |
typedef const DataType & | reference |
typedef std::input_iterator_tag | iterator_category |
Public Member Functions | |
Constructors and Destructors | |
BaseIterator () throw () | |
Default constructor. | |
BaseIterator (const BaseIterator &iterator) throw () | |
Copy constructor. | |
~BaseIterator () throw () | |
Destructor. | |
Assignment | |
BaseIterator & | operator= (const BaseIterator &iterator) throw () |
Assignment operator. | |
void | swap (BaseIterator &iterator) throw () |
Swap two iterators. | |
Accessors | |
void | invalidate () throw () |
Invalidate the iterator. | |
void | setTraits (const Traits &traits) throw () |
Set the traits. | |
const Traits & | getTraits () const throw () |
Get a constant reference to the traits of this iterator. | |
Traits & | getTraits () throw () |
Get a constant reference to the traits of this iterator. | |
const Container * | getContainer () const throw () |
Get a constant pointer to the container of this iterator. | |
Converters | |
operator const Position & () const throw () | |
Convert an iterator to Position. | |
reference | operator * () const throw () |
Convert an iterator to its Datatype by returning a reference to the current data. | |
pointer | operator-> () const throw () |
Return a pointer to the current data. | |
Predicates | |
bool | operator== (const BaseIterator &iterator) const throw () |
Equality operator. | |
bool | operator!= (const BaseIterator &iterator) const throw () |
Inequality operator. | |
bool | isSingular () const throw () |
Singularity predicate. | |
bool | isValid () const throw () |
Validity predicate. | |
bool | operator+ () const throw () |
Validity predicate. | |
bool | operator- () const throw () |
Invalidity perdicate. | |
Protected Member Functions | |
BaseIterator (const Container &container) throw () | |
Constructor. |
This template class implements the basic behaviour of an iterator. Iterators are basically STL-like iterators. They provide the full STL iterator interface, but also offer additional features.
begin()
and end()
like in STL, but we introduced specialized methods like AtomContainer::beginAtom and AtomContainer::endAtom . For similar reasons, the iterators for kernel classes are not implemented as nested classes of the respective kernel classes, but as independent classes to avoid code replication. An exception is Atom::BondIterator , which is relevant to Atom alone. AtomIterator atom_it = system.beginAtom(); for (; +atom_it; ++atom_it) { .... }
|
Constructor. Protected to allow instantiation and use in derived classes only. |
|
Singularity predicate. This method returns true if the iterator is singular, i.e., not associated with a container. |
|
Validity predicate.
|
|
Convert an iterator to Position. This method returns the position of the iterator. Note that Position is a template within this context and not the BALL datatype. |
|
Assignment operator. Assigns the contents of an iterator to another iterator.
|