Reference documentation for deal.II version 9.1.0-pre
particle_iterator.h
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2017 - 2018 by the deal.II authors
4 //
5 // This file is part of the deal.II library.
6 //
7 // The deal.II library is free software; you can use it, redistribute
8 // it, and/or modify it under the terms of the GNU Lesser General
9 // Public License as published by the Free Software Foundation; either
10 // version 2.1 of the License, or (at your option) any later version.
11 // The full text of the license can be found in the file LICENSE.md at
12 // the top level directory of deal.II.
13 //
14 // ---------------------------------------------------------------------
15 
16 #ifndef dealii_particles_particle_iterator_h
17 #define dealii_particles_particle_iterator_h
18 
19 #include <deal.II/base/config.h>
20 
21 #include <deal.II/particles/particle_accessor.h>
22 
23 DEAL_II_NAMESPACE_OPEN
24 
25 namespace Particles
26 {
27  template <int, int>
28  class ParticleHandler;
29 
35  template <int dim, int spacedim = dim>
36  class ParticleIterator
37  {
38  public:
42  ParticleIterator() = default;
43 
49  const std::multimap<internal::LevelInd, Particle<dim, spacedim>> &map,
50  const typename std::multimap<internal::LevelInd,
51  Particle<dim, spacedim>>::iterator
52  &particle);
53 
58  const ParticleAccessor<dim, spacedim> &operator*() const;
59 
63  ParticleAccessor<dim, spacedim> &operator*();
64 
69  operator=(const ParticleIterator &);
70 
77  const ParticleAccessor<dim, spacedim> *operator->() const;
78 
82  ParticleAccessor<dim, spacedim> *operator->();
83 
87  bool
88  operator==(const ParticleIterator<dim, spacedim> &) const;
89 
93  bool
94  operator!=(const ParticleIterator<dim, spacedim> &) const;
95 
102  operator++();
103 
110  operator++(int);
111 
118  operator--();
119 
126  operator--(int);
127 
133  using iterator_category = std::bidirectional_iterator_tag;
134  using value_type = ParticleAccessor<dim, spacedim>;
135  using difference_type = std::ptrdiff_t;
136  using pointer = ParticleAccessor<dim, spacedim> *;
137  using reference = ParticleAccessor<dim, spacedim> &;
138 
139  private:
143  ParticleAccessor<dim, spacedim> accessor;
144  };
145 } // namespace Particles
146 
147 DEAL_II_NAMESPACE_CLOSE
148 
149 #endif
ParticleIterator & operator=(const ParticleIterator &)
ParticleIterator & operator--()
const ParticleAccessor< dim, spacedim > * operator->() const
std::bidirectional_iterator_tag iterator_category
const ParticleAccessor< dim, spacedim > & operator*() const
ParticleIterator & operator++()
bool operator!=(const ParticleIterator< dim, spacedim > &) const
bool operator==(const ParticleIterator< dim, spacedim > &) const
ParticleAccessor< dim, spacedim > accessor