18 #if !defined( BOLT_AMP_TRANSFORM_ITERATOR_H )
19 #define BOLT_AMP_TRANSFORM_ITERATOR_H
129 template<
class UnaryFunc,
class Iterator >
131 std::result_of<UnaryFunc()>,
138 typedef typename std::iterator< transform_iterator_tag, typename std::result_of<UnaryFunc()>,
int>::difference_type
141 typedef UnaryFunc unary_func;
142 typedef typename UnaryFunc::result_type value_type;
143 typedef typename std::iterator_traits<Iterator>::pointer pointer;
154 template<
class OtherUnaryFunc,
class OtherIter>
166 m_Index = rhs.m_Index;
187 result.advance( -n );
193 const concurrency::array_view<int> & getBuffer(
transf_iterator itr )
const
197 UnaryFunc functor()
const
200 Iterator getContainer( )
const
208 return m_Index - rhs.m_Index;
212 difference_type m_Index;
218 void advance( difference_type n )
243 result.advance( -1 );
251 result.advance( -1 );
255 difference_type getIndex()
const
260 value_type* getPointer()
262 Iterator base_iterator = this->base_reference();
263 return &(*base_iterator);
266 const value_type* getPointer()
const
268 Iterator base_iterator = this->base_reference();
269 return &(*base_iterator);
273 template<
class OtherUnaryFunc,
class OtherIterator >
276 bool sameIndex = ( rhs.m_Index == m_Index );
280 template<
class OtherUnaryFunc,
class OtherIterator >
283 bool sameIndex = ( rhs.m_Index != m_Index );
287 template<
class OtherUnaryFunc,
class OtherIterator >
288 bool operator< ( const transform_iterator< OtherUnaryFunc, OtherIterator >& rhs )
const
290 bool sameIndex = (m_Index < rhs.m_Index);
295 value_type operator*()
const
297 return func( iter[ m_Index ] );
300 value_type operator[](
int x)
const restrict(cpu,amp)
302 return func( iter[ x ] );
305 value_type operator[](
int x) restrict(cpu,amp)
307 return func( iter[ x ] );
317 template<
class UnaryFunc,
class Iterator >