Flow123d  release_3.0.0-880-gc768b7a
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 
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.
37  : begin_(begin), end_(end) {}
38 
39  /// Iterator to begin item of range.
41  return begin_;
42  }
43 
44  /// Iterator to end item of range.
46  return end_;
47  }
48 
49 private:
52 };
53 
54 #endif // RANGE_WRAPPER_HH_
Range(Iter< Object > begin, Iter< Object > end)
Constructor.
Range helper class.
Definition: mesh.h:52
Iter< Object > begin_
Template Iter serves as general template for internal iterators.
Iter< Object > end()
Iterator to end item of range.
General iterator template. Provides iterator over objects in some container.
Iter< Object > end_
Iter< Object > begin()
Iterator to begin item of range.