claw::it_index< T > Class Template Reference

A class to manage an index and an iterator easily. More...

#include <it_index.hpp>

List of all members.

Public Member Functions

 it_index ()
 Constructor.
 it_index (const T &it, int index=0)
 Constructor.
 it_index (const it_index< T > &that)
 Copy constructor.
void set (const T &it, int index)
 Change the current pair.
bool operator< (const it_index< T > &that) const
bool operator< (const T &it) const
bool operator< (int index) const
bool operator<= (const it_index< T > &that) const
bool operator<= (const T &it) const
bool operator<= (int index) const
bool operator> (const it_index< T > &that) const
bool operator> (const T &it) const
bool operator> (int index) const
bool operator>= (const it_index< T > &that) const
bool operator>= (const T &it) const
bool operator>= (int index) const
bool operator== (const it_index< T > &that) const
bool operator== (const T &it) const
bool operator== (int index) const
bool operator!= (const it_index< T > &that) const
bool operator!= (const T &it) const
bool operator!= (int index) const
it_index< T > operator+ (int index) const
it_index< T > operator- (int index) const
it_index< T > operator* (int index) const
it_index< T > operator/ (int index) const
T::value_type operator* ()
it_index< T > & operator++ ()
it_index< T > operator++ (int)
it_index< T > & operator-- ()
it_index< T > operator-- (int)
it_index< T > & operator+= (int index)
it_index< T > & operator-= (int index)
it_index< T > & operator*= (int index)
it_index< T > & operator/= (int index)
 operator int () const
 operator T () const

Private Attributes

m_it
 Iterator.
int m_index
 Iterator's position.

Detailed Description

template<class T>
class claw::it_index< T >

A class to manage an index and an iterator easily.

Parameters:
T Type of the iterator.
Author:
Julien Jorge

Definition at line 42 of file it_index.hpp.


Constructor & Destructor Documentation

template<class T>
claw::it_index< T >::it_index (  )  [inline]

Constructor.

Definition at line 52 of file it_index.hpp.

00053       : m_it(), m_index()
00054     { }

template<class T>
claw::it_index< T >::it_index ( const T &  it,
int  index = 0 
) [inline]

Constructor.

Parameters:
it The iterator.
index Iterator's position.

Definition at line 61 of file it_index.hpp.

00062       : m_it(it), m_index(index)
00063     { }

template<class T>
claw::it_index< T >::it_index ( const it_index< T > &  that  )  [inline]

Copy constructor.

Parameters:
that it_index to copy from.

Definition at line 69 of file it_index.hpp.

00070       : m_it( that.m_it ), m_index( that.m_index )
00071     { }


Member Function Documentation

template<class T>
claw::it_index< T >::operator int (  )  const [inline]

Definition at line 186 of file it_index.hpp.

References claw::it_index< T >::m_index.

00186 { return m_index; }

template<class T>
claw::it_index< T >::operator T (  )  const [inline]

Definition at line 187 of file it_index.hpp.

References claw::it_index< T >::m_it.

00187 { return m_it; }

template<class T>
bool claw::it_index< T >::operator!= ( int  index  )  const [inline]

Definition at line 113 of file it_index.hpp.

References claw::it_index< T >::m_index.

00113 { return m_index!=index; }

template<class T>
bool claw::it_index< T >::operator!= ( const T &  it  )  const [inline]

Definition at line 112 of file it_index.hpp.

References claw::it_index< T >::m_it.

00112 { return m_it != it; }

template<class T>
bool claw::it_index< T >::operator!= ( const it_index< T > &  that  )  const [inline]

Definition at line 110 of file it_index.hpp.

00111     { return !(*this == *that); }

template<class T>
T::value_type claw::it_index< T >::operator* (  )  [inline]

Definition at line 124 of file it_index.hpp.

References claw::it_index< T >::m_it.

00124 { return *m_it; }

template<class T>
it_index<T> claw::it_index< T >::operator* ( int  index  )  const [inline]

Definition at line 119 of file it_index.hpp.

References claw::it_index< T >::m_index, and claw::it_index< T >::m_it.

00120     { return it_index<T>(m_it + (index-1) * m_index, m_index * index); }

template<class T>
it_index<T>& claw::it_index< T >::operator*= ( int  index  )  [inline]

Definition at line 172 of file it_index.hpp.

References claw::it_index< T >::m_index, and claw::it_index< T >::m_it.

00173     { 
00174       m_it += (index-1) * m_index;
00175       m_index *= index;
00176       return *this;
00177     }

template<class T>
it_index<T> claw::it_index< T >::operator+ ( int  index  )  const [inline]

Definition at line 115 of file it_index.hpp.

References claw::it_index< T >::m_index, and claw::it_index< T >::m_it.

00116     { return it_index<T>(m_it + index, m_index + index); }

template<class T>
it_index<T> claw::it_index< T >::operator++ ( int   )  [inline]

Definition at line 135 of file it_index.hpp.

00136     {
00137       it_index<T> r(*this);
00138       ++(this);
00139       return r;
00140     }

template<class T>
it_index<T>& claw::it_index< T >::operator++ (  )  [inline]

Definition at line 127 of file it_index.hpp.

References claw::it_index< T >::m_index, and claw::it_index< T >::m_it.

00128     {
00129       ++m_it;
00130       ++m_index;
00131       return *this;
00132     }

template<class T>
it_index<T>& claw::it_index< T >::operator+= ( int  index  )  [inline]

Definition at line 158 of file it_index.hpp.

References claw::it_index< T >::m_index, and claw::it_index< T >::m_it.

00159     { 
00160       m_it += index;
00161       m_index += index;
00162       return *this;
00163     }

template<class T>
it_index<T> claw::it_index< T >::operator- ( int  index  )  const [inline]

Definition at line 117 of file it_index.hpp.

References claw::it_index< T >::m_index, and claw::it_index< T >::m_it.

00118     { return it_index<T>(m_it - index, m_index - index); }

template<class T>
it_index<T> claw::it_index< T >::operator-- ( int   )  [inline]

Definition at line 151 of file it_index.hpp.

00152     {
00153       it_index<T> r(*this);
00154       --(this);
00155       return r;
00156     }

template<class T>
it_index<T>& claw::it_index< T >::operator-- (  )  [inline]

Definition at line 143 of file it_index.hpp.

References claw::it_index< T >::m_index, and claw::it_index< T >::m_it.

00144     {
00145       --m_it;
00146       --m_index;
00147       return *this;
00148     }

template<class T>
it_index<T>& claw::it_index< T >::operator-= ( int  index  )  [inline]

Definition at line 165 of file it_index.hpp.

References claw::it_index< T >::m_index, and claw::it_index< T >::m_it.

00166     { 
00167       m_it -= index;
00168       m_index -= index;
00169       return *this;
00170     }

template<class T>
it_index<T> claw::it_index< T >::operator/ ( int  index  )  const [inline]

Definition at line 121 of file it_index.hpp.

References claw::it_index< T >::m_index, and claw::it_index< T >::m_it.

00122     { return it_index<T>(m_it - (m_index - m_index/index), m_index / index); }

template<class T>
it_index<T>& claw::it_index< T >::operator/= ( int  index  )  [inline]

Definition at line 179 of file it_index.hpp.

References claw::it_index< T >::m_index, and claw::it_index< T >::m_it.

00180     { 
00181       m_it -= m_index - m_index/index;
00182       m_index /= index;
00183       return *this;
00184     }

template<class T>
bool claw::it_index< T >::operator< ( int  index  )  const [inline]

Definition at line 88 of file it_index.hpp.

References claw::it_index< T >::m_index.

00088 { return m_index < index; }

template<class T>
bool claw::it_index< T >::operator< ( const T &  it  )  const [inline]

Definition at line 87 of file it_index.hpp.

References claw::it_index< T >::m_it.

00087 { return m_it < it; }

template<class T>
bool claw::it_index< T >::operator< ( const it_index< T > &  that  )  const [inline]

Definition at line 84 of file it_index.hpp.

References claw::it_index< T >::m_index.

00085     { return m_index < that.m_index; }

template<class T>
bool claw::it_index< T >::operator<= ( int  index  )  const [inline]

Definition at line 93 of file it_index.hpp.

References claw::it_index< T >::m_index.

00093 { return m_index <= index; }

template<class T>
bool claw::it_index< T >::operator<= ( const T &  it  )  const [inline]

Definition at line 92 of file it_index.hpp.

References claw::it_index< T >::m_it.

00092 { return m_it <= it; }

template<class T>
bool claw::it_index< T >::operator<= ( const it_index< T > &  that  )  const [inline]

Definition at line 90 of file it_index.hpp.

00091     { return (*this < that) || (*this == that); }

template<class T>
bool claw::it_index< T >::operator== ( int  index  )  const [inline]

Definition at line 108 of file it_index.hpp.

References claw::it_index< T >::m_index.

00108 { return m_index==index; }

template<class T>
bool claw::it_index< T >::operator== ( const T &  it  )  const [inline]

Definition at line 107 of file it_index.hpp.

References claw::it_index< T >::m_it.

00107 { return m_it == it; }

template<class T>
bool claw::it_index< T >::operator== ( const it_index< T > &  that  )  const [inline]

Definition at line 105 of file it_index.hpp.

References claw::it_index< T >::m_index, and claw::it_index< T >::m_it.

00106     { return (m_it == that.m_it) && (m_index == that.m_index); }

template<class T>
bool claw::it_index< T >::operator> ( int  index  )  const [inline]

Definition at line 98 of file it_index.hpp.

References claw::it_index< T >::m_index.

00098 { return m_index > index; }

template<class T>
bool claw::it_index< T >::operator> ( const T &  it  )  const [inline]

Definition at line 97 of file it_index.hpp.

References claw::it_index< T >::m_it.

00097 { return m_it > it; }

template<class T>
bool claw::it_index< T >::operator> ( const it_index< T > &  that  )  const [inline]

Definition at line 95 of file it_index.hpp.

References claw::it_index< T >::m_index.

00096     { return m_index > that.m_index; }

template<class T>
bool claw::it_index< T >::operator>= ( int  index  )  const [inline]

Definition at line 103 of file it_index.hpp.

References claw::it_index< T >::m_index.

00103 { return m_index >= index; }

template<class T>
bool claw::it_index< T >::operator>= ( const T &  it  )  const [inline]

Definition at line 102 of file it_index.hpp.

References claw::it_index< T >::m_it.

00102 { return m_it >= it; }

template<class T>
bool claw::it_index< T >::operator>= ( const it_index< T > &  that  )  const [inline]

Definition at line 100 of file it_index.hpp.

00101     { return (*this > that) || (*this == that); }

template<class T>
void claw::it_index< T >::set ( const T &  it,
int  index 
) [inline]

Change the current pair.

Parameters:
it The new iterator.
index New iterator's position.

Definition at line 78 of file it_index.hpp.

References claw::it_index< T >::m_index, and claw::it_index< T >::m_it.

Referenced by claw::text::kmp< RandomIterator >::operator()().

00079     {
00080       m_it = it;
00081       m_index = index;
00082     }


Member Data Documentation

template<class T>
int claw::it_index< T >::m_index [private]
template<class T>
T claw::it_index< T >::m_it [private]

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

Generated on 9 Nov 2009 for CLAW Library (a C++ Library Absolutely Wonderful) by  doxygen 1.6.1