Flow123d
release_3.0.0-973-g92f55e826
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
y
Functions
_
a
b
c
d
e
f
g
h
i
m
n
o
p
r
s
t
u
w
Variables
Typedefs
Enumerations
Enumerator
a
b
c
d
f
g
h
i
m
n
o
p
r
s
u
w
y
Classes
Class List
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
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
x
Enumerations
a
b
c
d
f
h
i
m
n
o
p
r
s
t
u
v
Enumerator
a
b
c
d
e
f
g
i
k
l
m
n
o
p
r
s
t
u
v
w
x
y
z
Related Functions
a
b
c
d
e
f
i
l
m
n
o
p
r
s
t
Files
File List
File Members
All
_
a
b
c
d
e
f
g
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Functions
_
a
b
c
d
e
f
i
k
m
n
o
p
r
s
t
u
v
w
x
z
Variables
_
a
c
d
g
m
n
p
q
r
s
v
x
Typedefs
a
d
e
f
i
j
l
m
n
o
q
r
s
u
x
Enumerations
Enumerator
a
c
d
e
f
i
k
m
n
o
p
r
s
u
v
w
Macros
_
a
b
c
d
e
f
g
i
j
k
l
m
n
o
p
q
r
s
t
v
w
x
z
flow123d
src
tools
general_iterator.hh
Go to the documentation of this file.
1
// --------------------------------------------------- GeneralIterator ---------------------------------
2
/*!
3
*
4
* Copyright (C) 2015 Technical University of Liberec. All rights reserved.
5
*
6
* This program is free software; you can redistribute it and/or modify it under
7
* the terms of the GNU General Public License version 3 as published by the
8
* Free Software Foundation. (http://www.gnu.org/licenses/gpl-3.0.en.html)
9
*
10
* This program is distributed in the hope that it will be useful, but WITHOUT
11
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
13
*
14
*
15
* @file general_iterator.hh
16
* @brief Template Iter serves as general template for internal iterators.
17
*/
18
19
#ifndef GENERAL_ITERATOR_HH_
20
#define GENERAL_ITERATOR_HH_
21
22
/** @brief General iterator template.
23
* Provides iterator over objects in some container.
24
*
25
* Requires the template object to implement:
26
* - comparison operator==()
27
* - increment operator++()
28
*/
29
template
<
class
Object>
30
class
Iter
31
{
32
public
:
33
// Iter();
34
35
Iter
(
const
Object&
object
);
36
37
/// equal operator
38
bool
operator==
(
const
Iter
& other);
39
/// non-equal operator
40
bool
operator!=
(
const
Iter
& other);
41
42
/// * dereference operator
43
const
Object&
operator*
()
const
;
44
45
/// -> dereference operator
46
const
Object*
operator->
()
const
;
47
48
/// prefix increment
49
Iter
&
operator++
();
50
51
private
:
52
/// Output element of the output mesh.
53
Object
object_
;
54
};
55
56
57
/**
58
* Create iterator from object
59
*/
60
template
<
class
Object>
61
Iter<Object>
make_iter
(Object obj) {
62
return
Iter<Object>
(obj);
63
}
64
65
66
// --------------------------------------------------- Iter INLINE implementation -----------
67
// inline Iter::Iter()
68
// {}
69
70
template
<
class
Object>
71
inline
Iter<Object>::Iter
(
const
Object&
object
)
72
: object_(object)
73
{}
74
75
template
<
class
Object>
76
inline
bool
Iter<Object>::operator==
(
const
Iter
& other)
77
{
78
return
(object_ == other.
object_
);
79
}
80
81
template
<
class
Object>
82
inline
bool
Iter<Object>::operator!=
(
const
Iter
& other)
83
{
84
return
!( *
this
== other);
85
}
86
87
template
<
class
Object>
88
inline
const
Object&
Iter<Object>::operator*
()
const
89
{
90
return
object_;
91
}
92
93
template
<
class
Object>
94
inline
const
Object*
Iter<Object>::operator->
()
const
95
{
96
return
&object_;
97
}
98
99
template
<
class
Object>
100
inline
Iter<Object>
&
Iter<Object>::operator++
()
101
{
102
object_.inc();
103
return
(*
this
);
104
}
105
106
#endif // GENERAL_ITERATOR_HH_
Iter
General iterator template. Provides iterator over objects in some container.
Definition:
general_iterator.hh:30
Iter::operator*
const Object & operator*() const
Definition:
general_iterator.hh:88
Iter::operator->
const Object * operator->() const
-> dereference operator
Definition:
general_iterator.hh:94
Iter::object_
Object object_
Output element of the output mesh.
Definition:
general_iterator.hh:53
Iter::operator++
Iter & operator++()
prefix increment
Definition:
general_iterator.hh:100
make_iter
Iter< Object > make_iter(Object obj)
Definition:
general_iterator.hh:61
Iter::operator!=
bool operator!=(const Iter &other)
non-equal operator
Definition:
general_iterator.hh:82
Iter::operator==
bool operator==(const Iter &other)
equal operator
Definition:
general_iterator.hh:76
Iter::Iter
Iter(const Object &object)
Definition:
general_iterator.hh:71
Generated by
1.8.17