CLAW Library (a C++ Library Absolutely Wonderful) 1.5.5
Public Types | Public Member Functions | Private Attributes
claw::wrapped_iterator_by_category< std::random_access_iterator_tag, Value, Iterator, Function > Class Template Reference

Base class for wrapped iterators, specialized for random iterators. More...

#include <iterator.hpp>

List of all members.

Public Types

typedef std::iterator_traits
< Iterator >::difference_type 
difference_type
typedef Value value_type
typedef value_typepointer
typedef value_typereference
typedef std::iterator_traits
< Iterator >
::iterator_category 
iterator_category
typedef
wrapped_iterator_by_category
< std::random_access_iterator_tag,
Value, Iterator, Function > 
self_type

Public Member Functions

 wrapped_iterator_by_category ()
 wrapped_iterator_by_category (const Iterator &it)
 wrapped_iterator_by_category (const Iterator &it, const Function &f)
template<typename V , typename I >
 wrapped_iterator_by_category (const wrapped_iterator_by_category< std::random_access_iterator_tag, V, I, Function > &that)
template<typename C , typename V , typename I , typename F >
 wrapped_iterator_by_category (const wrapped_iterator_by_category< C, V, I, F > &that)
const Iterator & get_iterator () const
const Function & get_function () const
self_typeoperator++ ()
self_type operator++ (int)
self_typeoperator-- ()
self_type operator-- (int)
reference operator* () const
pointer operator-> () const
bool operator== (const self_type &that) const
bool operator!= (const self_type &that) const
bool operator== (const Iterator &it) const
bool operator!= (const Iterator &it) const
bool operator< (const self_type &that) const
bool operator<= (const self_type &that) const
bool operator> (const self_type &that) const
bool operator>= (const self_type &that) const
self_typeoperator+= (int n)
self_type operator+ (int n) const
self_typeoperator-= (int n)
self_type operator- (int n) const
reference operator[] (int n)

Private Attributes

Iterator m_it
 The effective iterator.
Function m_fun
 The function applied to the pointed items.

Detailed Description

template<typename Value, typename Iterator, typename Function>
class claw::wrapped_iterator_by_category< std::random_access_iterator_tag, Value, Iterator, Function >

Base class for wrapped iterators, specialized for random iterators.

Author:
Julien Jorge

Definition at line 209 of file iterator.hpp.


Member Typedef Documentation

template<typename Value , typename Iterator , typename Function >
typedef std::iterator_traits<Iterator>::difference_type claw::wrapped_iterator_by_category< std::random_access_iterator_tag, Value, Iterator, Function >::difference_type

Definition at line 214 of file iterator.hpp.

template<typename Value , typename Iterator , typename Function >
typedef std::iterator_traits<Iterator>::iterator_category claw::wrapped_iterator_by_category< std::random_access_iterator_tag, Value, Iterator, Function >::iterator_category

Definition at line 219 of file iterator.hpp.

template<typename Value , typename Iterator , typename Function >
typedef value_type* claw::wrapped_iterator_by_category< std::random_access_iterator_tag, Value, Iterator, Function >::pointer

Definition at line 216 of file iterator.hpp.

template<typename Value , typename Iterator , typename Function >
typedef value_type& claw::wrapped_iterator_by_category< std::random_access_iterator_tag, Value, Iterator, Function >::reference

Definition at line 217 of file iterator.hpp.

template<typename Value , typename Iterator , typename Function >
typedef wrapped_iterator_by_category<std::random_access_iterator_tag, Value, Iterator, Function> claw::wrapped_iterator_by_category< std::random_access_iterator_tag, Value, Iterator, Function >::self_type

Definition at line 224 of file iterator.hpp.

template<typename Value , typename Iterator , typename Function >
typedef Value claw::wrapped_iterator_by_category< std::random_access_iterator_tag, Value, Iterator, Function >::value_type

Definition at line 215 of file iterator.hpp.


Constructor & Destructor Documentation

template<typename Value , typename Iterator , typename Function >
claw::wrapped_iterator_by_category< std::random_access_iterator_tag, Value, Iterator, Function >::wrapped_iterator_by_category ( ) [inline]

Definition at line 227 of file iterator.hpp.

{}
template<typename Value , typename Iterator , typename Function >
claw::wrapped_iterator_by_category< std::random_access_iterator_tag, Value, Iterator, Function >::wrapped_iterator_by_category ( const Iterator &  it) [inline]

Definition at line 228 of file iterator.hpp.

      : m_it(it)
    { }
template<typename Value , typename Iterator , typename Function >
claw::wrapped_iterator_by_category< std::random_access_iterator_tag, Value, Iterator, Function >::wrapped_iterator_by_category ( const Iterator &  it,
const Function &  f 
) [inline]

Definition at line 231 of file iterator.hpp.

      : m_it(it), m_fun(f)
    { }
template<typename Value , typename Iterator , typename Function >
template<typename V , typename I >
claw::wrapped_iterator_by_category< std::random_access_iterator_tag, Value, Iterator, Function >::wrapped_iterator_by_category ( const wrapped_iterator_by_category< std::random_access_iterator_tag, V, I, Function > &  that) [inline]

Definition at line 236 of file iterator.hpp.

      : m_it(that.m_it), m_fun(that.m_fun)
    { }
template<typename Value , typename Iterator , typename Function >
template<typename C , typename V , typename I , typename F >
claw::wrapped_iterator_by_category< std::random_access_iterator_tag, Value, Iterator, Function >::wrapped_iterator_by_category ( const wrapped_iterator_by_category< C, V, I, F > &  that) [inline]

Definition at line 242 of file iterator.hpp.

      : m_it(that.get_iterator()), m_fun(that.get_function())
    { }

Member Function Documentation

template<typename Value , typename Iterator , typename Function >
const Function& claw::wrapped_iterator_by_category< std::random_access_iterator_tag, Value, Iterator, Function >::get_function ( ) const [inline]

Definition at line 247 of file iterator.hpp.

{ return m_fun; }
template<typename Value , typename Iterator , typename Function >
const Iterator& claw::wrapped_iterator_by_category< std::random_access_iterator_tag, Value, Iterator, Function >::get_iterator ( ) const [inline]

Definition at line 246 of file iterator.hpp.

{ return m_it; }
template<typename Value , typename Iterator , typename Function >
bool claw::wrapped_iterator_by_category< std::random_access_iterator_tag, Value, Iterator, Function >::operator!= ( const self_type that) const [inline]

Definition at line 279 of file iterator.hpp.

References m_it.

{ return m_it != that.m_it; }
template<typename Value , typename Iterator , typename Function >
bool claw::wrapped_iterator_by_category< std::random_access_iterator_tag, Value, Iterator, Function >::operator!= ( const Iterator &  it) const [inline]

Definition at line 281 of file iterator.hpp.

{ return m_it != it; }
template<typename Value , typename Iterator , typename Function >
reference claw::wrapped_iterator_by_category< std::random_access_iterator_tag, Value, Iterator, Function >::operator* ( ) const [inline]

Definition at line 275 of file iterator.hpp.

{ return m_fun(*m_it); }
template<typename Value , typename Iterator , typename Function >
self_type claw::wrapped_iterator_by_category< std::random_access_iterator_tag, Value, Iterator, Function >::operator+ ( int  n) const [inline]

Definition at line 293 of file iterator.hpp.

    {
      self_type result(*this);
      result += n;
      return result;
    }
template<typename Value , typename Iterator , typename Function >
self_type claw::wrapped_iterator_by_category< std::random_access_iterator_tag, Value, Iterator, Function >::operator++ ( int  ) [inline]

Definition at line 255 of file iterator.hpp.

    {
      self_type tmp(*this);
      ++m_it;
      return tmp;
    }
template<typename Value , typename Iterator , typename Function >
self_type& claw::wrapped_iterator_by_category< std::random_access_iterator_tag, Value, Iterator, Function >::operator++ ( ) [inline]

Definition at line 249 of file iterator.hpp.

    {
      ++m_it;
      return *this;
    }
template<typename Value , typename Iterator , typename Function >
self_type& claw::wrapped_iterator_by_category< std::random_access_iterator_tag, Value, Iterator, Function >::operator+= ( int  n) [inline]

Definition at line 287 of file iterator.hpp.

    {
      m_it += n;
      return *this;
    }
template<typename Value , typename Iterator , typename Function >
self_type claw::wrapped_iterator_by_category< std::random_access_iterator_tag, Value, Iterator, Function >::operator- ( int  n) const [inline]

Definition at line 302 of file iterator.hpp.

    {
      self_type result(*this);
      result -= n;
      return result;
    }
template<typename Value , typename Iterator , typename Function >
self_type& claw::wrapped_iterator_by_category< std::random_access_iterator_tag, Value, Iterator, Function >::operator-- ( ) [inline]

Definition at line 262 of file iterator.hpp.

    {
      --m_it;
      return *this;
    }
template<typename Value , typename Iterator , typename Function >
self_type claw::wrapped_iterator_by_category< std::random_access_iterator_tag, Value, Iterator, Function >::operator-- ( int  ) [inline]

Definition at line 268 of file iterator.hpp.

    {
      self_type tmp(*this);
      --m_it;
      return tmp;
    }
template<typename Value , typename Iterator , typename Function >
self_type& claw::wrapped_iterator_by_category< std::random_access_iterator_tag, Value, Iterator, Function >::operator-= ( int  n) [inline]

Definition at line 300 of file iterator.hpp.

{ return *this += -n; }
template<typename Value , typename Iterator , typename Function >
pointer claw::wrapped_iterator_by_category< std::random_access_iterator_tag, Value, Iterator, Function >::operator-> ( ) const [inline]

Definition at line 276 of file iterator.hpp.

{ return &m_fun(*m_it); }
template<typename Value , typename Iterator , typename Function >
bool claw::wrapped_iterator_by_category< std::random_access_iterator_tag, Value, Iterator, Function >::operator< ( const self_type that) const [inline]

Definition at line 282 of file iterator.hpp.

References m_it.

{ return m_it < that.m_it; }
template<typename Value , typename Iterator , typename Function >
bool claw::wrapped_iterator_by_category< std::random_access_iterator_tag, Value, Iterator, Function >::operator<= ( const self_type that) const [inline]

Definition at line 283 of file iterator.hpp.

References m_it.

{ return m_it <= that.m_it; }
template<typename Value , typename Iterator , typename Function >
bool claw::wrapped_iterator_by_category< std::random_access_iterator_tag, Value, Iterator, Function >::operator== ( const self_type that) const [inline]

Definition at line 278 of file iterator.hpp.

References m_it.

{ return m_it == that.m_it; }
template<typename Value , typename Iterator , typename Function >
bool claw::wrapped_iterator_by_category< std::random_access_iterator_tag, Value, Iterator, Function >::operator== ( const Iterator &  it) const [inline]

Definition at line 280 of file iterator.hpp.

{ return m_it == it; }
template<typename Value , typename Iterator , typename Function >
bool claw::wrapped_iterator_by_category< std::random_access_iterator_tag, Value, Iterator, Function >::operator> ( const self_type that) const [inline]

Definition at line 284 of file iterator.hpp.

References m_it.

{ return m_it > that.m_it; }
template<typename Value , typename Iterator , typename Function >
bool claw::wrapped_iterator_by_category< std::random_access_iterator_tag, Value, Iterator, Function >::operator>= ( const self_type that) const [inline]

Definition at line 285 of file iterator.hpp.

References m_it.

{ return m_it >= that.m_it; }
template<typename Value , typename Iterator , typename Function >
reference claw::wrapped_iterator_by_category< std::random_access_iterator_tag, Value, Iterator, Function >::operator[] ( int  n) [inline]

Definition at line 309 of file iterator.hpp.

{ return m_fun(m_it[n]); }

Member Data Documentation

template<typename Value , typename Iterator , typename Function >
Function claw::wrapped_iterator_by_category< std::random_access_iterator_tag, Value, Iterator, Function >::m_fun [private]

The function applied to the pointed items.

Definition at line 316 of file iterator.hpp.

template<typename Value , typename Iterator , typename Function >
Iterator claw::wrapped_iterator_by_category< std::random_access_iterator_tag, Value, Iterator, Function >::m_it [private]

The effective iterator.

Definition at line 313 of file iterator.hpp.

Referenced by operator!=(), operator<(), operator<=(), operator==(), operator>(), and operator>=().


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