MolSim
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
CellContainer::SpecialParticleIterator Class Reference

A special iterator for iterating over the boundary and halo cell containers. More...

#include <CellContainer.h>

Public Member Functions

 SpecialParticleIterator (std::vector< std::reference_wrapper< Cell > >::iterator start, std::vector< std::reference_wrapper< Cell > >::iterator end)
 Construct a new special iterator.
 
Particleoperator* ()
 Overload of the dereference operator.
 
SpecialParticleIteratoroperator++ ()
 Overload of the preincrement operator.
 
bool operator!= (const SpecialParticleIterator &other) const
 Overload of the inequality operator.
 
bool operator== (const SpecialParticleIterator &other) const
 Overload of the equality operator.
 

Private Member Functions

void advance ()
 Helper function to move to the next Cell which contains at least one particle. Stops when no further cells can be searched.
 

Private Attributes

std::vector< std::reference_wrapper< Cell > >::iterator outerIt
 The outer iterator, iterating over each Cell pointer.
 
std::vector< std::reference_wrapper< Cell > >::iterator outerEnd
 The end of the outer iterator, iterating over each Cell pointer.
 
std::forward_list< std::reference_wrapper< Particle > >::iterator innerIt
 The inner iterator, iterating over each Particle pointer in a Cell.
 
std::forward_list< std::reference_wrapper< Particle > >::iterator innerEnd
 The end of the inner iterator, iterating over each Particle pointer in a Cell.
 

Detailed Description

A special iterator for iterating over the boundary and halo cell containers.

Constructor & Destructor Documentation

◆ SpecialParticleIterator()

CellContainer::SpecialParticleIterator::SpecialParticleIterator ( std::vector< std::reference_wrapper< Cell > >::iterator  start,
std::vector< std::reference_wrapper< Cell > >::iterator  end 
)

Construct a new special iterator.

Parameters
startThe beginning of the iterator. Automatically progresses to the first cell with at least one particle.
endThe end of the iterator (one past the final cell).

Member Function Documentation

◆ advance()

void CellContainer::SpecialParticleIterator::advance ( )
private

Helper function to move to the next Cell which contains at least one particle. Stops when no further cells can be searched.

◆ operator!=()

bool CellContainer::SpecialParticleIterator::operator!= ( const SpecialParticleIterator other) const

Overload of the inequality operator.

Parameters
otherThe SpecialParticleIterator to compare it to.
Returns
true if both iterators point to different objects.
false if both iterators point to the same object.

◆ operator*()

Particle & CellContainer::SpecialParticleIterator::operator* ( )

Overload of the dereference operator.

Gets a reference to the current Particle object.

Returns
A reference to the current Particle object.

◆ operator++()

SpecialParticleIterator & CellContainer::SpecialParticleIterator::operator++ ( )

Overload of the preincrement operator.

Either advances the inner iterator, or the outer iterator until a Cell with at least one Particle is found.

Returns
The iterator again, for reuse.

◆ operator==()

bool CellContainer::SpecialParticleIterator::operator== ( const SpecialParticleIterator other) const

Overload of the equality operator.

Parameters
otherThe SpecialParticleIterator to compare it to.
Returns
true if both iterators point to the same object.
false if both iterators point to different objects.

Member Data Documentation

◆ innerEnd

std::forward_list<std::reference_wrapper<Particle>>::iterator CellContainer::SpecialParticleIterator::innerEnd
private

The end of the inner iterator, iterating over each Particle pointer in a Cell.

◆ innerIt

std::forward_list<std::reference_wrapper<Particle>>::iterator CellContainer::SpecialParticleIterator::innerIt
private

The inner iterator, iterating over each Particle pointer in a Cell.

◆ outerEnd

std::vector<std::reference_wrapper<Cell>>::iterator CellContainer::SpecialParticleIterator::outerEnd
private

The end of the outer iterator, iterating over each Cell pointer.

◆ outerIt

std::vector<std::reference_wrapper<Cell>>::iterator CellContainer::SpecialParticleIterator::outerIt
private

The outer iterator, iterating over each Cell pointer.


The documentation for this class was generated from the following file: