preCICE
v3.2.0
Toggle main menu visibility
Main Page
Related Pages
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
Variables
_
a
b
c
d
e
f
h
i
m
n
p
r
s
t
Typedefs
b
d
e
g
l
m
p
r
s
t
u
v
Enumerations
Enumerator
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
~
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
~
Variables
_
a
b
c
d
e
f
g
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Typedefs
a
b
c
d
e
f
i
k
m
n
o
p
r
s
t
v
w
Enumerations
Enumerator
c
d
e
i
l
m
n
o
r
s
u
v
w
Related Symbols
Files
File List
File Members
All
_
a
b
c
d
e
g
i
j
m
n
o
p
r
s
t
v
Functions
a
b
c
g
m
p
r
s
t
v
Variables
Typedefs
Macros
b
d
m
n
p
t
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
Loading...
Searching...
No Matches
src
mesh
RangeAccessor.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include <boost/iterator/iterator_facade.hpp>
4
5
namespace
precice::mesh
{
13
template
<
typename
Source,
typename
Value>
14
class
IndexRangeIterator
:
public
boost::iterator_facade<
15
IndexRangeIterator<Source, const Value>,
16
const Value,
17
boost::random_access_traversal_tag> {
18
public
:
19
IndexRangeIterator
() =
default
;
20
IndexRangeIterator
(Source *src,
size_t
index
)
21
:
src_
(src),
idx_
(
index
) {}
20
IndexRangeIterator
(Source *src,
size_t
index
) {
…
}
22
23
const
Value &
dereference
()
const
24
{
25
using
Coord =
decltype
(
src_
->vertex(
idx_
).rawCoords());
26
static_assert
(
27
std::is_reference<Coord>::value
,
28
"Coordinate type must be a reference!"
);
29
static_assert
(
30
std::is_convertible<Coord, Value>::value
,
31
"Exposed and accessed types must match!"
);
32
return
static_cast<
const
Value &
>
(
src_
->vertex(
idx_
).rawCoords());
33
}
23
const
Value &
dereference
()
const
{
…
}
34
35
size_t
equal
(
const
IndexRangeIterator<Source, Value>
&other)
const
36
{
37
return
other.
idx_
==
idx_
&& other.
src_
==
src_
;
38
}
35
size_t
equal
(
const
IndexRangeIterator<Source, Value>
&other)
const
{
…
}
39
40
void
increment
()
41
{
42
++
idx_
;
43
}
40
void
increment
() {
…
}
44
45
void
decrement
()
46
{
47
--
idx_
;
48
}
45
void
decrement
() {
…
}
49
50
void
advance
(
size_t
n)
51
{
52
idx_
+= n;
53
}
50
void
advance
(
size_t
n) {
…
}
54
55
size_t
distance_to
(
const
IndexRangeIterator<Source, Value>
&other)
const
56
{
57
return
other.
idx_
-
idx_
;
58
}
55
size_t
distance_to
(
const
IndexRangeIterator<Source, Value>
&other)
const
{
…
}
59
60
private
:
61
Source *
src_
{
nullptr
};
62
size_t
idx_
{0};
63
};
14
class
IndexRangeIterator
:
public
boost::iterator_facade< {
…
};
64
65
}
// namespace precice::mesh
index
unsigned int index
Definition
SocketCommunication.cpp:724
precice::mesh::IndexRangeIterator
Definition
RangeAccessor.hpp:17
precice::mesh::IndexRangeIterator::distance_to
size_t distance_to(const IndexRangeIterator< Source, Value > &other) const
Definition
RangeAccessor.hpp:55
precice::mesh::IndexRangeIterator::equal
size_t equal(const IndexRangeIterator< Source, Value > &other) const
Definition
RangeAccessor.hpp:35
precice::mesh::IndexRangeIterator::increment
void increment()
Definition
RangeAccessor.hpp:40
precice::mesh::IndexRangeIterator::idx_
size_t idx_
the current index to access
Definition
RangeAccessor.hpp:62
precice::mesh::IndexRangeIterator::dereference
const Value & dereference() const
Definition
RangeAccessor.hpp:23
precice::mesh::IndexRangeIterator::IndexRangeIterator
IndexRangeIterator(Source *src, size_t index)
Definition
RangeAccessor.hpp:20
precice::mesh::IndexRangeIterator::decrement
void decrement()
Definition
RangeAccessor.hpp:45
precice::mesh::IndexRangeIterator::advance
void advance(size_t n)
Definition
RangeAccessor.hpp:50
precice::mesh::IndexRangeIterator::IndexRangeIterator
IndexRangeIterator()=default
precice::mesh::IndexRangeIterator::src_
Source * src_
the source to access
Definition
RangeAccessor.hpp:61
std::is_convertible
std::is_reference
precice::mesh
provides Mesh, Data and primitives.
Definition
ScaleActionTest.cpp:20