dune-grid
2.3beta2
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
dune
grid
common
common/intersectioniterator.hh
Go to the documentation of this file.
1
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2
// vi: set et ts=4 sw=2 sts=2:
3
#ifndef DUNE_GRID_INTERSECTIONITERATOR_HH
4
#define DUNE_GRID_INTERSECTIONITERATOR_HH
5
6
#include <dune/common/iteratorfacades.hh>
7
8
#include <
dune/grid/common/intersection.hh
>
9
10
namespace
Dune
11
{
12
81
template
<
class
Gr
id
Imp,
class
IntersectionIteratorImp,
class
IntersectionImp >
82
class
IntersectionIterator
83
{
84
#if DUNE_GRID_EXPERIMENTAL_GRID_EXTENSIONS
85
public
:
86
#else
87
protected
:
88
// give the GridDefaultImplementation class access to the realImp
89
friend
class
GridDefaultImplementation
<
90
GridImp::dimension, GridImp::dimensionworld,
91
typename GridImp::ctype,
92
typename GridImp::GridFamily> ;
93
#endif
94
// type of underlying implementation, for internal use only
95
typedef IntersectionIteratorImp
Implementation
;
96
98
Implementation
&
impl
() {
return
realIterator
; }
100
const
Implementation
&
impl
()
const
{
return
realIterator
; }
101
102
protected
:
103
Implementation
realIterator
;
104
105
public
:
107
typedef
Dune::Intersection< GridImp, IntersectionImp >
Intersection
;
108
109
//===========================================================
113
//===========================================================
114
116
const
Intersection
&
operator*
()
const
117
{
118
return
this->
realIterator
.dereference();
119
}
120
122
const
Intersection
*
operator->
()
const
123
{
124
return
& this->
realIterator
.dereference();
125
}
127
128
129
//===========================================================
133
//===========================================================
134
140
bool
operator==
(
const
IntersectionIterator
& rhs)
const
141
{
142
return
rhs.
equals
(*
this
);
143
}
144
150
bool
operator!=
(
const
IntersectionIterator
& rhs)
const
151
{
152
return
! rhs.
equals
(*
this
);
153
}
155
157
IntersectionIterator
&
operator++
()
158
{
159
this->
realIterator
.increment();
160
return
*
this
;
161
}
162
163
//===========================================================
167
//===========================================================
168
170
bool
equals
(
const
IntersectionIterator
& rhs)
const
171
{
172
return
this->
realIterator
.equals(rhs.
realIterator
);
173
}
174
176
IntersectionIterator
(
const
Implementation
&
impl
)
177
:
realIterator
( impl )
178
{}
179
181
IntersectionIterator
(
const
IntersectionIterator
& i) :
182
realIterator
(i.
realIterator
) {}
184
};
185
186
}
// namespace Dune
187
188
#include "intersection.hh"
189
190
#endif // DUNE_GRID_INTERSECTIONITERATOR_HH
Generated on Mon Feb 10 2014 21:12:34 for dune-grid by
1.8.1.2