Flow123d
release_3.0.0-968-gc87a28e79
flow123d
src
mesh
range_wrapper.hh
Go to the documentation of this file.
1
/*!
2
*
3
* Copyright (C) 2015 Technical University of Liberec. All rights reserved.
4
*
5
* This program is free software; you can redistribute it and/or modify it under
6
* the terms of the GNU General Public License version 3 as published by the
7
* Free Software Foundation. (http://www.gnu.org/licenses/gpl-3.0.en.html)
8
*
9
* This program is distributed in the hope that it will be useful, but WITHOUT
10
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12
*
13
*
14
* @file range_wrapper.hh
15
* @brief Implementation of range helper class.
16
*/
17
18
#ifndef RANGE_WRAPPER_HH_
19
#define RANGE_WRAPPER_HH_
20
21
#include "
tools/general_iterator.hh
"
22
23
/**
24
* @brief Range helper class.
25
*
26
* Allow iterate in bounds given by begin and end iterator. Class can be used for iterable accessor classes.
27
*
28
* Template argument:
29
* - Object Type over its instances is iterated,
30
*/
31
template
<
class
Object>
32
class
Range
33
{
34
public
:
35
/// Constructor.
36
Range
(
Iter<Object>
begin
,
Iter<Object>
end
)
37
:
begin_
(
begin
),
end_
(
end
) {}
38
39
/// Iterator to begin item of range.
40
Iter<Object>
begin
() {
41
return
begin_
;
42
}
43
44
/// Iterator to end item of range.
45
Iter<Object>
end
() {
46
return
end_
;
47
}
48
49
private
:
50
Iter<Object>
begin_
;
51
Iter<Object>
end_
;
52
};
53
54
#endif // RANGE_WRAPPER_HH_
general_iterator.hh
Template Iter serves as general template for internal iterators.
Iter
General iterator template. Provides iterator over objects in some container.
Definition:
general_iterator.hh:30
Range::Range
Range(Iter< Object > begin, Iter< Object > end)
Constructor.
Definition:
range_wrapper.hh:36
Range::begin_
Iter< Object > begin_
Definition:
range_wrapper.hh:50
Range
Range helper class.
Definition:
mesh.h:52
Range::end
Iter< Object > end()
Iterator to end item of range.
Definition:
range_wrapper.hh:45
Range::end_
Iter< Object > end_
Definition:
range_wrapper.hh:51
Range::begin
Iter< Object > begin()
Iterator to begin item of range.
Definition:
range_wrapper.hh:40
Generated by
1.8.17