Orfeo Toolbox  4.0
Public Member Functions | Private Member Functions | Private Attributes | List of all members
itk::ConstSliceIterator< TPixel, TContainer > Class Template Reference

A flexible iterator for ITK containers(i.e. itk::Neighborhood) that support pixel access through operator[]. More...

#include <itkConstSliceIterator.h>

Public Member Functions

 ConstSliceIterator (const TContainer *n, std::slice s)
 
ConstSliceIterator Begin ()
 
ConstSliceIterator End ()
 
bool operator!= (const ConstSliceIterator &orig)
 
const TPixel & operator* ()
 
ConstSliceIterator operator++ ()
 
ConstSliceIterator operator++ (int)
 
bool operator< (const ConstSliceIterator &orig)
 
bool operator== (const ConstSliceIterator &orig)
 
const TPixel & operator[] (SizeValueType n)
 

Private Member Functions

const TPixel & Loc (SizeValueType n) const
 

Private Attributes

const TContainer * m_ContainerPointer
 
SizeValueType m_Pos
 
std::slice m_Slice
 

Detailed Description

template<typename TPixel, typename TContainer>
class itk::ConstSliceIterator< TPixel, TContainer >

A flexible iterator for ITK containers(i.e. itk::Neighborhood) that support pixel access through operator[].

ConstSliceIterator allows const iteration along a std::slice through the container. A slice is a construct that defines a starting position, stride length (distance between adjacent elements), and a length.

Any container with operator[] const is supported. Because it uses this interface the iterator is only as efficient as the implementation of a container's operator[] method.

References: Modelled after a slice iterator proposed by Bjarne Stroustrup in C++ Programming Language, Third Edition. Bjarne Stroustrup. Addison Wesley, Reading, MA. 1997.

Definition at line 51 of file itkConstSliceIterator.h.

Constructor & Destructor Documentation

template<typename TPixel , typename TContainer >
itk::ConstSliceIterator< TPixel, TContainer >::ConstSliceIterator ( const TContainer *  n,
std::slice  s 
)
inline

Constructor.

Definition at line 55 of file itkConstSliceIterator.h.

Member Function Documentation

template<typename TPixel , typename TContainer >
ConstSliceIterator itk::ConstSliceIterator< TPixel, TContainer >::Begin ( void  )
inline

Returns a ConstSliceIterator that points to the beginning of the slice.

Definition at line 59 of file itkConstSliceIterator.h.

References itk::ConstSliceIterator< TPixel, TContainer >::m_Pos.

template<typename TPixel , typename TContainer >
ConstSliceIterator itk::ConstSliceIterator< TPixel, TContainer >::End ( void  )
inline

Returns a ConstSliceIterator that points to one past the end of the slice.

Definition at line 69 of file itkConstSliceIterator.h.

References itk::ConstSliceIterator< TPixel, TContainer >::m_Pos, and itk::ConstSliceIterator< TPixel, TContainer >::m_Slice.

template<typename TPixel , typename TContainer >
const TPixel& itk::ConstSliceIterator< TPixel, TContainer >::Loc ( SizeValueType  n) const
inlineprivate
template<typename TPixel , typename TContainer >
bool itk::ConstSliceIterator< TPixel, TContainer >::operator!= ( const ConstSliceIterator< TPixel, TContainer > &  orig)
inline

Returns the logical inverse of the boolean == of two slice iterators.

Definition at line 117 of file itkConstSliceIterator.h.

References itk::ConstSliceIterator< TPixel, TContainer >::operator==().

template<typename TPixel , typename TContainer >
const TPixel& itk::ConstSliceIterator< TPixel, TContainer >::operator* ( )
inline

Dereferences the iterator, returning the value that it points to.

Definition at line 102 of file itkConstSliceIterator.h.

References itk::ConstSliceIterator< TPixel, TContainer >::Loc(), and itk::ConstSliceIterator< TPixel, TContainer >::m_Pos.

template<typename TPixel , typename TContainer >
ConstSliceIterator itk::ConstSliceIterator< TPixel, TContainer >::operator++ ( )
inline

Increments the iterator.

Definition at line 78 of file itkConstSliceIterator.h.

References itk::ConstSliceIterator< TPixel, TContainer >::m_Pos.

template<typename TPixel , typename TContainer >
ConstSliceIterator itk::ConstSliceIterator< TPixel, TContainer >::operator++ ( int  )
inline

Increments the iterator.

Definition at line 85 of file itkConstSliceIterator.h.

References itk::ConstSliceIterator< TPixel, TContainer >::m_Pos.

template<typename TPixel , typename TContainer >
bool itk::ConstSliceIterator< TPixel, TContainer >::operator< ( const ConstSliceIterator< TPixel, TContainer > &  orig)
inline

Returns the boolean < of two slice iterator positions. Result is only true if the slice iterators have the same stride and start location.

Definition at line 125 of file itkConstSliceIterator.h.

References itk::ConstSliceIterator< TPixel, TContainer >::m_Pos, and itk::ConstSliceIterator< TPixel, TContainer >::m_Slice.

template<typename TPixel , typename TContainer >
bool itk::ConstSliceIterator< TPixel, TContainer >::operator== ( const ConstSliceIterator< TPixel, TContainer > &  orig)
inline

Returns the logical && of the boolean == of two slice iterator positions, stride, and start locations.

Definition at line 109 of file itkConstSliceIterator.h.

References itk::ConstSliceIterator< TPixel, TContainer >::m_Pos, and itk::ConstSliceIterator< TPixel, TContainer >::m_Slice.

Referenced by itk::ConstSliceIterator< TPixel, TContainer >::operator!=().

template<typename TPixel , typename TContainer >
const TPixel& itk::ConstSliceIterator< TPixel, TContainer >::operator[] ( SizeValueType  n)
inline

Returns the element at position n of the slice. Sets the iterator to point to position n.

Definition at line 95 of file itkConstSliceIterator.h.

References itk::ConstSliceIterator< TPixel, TContainer >::Loc(), and itk::ConstSliceIterator< TPixel, TContainer >::m_Pos.

Member Data Documentation

template<typename TPixel , typename TContainer >
const TContainer* itk::ConstSliceIterator< TPixel, TContainer >::m_ContainerPointer
private

Pointer to the container referenced by the slice iterator.

Definition at line 140 of file itkConstSliceIterator.h.

Referenced by itk::ConstSliceIterator< TPixel, TContainer >::Loc().

template<typename TPixel , typename TContainer >
SizeValueType itk::ConstSliceIterator< TPixel, TContainer >::m_Pos
private
template<typename TPixel , typename TContainer >
std::slice itk::ConstSliceIterator< TPixel, TContainer >::m_Slice
private

The documentation for this class was generated from the following file:

Generated at Sat Mar 8 2014 16:49:35 for Orfeo Toolbox with doxygen 1.8.3.1