Public iterator class that iterates over a particle container and additional vectors (which are typically stored in the logic handler). More...
#include <ContainerIterator.h>
Public Types | |
using | ParticleType = std::conditional_t< modifiable, Particle_T, const Particle_T > |
Type of the particle this iterator points to. | |
using | ParticleVecType = std::conditional_t< modifiable, std::vector< std::vector< Particle_T > * >, std::vector< std::vector< Particle_T > const * > > |
Type of the additional vector collection. | |
using | ContainerType = std::conditional_t< modifiable, ParticleContainerInterface< Particle_T >, const ParticleContainerInterface< Particle_T > > |
Type of the Particle Container type. | |
Public Member Functions | |
ContainerIterator () | |
Default constructor that guarantees an invalid iterator. | |
ContainerIterator (ContainerType &container, IteratorBehavior behavior, ParticleVecType *additionalVectorsToIterate, const std::array< double, 3 > ®ionMin, const std::array< double, 3 > ®ionMax) | |
Region Iterator constructor meant to be called from the logic handler. | |
ContainerIterator (ContainerType &container, IteratorBehavior behavior, ParticleVecType *additionalVectorsToIterate) | |
Regular Iterator constructor meant to be called from the logic handler. | |
ContainerIterator (const ContainerIterator< Particle_T, modifiable, regionIter > &other) | |
Copy constructor. | |
ContainerIterator< Particle_T, modifiable, regionIter > & | operator= (const ContainerIterator< Particle_T, modifiable, regionIter > &other) |
Copy assignment operator. | |
ContainerIterator (ContainerIterator< Particle_T, modifiable, regionIter > &&other) noexcept | |
Move constructor. | |
ContainerIterator< Particle_T, modifiable, regionIter > & | operator= (ContainerIterator< Particle_T, modifiable, regionIter > &&other) noexcept |
Move assignment operator. | |
ContainerIterator< Particle_T, modifiable, regionIter > & | operator++ () |
Increments the iterator. | |
ParticleType & | operator* () const |
Dereference operator. | |
ParticleType * | operator-> () const |
Dereference operator. | |
bool | isValid () const |
Check whether the iterator currently points to a valid particle. | |
bool | operator== (const bool input) const |
Checks if the current iterator has a given validity. | |
bool | operator!= (const bool input) const |
Checks if the current iterator does not have a given validity. | |
Friends | |
template<class T > | |
void | internal::deleteParticle (T &) |
Public iterator class that iterates over a particle container and additional vectors (which are typically stored in the logic handler).
It supports parallelism over cells by being instantiated in a parallel region and particle deletion while iterating. Inserting particles might invalidate the iterator. There are no guarantees about the order in which particles are iterated.
Particle_T | |
modifiable | If false, this is a const iterator. |
regionIter | If false, avoid any region checks and iterate the whole container. |
using autopas::ContainerIterator< Particle_T, modifiable, regionIter >::ContainerType = std::conditional_t<modifiable, ParticleContainerInterface<Particle_T>, const ParticleContainerInterface<Particle_T> > |
Type of the Particle Container type.
Switch for const iterators.
using autopas::ContainerIterator< Particle_T, modifiable, regionIter >::ParticleType = std::conditional_t<modifiable, Particle_T, const Particle_T> |
Type of the particle this iterator points to.
Switch for const iterators.
using autopas::ContainerIterator< Particle_T, modifiable, regionIter >::ParticleVecType = std::conditional_t<modifiable, std::vector<std::vector<Particle_T> *>, std::vector<std::vector<Particle_T> const *> > |
Type of the additional vector collection.
Switch for const iterators.
|
inline |
Region Iterator constructor meant to be called from the logic handler.
container | Reference to the particle container to iterate. |
behavior | The IteratorBehavior that specifies which type of cells shall be iterated over. |
additionalVectorsToIterate | Thread buffers of additional Particle vector to iterate over. |
regionMin | Left Front Lower corner of the iterator's region. |
regionMax | Right Back Upper corner of the iterator's region. |
|
inline |
Regular Iterator constructor meant to be called from the logic handler.
container | Reference to the particle container to iterate. |
behavior | The IteratorBehavior that specifies which type of cells shall be iterated over. |
additionalVectorsToIterate | Thread buffers of additional Particle vector to iterate over. |
|
inline |
Copy constructor.
other |
|
inlinenoexcept |
Move constructor.
other |
|
inline |
Check whether the iterator currently points to a valid particle.
|
inline |
Checks if the current iterator does not have a given validity.
input |
|
inline |
Dereference operator.
|
inline |
Increments the iterator.
The idea is that this operator either queries the container with the current indices, or, if there is nothing left in the container, it handles the iteration through the additional vectors.
|
inline |
Dereference operator.
|
inline |
Copy assignment operator.
other |
|
inlinenoexcept |
Move assignment operator.
other |
|
inline |
Checks if the current iterator has a given validity.
input |