16 typedef TargetType value_type;
17 typedef TargetHandle value_handle;
20 typedef const value_type& reference;
21 typedef const value_type* pointer;
22 typedef const Mesh* mesh_ptr;
23 typedef const Mesh& mesh_ref;
25 typedef value_type& reference;
26 typedef value_type* pointer;
27 typedef Mesh* mesh_ptr;
28 typedef Mesh& mesh_ref;
36 : mesh_(0), skip_bits_(0)
41 IteratorT(mesh_ref _mesh, value_handle _hnd,
bool _skip=
false)
42 : mesh_(&_mesh), hnd_(_hnd), skip_bits_(0)
50 : mesh_(_rhs.mesh_), hnd_(_rhs.hnd_), skip_bits_(_rhs.skip_bits_)
59 skip_bits_ = _rhs.skip_bits_;
67 IteratorT(
const NonConstIterT<Mesh>& _rhs)
68 : mesh_(_rhs.mesh_), hnd_(_rhs.hnd_), skip_bits_(_rhs.skip_bits_)
77 skip_bits_ = _rhs.skip_bits_;
82 friend class ConstIterT<Mesh>;
87 reference
operator*()
const {
return mesh_->deref(hnd_); }
90 pointer
operator->()
const {
return &(mesh_->deref(hnd_)); }
93 value_handle
handle()
const {
return hnd_; }
96 operator value_handle()
const {
return hnd_; }
100 {
return ((mesh_ == _rhs.mesh_) && (hnd_ == _rhs.hnd_)); }
108 { hnd_.__increment();
if (skip_bits_) skip_fwd();
return *
this; }
112 { hnd_.__decrement();
if (skip_bits_) skip_bwd();
return *
this; }
118 if (mesh_ && mesh_->has_element_status())
120 Attributes::StatusInfo status;
121 status.set_deleted(
true);
122 status.set_hidden(
true);
123 skip_bits_ = status.bits();
139 assert(mesh_ && skip_bits_);
140 while ((hnd_.idx() < (signed) mesh_->n_elements()) &&
141 (mesh_->status(hnd_).bits() & skip_bits_))
148 assert(mesh_ && skip_bits_);
149 while ((hnd_.idx() >= 0) &&
150 (mesh_->status(hnd_).bits() & skip_bits_))
159 unsigned int skip_bits_;
IteratorT & operator--()
Standard pre-decrement operator.
Definition: iterators_template.hh:111
void disable_skipping()
Turn on skipping: automatically skip deleted/hidden elements.
Definition: iterators_template.hh:131
IteratorT(const IteratorT &_rhs)
Copy constructor.
Definition: iterators_template.hh:49
IteratorT(mesh_ref _mesh, value_handle _hnd, bool _skip=false)
Construct with mesh and a target handle.
Definition: iterators_template.hh:41
pointer operator->() const
Standard pointer operator.
Definition: iterators_template.hh:90
Linear iterator.
Definition: iterators_template.hh:9
IteratorT & operator=(const IteratorT< Mesh > &_rhs)
Assignment operator.
Definition: iterators_template.hh:55
value_handle handle() const
Get the handle of the item the iterator refers to.
Definition: iterators_template.hh:93
Polygonal mesh based on the ArrayKernel.
Definition: PolyMesh_ArrayKernelT.hh:98
bool operator==(const IteratorT &_rhs) const
Are two iterators equal? Only valid if they refer to the same mesh!
Definition: iterators_template.hh:99
void enable_skipping()
Turn on skipping: automatically skip deleted/hidden elements.
Definition: iterators_template.hh:116
reference operator*() const
Standard dereferencing operator.
Definition: iterators_template.hh:87
IteratorT()
Default constructor.
Definition: iterators_template.hh:35
bool operator!=(const IteratorT &_rhs) const
Not equal?
Definition: iterators_template.hh:103
IteratorT & operator++()
Standard pre-increment operator.
Definition: iterators_template.hh:107