TransformIterator< _Iterator, _Transform > Class Template Reference

A transform iterator. More...

#include <TransformIterator.h>

Inheritance diagram for TransformIterator< _Iterator, _Transform >:
AdaptedIterator< _Iterator, std::iterator_traits< _Iterator >::iterator_category, _Transform::result_type, std::iterator_traits< _Iterator >::difference_type, void, void > iterator

List of all members.

Public Types

typedef Base::Iterator Iterator
 The un-transformed iterator type.
typedef _Transform Transform
 The unary function that transforms the iterator.
typedef Base::iterator_category iterator_category
 The iterator category.
typedef Base::value_type value_type
 The type "pointed to" by the iterator.
typedef Base::difference_type difference_type
 Distance between iterators is represented as this type.
typedef Base::pointer pointer
 This type represents a pointer-to-value_type. It is not defined for this iterator.
typedef Base::reference reference
 This type represents a reference-to-value_type. It is not defined for this iterator.

Public Member Functions

Constructors etc.

 TransformIterator ()
 Default constructor.
 TransformIterator (const TransformIterator &x)
 Copy constructor.
TransformIteratoroperator= (const TransformIterator &x)
 Assignment operator.
 TransformIterator (const Iterator &i)
 Construct from an iterator.
 TransformIterator (const Transform &t)
 Construct from a transform.
 TransformIterator (const Iterator &i, const Transform &t)
 Construct from an iterator and a transform.
TransformIteratoroperator= (const Iterator &i)
 Assignment from an iterator.
Accessors.

const Iteratorbase () const
 Return the base iterator.
const Transformtransform () const
 Return the transform functor.
Functionality

Note:
There is no reasonable way to define operator->() because we don't have a pointer type.
value_type operator* () const
 Dereference.
TransformIteratoroperator++ ()
 Pre-increment.
TransformIterator operator++ (int)
 Post-increment. Warning: This is not as efficient as the pre-increment.
TransformIteratoroperator-- ()
 Pre-decrement.
TransformIterator operator-- (int)
 Post-decrement. Warning: This is not as efficient as the pre-decrement.
value_type operator[] (const difference_type &n) const
 Sub-scripting.
TransformIteratoroperator+= (const difference_type &n)
 Addition assignment.
TransformIterator operator+ (const difference_type &n) const
 Addition.
TransformIteratoroperator-= (const difference_type &n)
 Subtraction assignment.
TransformIterator operator- (const difference_type &n) const
 Subtraction.

Related Functions

(Note that these are not member functions.)



template<typename _Iterator , class _Transform >
TransformIterator< _Iterator,
_Transform > 
operator+ (typename TransformIterator< _Iterator, _Transform >::difference_type n, const TransformIterator< _Iterator, _Transform > &x)
 Offset from an iterator.
template<typename _Iterator , class _Transform >
TransformIterator< _Iterator,
_Transform > 
constructTransformIterator ()
 Convenience function for instantiating a TransformIterator.
template<typename _Iterator , class _Transform >
TransformIterator< _Iterator,
_Transform > 
constructTransformIterator (const typename TransformIterator< _Iterator, _Transform >::Iterator &i)
 Convenience function for instantiating a TransformIterator.
template<typename _Iterator , class _Transform >
TransformIterator< _Iterator,
_Transform > 
constructTransformIterator (const typename TransformIterator< _Iterator, _Transform >::Transform &t)
 Convenience function for instantiating a TransformIterator.
template<typename _Iterator , class _Transform >
TransformIterator< _Iterator,
_Transform > 
constructTransformIterator (const typename TransformIterator< _Iterator, _Transform >::Iterator &i, const typename TransformIterator< _Iterator, _Transform >::Transform &t)
 Convenience function for instantiating a TransformIterator.
template<typename IntIter , typename DataIter >
TransformIterator< IntIter,
IndexIterUnary< DataIter > > 
constructArrayIndexingIterator (IntIter i, DataIter d)
 Convenience function for instantiating a TransformIterator that indexes an array.

Detailed Description

template<typename _Iterator, class _Transform>
class TransformIterator< _Iterator, _Transform >

A transform iterator.

The dereferencing member function, operator*(), dereferences and then applies the transformation.


Friends And Related Function Documentation

template<typename IntIter , typename DataIter >
TransformIterator< IntIter, IndexIterUnary< DataIter > > constructArrayIndexingIterator ( IntIter  i,
DataIter  d 
) [related]

Convenience function for instantiating a TransformIterator that indexes an array.

This changes an iterator on integers to an iterator over the values in an array.


The documentation for this class was generated from the following file:
Generated on Thu Jun 30 02:14:52 2016 for Algorithms and Data Structures Package by  doxygen 1.6.3