Main Page   Modules   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Subiterator Class Template Reference

#include <subiterator.h>

List of all members.


Detailed Description

template<typename Iterator>
class LinBox::Subiterator< Iterator >

Subvector iterator class provides striding iterators. A Subiterator steps by a fixed stride thru the underlying container. Subiter<Iterator> requires that Iterator be a random access iterator class and then itself provides the full functionality of a random access iterator class. See STL documentation for that functionality. Documented here is only the constructor from (1) an iterator of an underlying container and (2) a stride amount.


Public Types

typedef std::iterator_traits<
Iterator >::iterator_category 
iterator_category
typedef std::iterator_traits<
Iterator >::value_type 
value_type
typedef std::iterator_traits<
Iterator >::difference_type 
difference_type
typedef std::iterator_traits<
Iterator >::pointer 
pointer
typedef std::iterator_traits<
Iterator >::reference 
reference

Public Methods

 Subiterator ()
 Subiterator (const Iterator &iter, const difference_type &stride=1)
template<class Iterator2>  Subiterator (const Subiterator< Iterator2 > &iter)
template<class Iterator2> Subiterator & operator= (const Subiterator< Iterator2 > &sub)
reference operator * () const
Iterator operator-> () const
reference operator[] (difference_type n) const
Subiterator & operator++ ()
Subiterator operator++ (int)
Subiterator & operator-- ()
Subiterator operator-- (int)
Subiterator operator+ (difference_type n) const
Subiterator & operator+= (difference_type n)
Subiterator operator- (difference_type n) const
difference_type operator- (const Subiterator &x) const
Subiterator & operator-= (difference_type n)
bool operator== (const Subiterator &i) const
bool operator!= (const Subiterator &i) const
bool operator< (const Subiterator &i) const
bool operator> (const Subiterator &i) const
bool operator<= (const Subiterator &i) const
bool operator>= (const Subiterator &i) const
void swap (Subiterator &x)

Protected Attributes

Iterator _iter
difference_type _stride


Member Typedef Documentation

typedef std::iterator_traits<Iterator>::difference_type difference_type
 

typedef std::iterator_traits<Iterator>::iterator_category iterator_category
 

typedef std::iterator_traits<Iterator>::pointer pointer
 

typedef std::iterator_traits<Iterator>::reference reference
 

typedef std::iterator_traits<Iterator>::value_type value_type
 


Constructor & Destructor Documentation

Subiterator   [inline]
 

Subiterator const Iterator &    iter,
const difference_type   stride = 1
[inline]
 

Subiterator p (pp, 3) provides an iterator which initially has the same reference, but for which increments and offsets step by the amount stride rather than 1. Thus p+k is equivalent to pp+(stride*k).

Striding iterators are easily positioned beyond the bounds of the underlying container. It is up to the user to dereference the iterator only when it has a valid reference.

Subiterator const Subiterator< Iterator2 > &    iter [inline]
 


Member Function Documentation

reference operator *   const [inline]
 

bool operator!= const Subiterator< Iterator > &    i const [inline]
 

Subiterator operator+ difference_type    n const [inline]
 

Subiterator operator++ int    [inline]
 

Subiterator& operator++   [inline]
 

Subiterator& operator+= difference_type    n [inline]
 

difference_type operator- const Subiterator< Iterator > &    x const [inline]
 

Subiterator operator- difference_type    n const [inline]
 

Subiterator operator-- int    [inline]
 

Subiterator& operator--   [inline]
 

Subiterator& operator-= difference_type    n [inline]
 

Iterator operator->   const [inline]
 

bool operator< const Subiterator< Iterator > &    i const [inline]
 

bool operator<= const Subiterator< Iterator > &    i const [inline]
 

Subiterator& operator= const Subiterator< Iterator2 > &    sub [inline]
 

bool operator== const Subiterator< Iterator > &    i const [inline]
 

bool operator> const Subiterator< Iterator > &    i const [inline]
 

bool operator>= const Subiterator< Iterator > &    i const [inline]
 

reference operator[] difference_type    n const [inline]
 

void swap Subiterator< Iterator > &    x [inline]
 


Member Data Documentation

Iterator _iter [protected]
 

difference_type _stride [protected]
 


Generated on Mon Jun 20 09:16:56 2005 for linbox by doxygen1.2.18