Simpatico
v1.10
|
Forward iterator for a PArray.
An ConstPArrayIterator is an abstraction of a pointer, similar to an STL forward iterator. The * operator returns a reference to an associated Data object, the -> operator returns a pointer to that object. The ++ operator increments the current pointer by one array element.
Unlike an STL forward iterator, an ConstPArrayIterator contains the address of the end of the array. The isEnd() method can be used to test for termination of a for or while loop. When isEnd() is true, the iterator has no current value, and cannot be incremented further. The isEnd() method returns true either if the iterator: i) has already been incremented one past the end of an associated PArray, or ii) is in a null state that is produced by the constructor and the clear() method.
Definition at line 34 of file ConstPArrayIterator.h.
#include <ConstPArrayIterator.h>
Public Member Functions | |
ConstPArrayIterator () | |
Default constructor. More... | |
void | setCurrent (Data **ptr) |
Set the current pointer value. More... | |
void | setEnd (Data **ptr) |
Set the value of the end pointer. More... | |
void | setNull () |
Nullify the iterator. More... | |
bool | isEnd () const |
Is the current pointer at the end of the array. More... | |
bool | notEnd () const |
Is the current pointer not at the end of the array? More... | |
const Data * | get () const |
Return a pointer to const current data. More... | |
Operators | |
const Data & | operator* () const |
Return a const refererence to the current Data. More... | |
const Data * | operator-> () const |
Provide a pointer to the current Data object. More... | |
ConstPArrayIterator< Data > & | operator++ () |
Increment the current pointer. More... | |
|
inline |
Default constructor.
Constructs a null iterator.
Definition at line 44 of file ConstPArrayIterator.h.
|
inline |
Set the current pointer value.
ptr | Pointer to current element of array of Data* pointers. |
Definition at line 55 of file ConstPArrayIterator.h.
Referenced by Util::PArray< Data >::begin(), Util::FPArray< Data, Capacity >::begin(), and Util::SSet< Data, Capacity >::begin().
|
inline |
Set the value of the end pointer.
ptr | Pointer to one element past end of array of Data* pointers. |
Definition at line 66 of file ConstPArrayIterator.h.
Referenced by Util::PArray< Data >::begin(), Util::FPArray< Data, Capacity >::begin(), and Util::SSet< Data, Capacity >::begin().
|
inline |
Nullify the iterator.
Definition at line 72 of file ConstPArrayIterator.h.
Referenced by Util::PArray< Data >::begin().
|
inline |
Is the current pointer at the end of the array.
Definition at line 84 of file ConstPArrayIterator.h.
|
inline |
Is the current pointer not at the end of the array?
Definition at line 92 of file ConstPArrayIterator.h.
Referenced by McMd::BondPotentialImpl< Interaction >::addForces(), McMd::DihedralPotentialImpl< Interaction >::addForces(), McMd::AnglePotentialImpl< Interaction >::addForces(), DdMd::AtomMap::clearGhosts(), McMd::ExternalPotentialImpl< Interaction >::computeEnergy(), McMd::BondPotentialImpl< Interaction >::computeEnergy(), McMd::DihedralPotentialImpl< Interaction >::computeEnergy(), McMd::AnglePotentialImpl< Interaction >::computeEnergy(), McMd::ClusterIdentifier::isValid(), DdMd::AtomStorage::isValid(), McMd::MdSystem::kineticEnergy(), McMd::CompositionProfile::sample(), McMd::IntraBondStressAutoCorr< SystemType >::sample(), McMd::RDF::sample(), McMd::IntraBondTensorAutoCorr< SystemType >::sample(), McMd::StructureFactor::sample(), McMd::VanHove::sample(), McMd::StructureFactorP::sample(), McMd::IntraStructureFactor::sample(), DdMd::AtomDistributor::validate(), McMd::McMdConfigIo::write(), and McMd::SmpConfigIo::write().
|
inline |
Return a pointer to const current data.
Definition at line 100 of file ConstPArrayIterator.h.
Referenced by DdMd::AtomMap::clearGhosts(), McMd::ClusterIdentifier::isValid(), and DdMd::AtomStorage::isValid().
|
inline |
Return a const refererence to the current Data.
Definition at line 111 of file ConstPArrayIterator.h.
|
inline |
Provide a pointer to the current Data object.
Definition at line 119 of file ConstPArrayIterator.h.
|
inline |
Increment the current pointer.
Definition at line 127 of file ConstPArrayIterator.h.