12#ifndef __stir_NestedIterator__H__
13#define __stir_NestedIterator__H__
28#include "boost/iterator/iterator_traits.hpp"
92template <
typename topleveliterT,
class GetRestRangeFunctionT = BeginEndFunction<topleveliterT>>
96 typedef typename GetRestRangeFunctionT::rest_iter_type rest_iter_type;
99 typedef std::forward_iterator_tag iterator_category;
100 typedef typename boost::iterator_difference<rest_iter_type>::type difference_type;
101 typedef typename boost::iterator_value<rest_iter_type>::type value_type;
102 typedef typename boost::iterator_reference<rest_iter_type>::type reference;
103 typedef typename boost::iterator_pointer<rest_iter_type>::type pointer;
110 inline NestedIterator(
const topleveliterT& top_level_iter,
const topleveliterT& end_top_level_iter);
116 template <
typename othertopleveliterT,
typename otherGetRestRangeFunctionT>
118 NestedIterator<othertopleveliterT, otherGetRestRangeFunctionT> other,
119 typename boost::enable_if_convertible<othertopleveliterT, topleveliterT>::type* = 0,
120 typename boost::enable_if_convertible<typename otherGetRestRangeFunctionT::rest_iter_type, rest_iter_type>::type* = 0)
121 : _current_top_level_iter(other._current_top_level_iter),
122 _end_top_level_iter(other._end_top_level_iter),
123 _current_rest_iter(other._current_rest_iter),
124 _end_rest_iter(other._end_rest_iter)
146#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
151 template <
class,
class>
152 friend class NestedIterator;
156 topleveliterT _current_top_level_iter;
159 topleveliterT _end_top_level_iter;
162 rest_iter_type _current_rest_iter;
165 rest_iter_type _end_rest_iter;
169 void _set_rest_iters_for_current_top_level_iter();
This file defines supporting function objects for stir::NestedIterator.
inline implementations for stir::NestedIterator.
NestedIterator & operator++()
prefix increment
Definition NestedIterator.inl:98
bool operator==(const NestedIterator &) const
test equality
Definition NestedIterator.inl:66
bool operator!=(const NestedIterator &) const
test equality
Definition NestedIterator.inl:90
NestedIterator operator++(int)
postfix increment
Definition NestedIterator.inl:114
NestedIterator(const topleveliterT &top_level_iter, const topleveliterT &end_top_level_iter)
constructor to initialise the members
Definition NestedIterator.inl:56
reference operator*() const
dereferencing operator
Definition NestedIterator.inl:123
NestedIterator(NestedIterator< othertopleveliterT, otherGetRestRangeFunctionT > other, typename boost::enable_if_convertible< othertopleveliterT, topleveliterT >::type *=0, typename boost::enable_if_convertible< typename otherGetRestRangeFunctionT::rest_iter_type, rest_iter_type >::type *=0)
constructor to convert between nested iterators using convertible top and next level iterators
Definition NestedIterator.h:117
pointer operator->() const
member-selection operator
Definition NestedIterator.inl:130
NestedIterator()
default constructor
Definition NestedIterator.inl:27