The Pedigree Project  0.1
Public Member Functions | Private Attributes | List of all members
IteratorAdapter< T, Iterator > Class Template Reference

IteratorAdapter reinterpret_casts an Iterators element to another type. More...

#include <IteratorAdapter.h>

+ Collaboration diagram for IteratorAdapter< T, Iterator >:

Public Member Functions

 IteratorAdapter ()
 
 IteratorAdapter (const Iterator &x)
 
template<typename T2 , class Iterator2 >
 IteratorAdapter (const IteratorAdapter< T2, Iterator2 > &x)
 
 IteratorAdapter (const IteratorAdapter &x)
 
 ~IteratorAdapter ()
 
IteratorAdapteroperator= (const IteratorAdapter &x)
 
template<typename T2 , class Iterator2 >
IteratorAdapteroperator= (const IteratorAdapter< T2, Iterator2 > &x)
 
bool operator== (const IteratorAdapter &x) const
 
IteratorAdapteroperator++ ()
 
IteratorAdapteroperator-- ()
 
T & operator* ()
 
T & operator-> ()
 
const Iterator__getIterator () const
 
Iterator__getIterator ()
 

Private Attributes

Iterator m_Iterator
 

Detailed Description

template<typename T, class Iterator>
class IteratorAdapter< T, Iterator >

IteratorAdapter reinterpret_casts an Iterators element to another type.

Adapter for an iterator with a different element type. The element type is reinterpret_cast'ed from the original iterator

Parameters
[in]Tthe new element type
[in]Iteratorthe type of the original iterator

Definition at line 32 of file IteratorAdapter.h.

Constructor & Destructor Documentation

template<typename T, class Iterator>
IteratorAdapter< T, Iterator >::IteratorAdapter ( )
inline

Default constructor

Definition at line 36 of file IteratorAdapter.h.

template<typename T, class Iterator>
IteratorAdapter< T, Iterator >::IteratorAdapter ( const Iterator x)
inline

Construct form an Iterator

Parameters
[in]xthe Iterator reference object

Definition at line 41 of file IteratorAdapter.h.

template<typename T, class Iterator>
template<typename T2 , class Iterator2 >
IteratorAdapter< T, Iterator >::IteratorAdapter ( const IteratorAdapter< T2, Iterator2 > &  x)
inline

Construct from another iterator compatible with Iterator

Parameters
[in]xthe reference object

Definition at line 47 of file IteratorAdapter.h.

template<typename T, class Iterator>
IteratorAdapter< T, Iterator >::IteratorAdapter ( const IteratorAdapter< T, Iterator > &  x)
inline

Copy-constructor

Parameters
[in]xreference object

Definition at line 53 of file IteratorAdapter.h.

template<typename T, class Iterator>
IteratorAdapter< T, Iterator >::~IteratorAdapter ( )
inline

The destructor

Definition at line 57 of file IteratorAdapter.h.

Member Function Documentation

template<typename T, class Iterator>
const Iterator& IteratorAdapter< T, Iterator >::__getIterator ( ) const
inline

Get a reference to the iterator

Note
not supposed to be used from the outside world!

Definition at line 114 of file IteratorAdapter.h.

References IteratorAdapter< T, Iterator >::m_Iterator.

Referenced by IteratorAdapter< T, Iterator >::operator=().

+ Here is the caller graph for this function:

template<typename T, class Iterator>
Iterator& IteratorAdapter< T, Iterator >::__getIterator ( )
inline

Get a reference to the iterator

Note
not supposed to be used from the outside world!

Definition at line 120 of file IteratorAdapter.h.

References IteratorAdapter< T, Iterator >::m_Iterator.

template<typename T, class Iterator>
T& IteratorAdapter< T, Iterator >::operator* ( )
inline

Dereference the iterator, aka get the element

Returns
the element the iterator points to

Definition at line 102 of file IteratorAdapter.h.

template<typename T, class Iterator>
IteratorAdapter& IteratorAdapter< T, Iterator >::operator++ ( )
inline

Go to the next element in the List

Returns
reference to this iterator

Definition at line 88 of file IteratorAdapter.h.

References IteratorAdapter< T, Iterator >::m_Iterator.

template<typename T, class Iterator>
IteratorAdapter& IteratorAdapter< T, Iterator >::operator-- ( )
inline

Go to the previous element in the List

Returns
reference to this iterator

Definition at line 95 of file IteratorAdapter.h.

References IteratorAdapter< T, Iterator >::m_Iterator.

template<typename T, class Iterator>
T& IteratorAdapter< T, Iterator >::operator-> ( )
inline

Dereference operator yields the element value

Definition at line 107 of file IteratorAdapter.h.

template<typename T, class Iterator>
IteratorAdapter& IteratorAdapter< T, Iterator >::operator= ( const IteratorAdapter< T, Iterator > &  x)
inline

Assignment operator

Parameters
[in]xreference object

Definition at line 63 of file IteratorAdapter.h.

References IteratorAdapter< T, Iterator >::m_Iterator.

template<typename T, class Iterator>
template<typename T2 , class Iterator2 >
IteratorAdapter& IteratorAdapter< T, Iterator >::operator= ( const IteratorAdapter< T2, Iterator2 > &  x)
inline

Assign from another iterator compatible with Iterator

Parameters
[in]xthe reference object

Definition at line 71 of file IteratorAdapter.h.

References IteratorAdapter< T, Iterator >::__getIterator(), and IteratorAdapter< T, Iterator >::m_Iterator.

template<typename T, class Iterator>
bool IteratorAdapter< T, Iterator >::operator== ( const IteratorAdapter< T, Iterator > &  x) const
inline

Comparison operator

Parameters
[in]xreference object
Returns
true, if the iterators point to the same object, false otherwise

Definition at line 80 of file IteratorAdapter.h.

References IteratorAdapter< T, Iterator >::m_Iterator.

Member Data Documentation

template<typename T, class Iterator>
Iterator IteratorAdapter< T, Iterator >::m_Iterator
private

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