ASPECT
Public Member Functions | Private Attributes | List of all members
aspect::Particle::ParticleIterator< dim, spacedim > Class Template Reference

Inherits iterator< std::bidirectional_iterator_tag, ParticleAccessor< dim, spacedim > >.

Public Member Functions

 ParticleIterator ()
 
 ParticleIterator (const std::multimap< Particles::internal::LevelInd, Particle< dim, spacedim > > &map, const typename std::multimap< Particles::internal::LevelInd, Particle< dim, spacedim > >::iterator &particle)
 
const ParticleAccessor< dim, spacedim > & operator* () const
 
ParticleAccessor< dim, spacedim > & operator* ()
 
ParticleIteratoroperator= (const ParticleIterator &)
 
const ParticleAccessor< dim, spacedim > * operator-> () const
 
ParticleAccessor< dim, spacedim > * operator-> ()
 
bool operator== (const ParticleIterator< dim, spacedim > &) const
 
bool operator!= (const ParticleIterator< dim, spacedim > &) const
 
ParticleIteratoroperator++ ()
 
ParticleIterator operator++ (int)
 
ParticleIteratoroperator-- ()
 
ParticleIterator operator-- (int)
 

Private Attributes

ParticleAccessor< dim, spacedim > accessor
 

Detailed Description

template<int dim, int spacedim = dim>
class aspect::Particle::ParticleIterator< dim, spacedim >

A class that is used to iterate over particles. Together with the ParticleAccessor class this is used to hide the internal implementation of the particle class and the particle container.

Definition at line 38 of file particle_accessor.h.

Constructor & Destructor Documentation

§ ParticleIterator() [1/2]

template<int dim, int spacedim = dim>
aspect::Particle::ParticleIterator< dim, spacedim >::ParticleIterator ( )

Empty constructor. Such an object is not usable!

§ ParticleIterator() [2/2]

template<int dim, int spacedim = dim>
aspect::Particle::ParticleIterator< dim, spacedim >::ParticleIterator ( const std::multimap< Particles::internal::LevelInd, Particle< dim, spacedim > > &  map,
const typename std::multimap< Particles::internal::LevelInd, Particle< dim, spacedim > >::iterator &  particle 
)

Constructor of the iterator. Takes a reference to the particle container, and an iterator the the cell-particle pair.

Member Function Documentation

§ operator*() [1/2]

template<int dim, int spacedim = dim>
const ParticleAccessor<dim,spacedim>& aspect::Particle::ParticleIterator< dim, spacedim >::operator* ( ) const

Dereferencing operator, returns a reference to an accessor. Usage is thus like (*i).get_id ();

§ operator*() [2/2]

template<int dim, int spacedim = dim>
ParticleAccessor<dim,spacedim>& aspect::Particle::ParticleIterator< dim, spacedim >::operator* ( )

Dereferencing operator, non-const version.

§ operator=()

template<int dim, int spacedim = dim>
ParticleIterator& aspect::Particle::ParticleIterator< dim, spacedim >::operator= ( const ParticleIterator< dim, spacedim > &  )

Assignment operator.

§ operator->() [1/2]

template<int dim, int spacedim = dim>
const ParticleAccessor<dim,spacedim>* aspect::Particle::ParticleIterator< dim, spacedim >::operator-> ( ) const

Dereferencing operator, returns a pointer of the particle pointed to. Usage is thus like i->get_id ();

There is a const and a non-const version.

§ operator->() [2/2]

template<int dim, int spacedim = dim>
ParticleAccessor<dim,spacedim>* aspect::Particle::ParticleIterator< dim, spacedim >::operator-> ( )

Dereferencing operator, non-const version.

§ operator==()

template<int dim, int spacedim = dim>
bool aspect::Particle::ParticleIterator< dim, spacedim >::operator== ( const ParticleIterator< dim, spacedim > &  ) const

Compare for equality.

§ operator!=()

template<int dim, int spacedim = dim>
bool aspect::Particle::ParticleIterator< dim, spacedim >::operator!= ( const ParticleIterator< dim, spacedim > &  ) const

Compare for inequality.

§ operator++() [1/2]

template<int dim, int spacedim = dim>
ParticleIterator& aspect::Particle::ParticleIterator< dim, spacedim >::operator++ ( )

Prefix ++ operator: ++iterator. This operator advances the iterator to the next element and returns a reference to *this.

§ operator++() [2/2]

template<int dim, int spacedim = dim>
ParticleIterator aspect::Particle::ParticleIterator< dim, spacedim >::operator++ ( int  )

Postfix ++ operator: iterator++. This operator advances the iterator to the next element, but returns an iterator to the element previously pointed to.

§ operator--() [1/2]

template<int dim, int spacedim = dim>
ParticleIterator& aspect::Particle::ParticleIterator< dim, spacedim >::operator-- ( )

Prefix operator: –iterator. This operator moves the iterator to the previous element and returns a reference to *this.

§ operator--() [2/2]

template<int dim, int spacedim = dim>
ParticleIterator aspect::Particle::ParticleIterator< dim, spacedim >::operator-- ( int  )

Postfix operator: iterator–. This operator moves the iterator to the previous element, but returns an iterator to the element previously pointed to.

Member Data Documentation

§ accessor

template<int dim, int spacedim = dim>
ParticleAccessor<dim,spacedim> aspect::Particle::ParticleIterator< dim, spacedim >::accessor
private

The accessor to the actual particle.

Definition at line 125 of file particle_iterator.h.


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