preCICE
v3.1.2
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
g
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
f
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
f
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
{
6
namespace
mesh {
14
template
<
typename
Source,
typename
Value>
15
class
IndexRangeIterator
:
public
boost::iterator_facade<
16
IndexRangeIterator<Source, const Value>,
17
const Value,
18
boost::random_access_traversal_tag> {
19
public
:
20
IndexRangeIterator
() =
default
;
21
IndexRangeIterator
(Source *src,
size_t
index
)
22
:
src_
(src),
idx_
(
index
) {}
21
IndexRangeIterator
(Source *src,
size_t
index
) {
…
}
23
24
const
Value &
dereference
()
const
25
{
26
using
Coord =
decltype
(
src_
->vertex(
idx_
).rawCoords());
27
static_assert
(
28
std::is_reference<Coord>::value
,
29
"Coordinate type must be a reference!"
);
30
static_assert
(
31
std::is_convertible<Coord, Value>::value
,
32
"Exposed and accessed types must match!"
);
33
return
static_cast<
const
Value &
>
(
src_
->vertex(
idx_
).rawCoords());
34
}
24
const
Value &
dereference
()
const
{
…
}
35
36
size_t
equal
(
const
IndexRangeIterator<Source, Value>
&other)
const
37
{
38
return
other.
idx_
==
idx_
&& other.
src_
==
src_
;
39
}
36
size_t
equal
(
const
IndexRangeIterator<Source, Value>
&other)
const
{
…
}
40
41
void
increment
()
42
{
43
++
idx_
;
44
}
41
void
increment
() {
…
}
45
46
void
decrement
()
47
{
48
--
idx_
;
49
}
46
void
decrement
() {
…
}
50
51
void
advance
(
size_t
n)
52
{
53
idx_
+= n;
54
}
51
void
advance
(
size_t
n) {
…
}
55
56
size_t
distance_to
(
const
IndexRangeIterator<Source, Value>
&other)
const
57
{
58
return
other.
idx_
-
idx_
;
59
}
56
size_t
distance_to
(
const
IndexRangeIterator<Source, Value>
&other)
const
{
…
}
60
61
private
:
62
Source *
src_
{
nullptr
};
63
size_t
idx_
{0};
64
};
15
class
IndexRangeIterator
:
public
boost::iterator_facade< {
…
};
65
66
}
// namespace mesh
67
}
// namespace precice
index
unsigned int index
Definition
SocketCommunication.cpp:717
precice::mesh::IndexRangeIterator
Definition
RangeAccessor.hpp:18
precice::mesh::IndexRangeIterator::distance_to
size_t distance_to(const IndexRangeIterator< Source, Value > &other) const
Definition
RangeAccessor.hpp:56
precice::mesh::IndexRangeIterator::equal
size_t equal(const IndexRangeIterator< Source, Value > &other) const
Definition
RangeAccessor.hpp:36
precice::mesh::IndexRangeIterator::increment
void increment()
Definition
RangeAccessor.hpp:41
precice::mesh::IndexRangeIterator::idx_
size_t idx_
the current index to access
Definition
RangeAccessor.hpp:63
precice::mesh::IndexRangeIterator::dereference
const Value & dereference() const
Definition
RangeAccessor.hpp:24
precice::mesh::IndexRangeIterator::IndexRangeIterator
IndexRangeIterator(Source *src, size_t index)
Definition
RangeAccessor.hpp:21
precice::mesh::IndexRangeIterator::decrement
void decrement()
Definition
RangeAccessor.hpp:46
precice::mesh::IndexRangeIterator::advance
void advance(size_t n)
Definition
RangeAccessor.hpp:51
precice::mesh::IndexRangeIterator::IndexRangeIterator
IndexRangeIterator()=default
precice::mesh::IndexRangeIterator::src_
Source * src_
the source to access
Definition
RangeAccessor.hpp:62
std::is_convertible
std::is_reference
precice
Main namespace of the precice library.
Definition
Acceleration.cpp:5