24 #ifndef PSS_ASTROTYPES_MULTIARRAY_SLICEITERATOR_H
25 #define PSS_ASTROTYPES_MULTIARRAY_SLICEITERATOR_H
34 namespace astrotypes {
36 template<
bool is_const,
typename ParentT,
template<
typename>
class SliceMixin,
typename Dimension,
typename... Dimensions>
41 namespace multiarray {
42 template<
typename T,
typename D, std::
size_t>
class ReducedRankSlice;
49 namespace astrotypes {
56 template<
typename DerivedType,
typename SliceType,
bool is_const,
int Rank>
60 template<
typename D,
typename S,
bool,
int>
65 typedef typename std::conditional<is_const, typename SliceType::Parent::const_iterator, typename SliceType::Parent::iterator>::type parent_iterator;
68 typedef typename std::conditional<is_const, SliceType const, SliceType>::type
SliceT;
72 typedef typename std::iterator_traits<parent_iterator>::value_type
value_type;
73 typedef typename std::iterator_traits<parent_iterator>::reference
reference;
74 typedef typename std::iterator_traits<parent_iterator>::pointer
pointer;
75 typedef typename std::iterator_traits<parent_iterator>::difference_type
difference_type;
84 difference_type
operator-(SelfType
const&)
const;
86 SliceT
const&
slice()
const;
93 template<
typename DerivedType,
typename SliceType,
bool is_const>
96 template<
typename D,
typename S,
bool,
int>
100 typedef typename std::conditional<is_const, typename SliceType::Parent::const_iterator, typename SliceType::Parent::iterator>::type parent_iterator;
103 typedef typename std::conditional<is_const, SliceType const, SliceType>::type
SliceT;
107 typedef typename std::iterator_traits<parent_iterator>::value_type
value_type;
108 typedef typename std::iterator_traits<parent_iterator>::reference
reference;
109 typedef typename std::iterator_traits<parent_iterator>::pointer
pointer;
110 typedef typename std::iterator_traits<parent_iterator>::difference_type
difference_type;
120 template<
typename D,
bool const_val>
123 template<
typename D,
bool const_val>
127 const reference operator*()
const;
142 template<
typename DataT>
146 static DerivedType create_end(SliceT&
slice);
148 difference_type
operator-(SelfType
const&)
const;
154 template<
typename SliceType,
bool is_const>
157 template<
bool is_const,
typename ParentT,
template<
typename>
class SliceMixin,
typename Dimension,
typename... Dimensions,
bool is_const2>
159 :
public SliceIteratorBase<SliceIterator<Slice<is_const2, ParentT, SliceMixin, Dimension, Dimensions...>, is_const>
160 , Slice<is_const2, ParentT, SliceMixin, Dimension, Dimensions...>, is_const
161 , Slice<is_const2, ParentT, SliceMixin, Dimension, Dimensions...>::rank>
164 typedef Slice<is_const2, ParentT, SliceMixin, Dimension, Dimensions...>
SliceType;
165 typedef typename std::conditional<is_const, SliceType const, SliceType>::type
SliceT;
170 typedef SliceIteratorBase<SliceIterator<SliceType, is_const>, SliceType, is_const, 1>
ImplT;
179 template<
bool is_const,
typename ParentT,
template<
typename>
class SliceMixin,
typename Dimension,
typename... Dimensions,
bool is_const2>
180 class SliceIterator<SliceMixin<
Slice<is_const, ParentT, SliceMixin, Dimension, Dimensions...>>, is_const2> :
public SliceIteratorBase<SliceIterator<SliceMixin<Slice<is_const, ParentT, SliceMixin, Dimension, Dimensions...>>, is_const2>, Slice<is_const, ParentT, SliceMixin, Dimension, Dimensions...>, is_const2, Slice<is_const, ParentT, SliceMixin, Dimension, Dimensions...>::rank>
183 typedef Slice<is_const, ParentT, SliceMixin, Dimension, Dimensions...>
SliceType;
184 typedef typename std::conditional<is_const2, SliceType const, SliceType>::type
SliceT;
188 typedef SliceIteratorBase<SliceIterator<SliceMixin<SliceType>, is_const2>, SliceType, is_const2, 1>
ImplT;
194 template<
typename T, std::
size_t B,
typename SliceType,
bool is_const>
200 typedef typename ActualBaseT::SliceT
SliceT;
203 typedef typename ActualBaseT::BaseT
BaseT;
204 typedef typename ActualBaseT::ImplT
ImplT;
218 template<
template<
typename,
typename...>
class Mixin,
typename... Ts,
typename SliceType,
bool is_const>
224 typedef typename ActualBaseT::SliceT
SliceT;
227 typedef typename ActualBaseT::BaseT
BaseT;
228 typedef typename ActualBaseT::ImplT
ImplT;
244 template<
typename SliceType>
250 template<
typename SliceType,
typename D, std::
size_t Rank>
256 template<
template<
typename>
class Mixin,
typename SliceType>
265 template<
typename ReplacementSliceType,
typename SliceIterator>
268 template<
typename ReplacementSliceType
278 template<
typename ReplacementSliceType
279 ,
template<
typename>
class SliceMixin
291 #endif // PSS_ASTROTYPES_MULTIARRAY_SLICEITERATOR_H
std::iterator_traits< parent_iterator >::value_type value_type
std::iterator_traits< parent_iterator >::reference reference
difference_type operator-(SelfType const &) const
Slice< is_const, ParentT, SliceMixin, Dimension, Dimensions...> SliceType
SliceIterator(BaseT const &b)
SliceMixinRemover< SliceType >::type type
std::forward_iterator_tag iterator_category
SliceIterator(BaseT const &b)
SliceIteratorBase< SliceIterator< SliceType, is_const >, SliceType, is_const, SliceType::rank > BaseT
SliceIteratorBase< SliceIterator< SliceType, is_const >, SliceType, is_const, 1 > ImplT
SliceIteratorBase< SliceIterator< SliceMixin< SliceType >, is_const2 >, SliceType, is_const2, SliceType::rank > BaseT
std::conditional< is_const2, SliceType const, SliceType >::type SliceT
static SliceIterator create_end(SliceT &slice)
std::iterator_traits< parent_iterator >::difference_type difference_type
std::iterator_traits< parent_iterator >::pointer pointer
SliceT const & slice() const
multiarray::ReducedRankSlice< typename SliceMixinRemover< SliceType >::type, D, Rank > type
std::conditional< is_const, SliceType const, SliceType >::type SliceT
friend class SliceIteratorBase
SliceIteratorBase< SliceIterator< SliceMixin< SliceType >, is_const2 >, SliceType, is_const2, 1 > ImplT
Representation of a Slice through a Data Array.
std::iterator_traits< parent_iterator >::difference_type difference_type
std::iterator_traits< parent_iterator >::reference reference
ActualBaseT::SliceT SliceT
SliceIterator< SliceMixin< ReplacementSliceType >, is_const > type
ActualBaseT::SliceT SliceT
Overlays an iterator from one data structure onto that of another.
bool operator!=(PointerAllocator< FirstType > const &, PointerAllocator< SecondType > const &) noexcept
Allows to test for diversity of PointerAllocator objects.
std::iterator_traits< parent_iterator >::iterator_category iterator_category
bool operator==(PointerAllocator< FirstType > const &, PointerAllocator< SecondType > const &) noexcept
Allows to test for equivalence of PointerAllocator objects.
DerivedType & operator++()
SliceIterator< ReplacementSliceType, is_const > type
std::iterator_traits< parent_iterator >::value_type value_type
std::conditional< is_const, SliceType const, SliceType >::type SliceT
std::iterator_traits< parent_iterator >::pointer pointer
SlicePosition< SliceT::rank > _pos
SliceIterator(BaseT const &b)
Class to Iterate over a Slice.
std::conditional< is_const, SliceType const, SliceType >::type SliceT
static SliceIterator create_end(SliceT &slice)
Slice< is_const2, ParentT, SliceMixin, Dimension, Dimensions...> SliceType