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)
self_typeoperator++ ()
self_type operator++ (int)
self_typeoperator-- ()
self_type operator-- (int)
reference operator* ()
pointer operator-> ()
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 193 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 198 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 203 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 200 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 201 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 208 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 199 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 211 of file iterator.hpp.

00211 {}

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 212 of file iterator.hpp.

00213       : m_it(it)
00214     { }

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 215 of file iterator.hpp.

00216       : m_it(it), m_fun(f)
00217     { }


Member Function Documentation

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 251 of file iterator.hpp.

00251 { 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 249 of file iterator.hpp.

References m_it.

00249 { 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* (  )  [inline]

Definition at line 245 of file iterator.hpp.

00245 { 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 263 of file iterator.hpp.

00264     {
00265       self_type result(*this);
00266       result += n;
00267       return result;
00268     }

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 225 of file iterator.hpp.

00226     {
00227       self_type tmp(*this);
00228       ++m_it;
00229       return tmp;
00230     }

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 219 of file iterator.hpp.

00220     {
00221       ++m_it;
00222       return *this;
00223     }

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 257 of file iterator.hpp.

00258     {
00259       m_it += n;
00260       return *this;
00261     }

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 272 of file iterator.hpp.

00273     {
00274       self_type result(*this);
00275       result -= n;
00276       return result;
00277     }

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 238 of file iterator.hpp.

00239     {
00240       self_type tmp(*this);
00241       --m_it;
00242       return tmp;
00243     }

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 232 of file iterator.hpp.

00233     {
00234       --m_it;
00235       return *this;
00236     }

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 270 of file iterator.hpp.

00270 { 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-> (  )  [inline]

Definition at line 246 of file iterator.hpp.

00246 { 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 252 of file iterator.hpp.

References m_it.

00252 { 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 253 of file iterator.hpp.

References m_it.

00253 { 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 250 of file iterator.hpp.

00250 { 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 248 of file iterator.hpp.

References m_it.

00248 { 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 254 of file iterator.hpp.

References m_it.

00254 { 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 255 of file iterator.hpp.

References m_it.

00255 { 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 279 of file iterator.hpp.

00279 { 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 286 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 283 of file iterator.hpp.

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


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