11 #ifndef __stir_NestedIteratorHelpers__H__ 12 #define __stir_NestedIteratorHelpers__H__ 25 #include "boost/iterator/iterator_traits.hpp" 26 #include "boost/pointee.hpp" 38 template <
class TopLevelIterT>
39 class BeginEndFunction
41 typedef typename boost::iterator_value<TopLevelIterT>::type iter_value_type;
43 typedef typename iter_value_type::iterator rest_iter_type;
45 rest_iter_type begin(
const TopLevelIterT& iter)
const 46 {
return iter->begin(); }
47 rest_iter_type end(
const TopLevelIterT& iter)
const 48 {
return iter->end(); }
51 template <
class TopLevelIterT>
52 class ConstBeginEndFunction
54 typedef typename boost::iterator_value<TopLevelIterT>::type iter_value_type;
56 typedef typename iter_value_type::const_iterator rest_iter_type;
58 rest_iter_type begin(
const TopLevelIterT& iter)
const 59 {
return iter->begin(); }
60 rest_iter_type end(
const TopLevelIterT& iter)
const 61 {
return iter->end(); }
64 template <
class TopLevelIterT>
65 class BeginEndAllFunction
67 typedef typename boost::iterator_value<TopLevelIterT>::type iter_value_type;
69 typedef typename iter_value_type::full_iterator rest_iter_type;
71 rest_iter_type begin(
const TopLevelIterT& iter)
const 72 {
return iter->begin_all(); }
73 rest_iter_type end(
const TopLevelIterT& iter)
const 74 {
return iter->end_all(); }
77 template <
class TopLevelIterT>
78 class ConstBeginEndAllFunction
80 typedef typename boost::iterator_value<TopLevelIterT>::type iter_value_type;
82 typedef typename iter_value_type::const_full_iterator rest_iter_type;
84 rest_iter_type begin(
const TopLevelIterT& iter)
const 85 {
return iter->begin_all_const(); }
86 rest_iter_type end(
const TopLevelIterT& iter)
const 87 {
return iter->end_all_const(); }
90 template <
class TopLevelIterT>
91 class PtrBeginEndFunction
93 typedef typename boost::pointee<typename boost::iterator_value<TopLevelIterT>::type>::type iter_value_type;
95 typedef typename iter_value_type::iterator rest_iter_type;
97 rest_iter_type begin(
const TopLevelIterT& iter)
const 98 {
return (**iter).begin(); }
99 rest_iter_type end(
const TopLevelIterT& iter)
const 100 {
return (**iter).end(); }
103 template <
class TopLevelIterT>
104 class ConstPtrBeginEndFunction
106 typedef typename boost::pointee<typename boost::iterator_value<TopLevelIterT>::type>::type iter_value_type;
108 typedef typename iter_value_type::const_iterator rest_iter_type;
110 rest_iter_type begin(
const TopLevelIterT& iter)
const 111 {
return (**iter).begin(); }
112 rest_iter_type end(
const TopLevelIterT& iter)
const 113 {
return (**iter).end(); }
116 template <
class TopLevelIterT>
117 class PtrBeginEndAllFunction
119 typedef typename boost::pointee<typename boost::iterator_value<TopLevelIterT>::type>::type iter_value_type;
121 typedef typename iter_value_type::full_iterator rest_iter_type;
123 rest_iter_type begin(
const TopLevelIterT& iter)
const 124 {
return (**iter).begin_all(); }
125 rest_iter_type end(
const TopLevelIterT& iter)
const 126 {
return (**iter).end_all(); }
129 template <
class TopLevelIterT>
130 class ConstPtrBeginEndAllFunction
132 typedef typename boost::pointee<typename boost::iterator_value<TopLevelIterT>::type>::type iter_value_type;
134 typedef typename iter_value_type::const_full_iterator rest_iter_type;
136 rest_iter_type begin(
const TopLevelIterT& iter)
const 137 {
return (**iter).begin_all_const(); }
138 rest_iter_type end(
const TopLevelIterT& iter)
const 139 {
return (**iter).end_all_const(); }
156 template <class TopLevelIterT, class RestIterT = typename boost::iterator_value<TopLevelIterT>::type::iterator>
164 inline RestIterT
begin(
const TopLevelIterT& iter)
const {
return iter->begin(); }
166 inline RestIterT
end(
const TopLevelIterT& iter)
const {
return iter->end(); }
182 template <
class TopLevelIterT,
183 class RestIterT =
typename boost::pointee<typename boost::iterator_value<TopLevelIterT>::type>::type::iterator>
187 typedef RestIterT rest_iter_type;
190 inline RestIterT
begin(
const TopLevelIterT& iter)
const {
return (**iter).begin(); }
192 inline RestIterT
end(
const TopLevelIterT& iter)
const {
return (**iter).end(); }
207 template <class TopLevelIterT, class RestIterT = typename boost::iterator_value<TopLevelIterT>::type::full_iterator>
211 typedef RestIterT rest_iter_type;
212 inline RestIterT begin(
const TopLevelIterT& iter)
const {
return iter->begin_all(); }
213 inline RestIterT end(
const TopLevelIterT& iter)
const {
return iter->end_all(); }
229 template <
class TopLevelIterT,
230 class RestIterT =
typename boost::pointee<typename boost::iterator_value<TopLevelIterT>::type>::type::full_iterator>
234 typedef RestIterT rest_iter_type;
235 inline RestIterT begin(
const TopLevelIterT& iter)
const {
return (**iter).begin_all(); }
236 inline RestIterT end(
const TopLevelIterT& iter)
const {
return (**iter).end_all(); }
241 template <class TopLevelIterT, class RestIterT = typename boost::iterator_value<TopLevelIterT>::type::const_iterator>
248 template <class TopLevelIterT, class RestIterT = typename boost::iterator_value<TopLevelIterT>::type::const_full_iterator>
255 template <
class TopLevelIterT>
259 typename boost::pointee<typename boost::iterator_value<TopLevelIterT>::type>::type::const_iterator>
264 template <
class TopLevelIterT>
268 typename boost::pointee<typename boost::iterator_value<TopLevelIterT>::type>::type::const_full_iterator>
272 #endif // #if between old and new implementation Helper class for NestedIterator when the 1st level iterator refers to a stir full iterator for the 2n...
Definition: NestedIteratorHelpers.h:208
RestIterT begin(const TopLevelIterT &iter) const
function to get the first 2nd level iterator for a top-level iterator
Definition: NestedIteratorHelpers.h:190
Helper class for NestedIterator when the 1st level iterator refers to an ordinary iterator for the 2n...
Definition: NestedIteratorHelpers.h:157
Convenience class where the 2nd level iterator is a const_full_iterator.
Definition: NestedIteratorHelpers.h:249
Convenience class where the 2nd level iterator is a const_full_iterator.
Definition: NestedIteratorHelpers.h:265
Helper class for NestedIterator when the 1st level iterator refers to pointers to an ordinary iterato...
Definition: NestedIteratorHelpers.h:184
Convenience class where the 2nd level iterator is a const_iterator.
Definition: NestedIteratorHelpers.h:242
Helper class for NestedIterator when the 1st level iterator refers to a pointer to a stir full iterat...
Definition: NestedIteratorHelpers.h:231
basic configuration include file
RestIterT end(const TopLevelIterT &iter) const
function to get the "end" 2nd level iterator for a top-level iterator
Definition: NestedIteratorHelpers.h:192
RestIterT begin(const TopLevelIterT &iter) const
function to get the first 2nd level iterator for a top-level iterator
Definition: NestedIteratorHelpers.h:164
RestIterT rest_iter_type
typedef storing the type of the 2nd level iterator
Definition: NestedIteratorHelpers.h:161
RestIterT end(const TopLevelIterT &iter) const
function to get the "end" 2nd level iterator for a top-level iterator
Definition: NestedIteratorHelpers.h:166
Convenience class where the 2nd level iterator is a const_iterator.
Definition: NestedIteratorHelpers.h:256