The Pedigree Project  0.1
Public Types | Public Member Functions | Protected Attributes | Friends | List of all members
Iterator< originalT, Struct, FunctionPrev, FunctionNext, T > Class Template Reference

An iterator applicable for many data structures. More...

#include <Iterator.h>

+ Collaboration diagram for Iterator< originalT, Struct, FunctionPrev, FunctionNext, T >:

Public Types

typedef Iterator< originalT, Struct, FunctionPrev, FunctionNext, T const > Const
 
typedef Iterator< originalT, Struct, FunctionNext, FunctionPrev, T > Reverse
 
typedef Iterator< originalT, Struct, FunctionNext, FunctionPrev, T const > ConstReverse
 

Public Member Functions

 Iterator ()
 
 Iterator (const Iterator &x)
 
template<typename T2 >
 Iterator (const Iterator< originalT, Struct, FunctionPrev, FunctionNext, T2 > &x)
 
 Iterator (Struct *Node)
 
 ~Iterator ()
 
Iteratoroperator= (const Iterator &x)
 
Iteratoroperator++ ()
 
Iteratoroperator-- ()
 
T & operator* ()
 
T & operator-> ()
 
 operator Const ()
 
Struct * __getNode ()
 

Protected Attributes

Struct * m_Node
 
m_Default
 

Friends

template<typename _originalT , class _Struct , _Struct *(_Struct::*)() _FunctionPrev, _Struct *(_Struct::*)() _FunctionNext, typename _T >
class Iterator
 
template<typename _originalT , class _Struct , _Struct *(_Struct::*)() _FunctionPrev, _Struct *(_Struct::*)() _FunctionNext, typename _T1 , typename _T2 >
bool operator== (const Iterator< _originalT, _Struct, _FunctionPrev, _FunctionNext, _T1 > &x1, const Iterator< _originalT, _Struct, _FunctionPrev, _FunctionNext, _T2 > &x2)
 

Detailed Description

template<typename originalT, class Struct, Struct *(Struct::*)() FunctionPrev = &Struct::previous, Struct *(Struct::*)() FunctionNext = &Struct::next, typename T = originalT>
class Iterator< originalT, Struct, FunctionPrev, FunctionNext, T >

An iterator applicable for many data structures.

General iterator for structures that provide functions for the next and previous structure in the datastructure and a "value" member. This template provides a bidirectional, a constant bidirectional, a reverse bidirectional and a constant reverse bidirectional iterator.

Parameters
[in]originalTthe original element type of the iterator
[in]Structthe datastructure that provides functions for the next/previous datastructure and a "value" member
[in]previouspointer to the member function used to iterate forward
[in]nextpointer to the member function used to iterate backwards
[in]Tthe real element type of the iterator

Definition at line 43 of file Iterator.h.

Member Typedef Documentation

template<typename originalT, class Struct, Struct *(Struct::*)() FunctionPrev = &Struct::previous, Struct *(Struct::*)() FunctionNext = &Struct::next, typename T = originalT>
typedef Iterator<originalT, Struct, FunctionPrev, FunctionNext, T const> Iterator< originalT, Struct, FunctionPrev, FunctionNext, T >::Const

Type of the constant bidirectional iterator

Definition at line 67 of file Iterator.h.

template<typename originalT, class Struct, Struct *(Struct::*)() FunctionPrev = &Struct::previous, Struct *(Struct::*)() FunctionNext = &Struct::next, typename T = originalT>
typedef Iterator<originalT, Struct, FunctionNext, FunctionPrev, T const> Iterator< originalT, Struct, FunctionPrev, FunctionNext, T >::ConstReverse

Type of the constant reverse iterator

Definition at line 72 of file Iterator.h.

template<typename originalT, class Struct, Struct *(Struct::*)() FunctionPrev = &Struct::previous, Struct *(Struct::*)() FunctionNext = &Struct::next, typename T = originalT>
typedef Iterator<originalT, Struct, FunctionNext, FunctionPrev, T> Iterator< originalT, Struct, FunctionPrev, FunctionNext, T >::Reverse

Type of the reverse iterator

Definition at line 69 of file Iterator.h.

Constructor & Destructor Documentation

template<typename originalT, class Struct, Struct *(Struct::*)() FunctionPrev = &Struct::previous, Struct *(Struct::*)() FunctionNext = &Struct::next, typename T = originalT>
Iterator< originalT, Struct, FunctionPrev, FunctionNext, T >::Iterator ( )
inline

The default constructor constructs an invalid/unusable iterator

Definition at line 75 of file Iterator.h.

template<typename originalT, class Struct, Struct *(Struct::*)() FunctionPrev = &Struct::previous, Struct *(Struct::*)() FunctionNext = &Struct::next, typename T = originalT>
Iterator< originalT, Struct, FunctionPrev, FunctionNext, T >::Iterator ( const Iterator< originalT, Struct, FunctionPrev, FunctionNext, T > &  x)
inline

The copy-constructor

Parameters
[in]Iteratorthe reference object

Definition at line 80 of file Iterator.h.

template<typename originalT, class Struct, Struct *(Struct::*)() FunctionPrev = &Struct::previous, Struct *(Struct::*)() FunctionNext = &Struct::next, typename T = originalT>
template<typename T2 >
Iterator< originalT, Struct, FunctionPrev, FunctionNext, T >::Iterator ( const Iterator< originalT, Struct, FunctionPrev, FunctionNext, T2 > &  x)
inline

The constructor

Parameters
[in]Iteratorthe reference object

Definition at line 86 of file Iterator.h.

template<typename originalT, class Struct, Struct *(Struct::*)() FunctionPrev = &Struct::previous, Struct *(Struct::*)() FunctionNext = &Struct::next, typename T = originalT>
Iterator< originalT, Struct, FunctionPrev, FunctionNext, T >::Iterator ( Struct *  Node)
inline

Constructor from a pointer to an instance of the data structure

Parameters
[in]Nodepointer to an instance of the data structure

Definition at line 93 of file Iterator.h.

template<typename originalT, class Struct, Struct *(Struct::*)() FunctionPrev = &Struct::previous, Struct *(Struct::*)() FunctionNext = &Struct::next, typename T = originalT>
Iterator< originalT, Struct, FunctionPrev, FunctionNext, T >::~Iterator ( )
inline

The destructor does nothing

Definition at line 97 of file Iterator.h.

Member Function Documentation

template<typename originalT, class Struct, Struct *(Struct::*)() FunctionPrev = &Struct::previous, Struct *(Struct::*)() FunctionNext = &Struct::next, typename T = originalT>
Struct* Iterator< originalT, Struct, FunctionPrev, FunctionNext, T >::__getNode ( )
inline
template<typename originalT, class Struct, Struct *(Struct::*)() FunctionPrev = &Struct::previous, Struct *(Struct::*)() FunctionNext = &Struct::next, typename T = originalT>
Iterator< originalT, Struct, FunctionPrev, FunctionNext, T >::operator Const ( )
inline

Conversion Operator to a constant iterator

Definition at line 145 of file Iterator.h.

References Iterator< originalT, Struct, FunctionPrev, FunctionNext, T >::m_Node.

template<typename originalT, class Struct, Struct *(Struct::*)() FunctionPrev = &Struct::previous, Struct *(Struct::*)() FunctionNext = &Struct::next, typename T = originalT>
T& Iterator< originalT, Struct, FunctionPrev, FunctionNext, T >::operator* ( )
inline
template<typename originalT, class Struct, Struct *(Struct::*)() FunctionPrev = &Struct::previous, Struct *(Struct::*)() FunctionNext = &Struct::next, typename T = originalT>
Iterator& Iterator< originalT, Struct, FunctionPrev, FunctionNext, T >::operator++ ( )
inline

Preincrement operator

Definition at line 110 of file Iterator.h.

References Iterator< originalT, Struct, FunctionPrev, FunctionNext, T >::m_Node.

template<typename originalT, class Struct, Struct *(Struct::*)() FunctionPrev = &Struct::previous, Struct *(Struct::*)() FunctionNext = &Struct::next, typename T = originalT>
Iterator& Iterator< originalT, Struct, FunctionPrev, FunctionNext, T >::operator-- ( )
inline

Predecrement operator

Definition at line 117 of file Iterator.h.

References Iterator< originalT, Struct, FunctionPrev, FunctionNext, T >::m_Node.

template<typename originalT, class Struct, Struct *(Struct::*)() FunctionPrev = &Struct::previous, Struct *(Struct::*)() FunctionNext = &Struct::next, typename T = originalT>
T& Iterator< originalT, Struct, FunctionPrev, FunctionNext, T >::operator-> ( )
inline

Dereference operator yields the element value

Definition at line 139 of file Iterator.h.

template<typename originalT, class Struct, Struct *(Struct::*)() FunctionPrev = &Struct::previous, Struct *(Struct::*)() FunctionNext = &Struct::next, typename T = originalT>
Iterator& Iterator< originalT, Struct, FunctionPrev, FunctionNext, T >::operator= ( const Iterator< originalT, Struct, FunctionPrev, FunctionNext, T > &  x)
inline

The assignment operator

Parameters
[in]Iteratorthe reference object

Definition at line 103 of file Iterator.h.

References Iterator< originalT, Struct, FunctionPrev, FunctionNext, T >::m_Default, and Iterator< originalT, Struct, FunctionPrev, FunctionNext, T >::m_Node.

Friends And Related Function Documentation

template<typename originalT, class Struct, Struct *(Struct::*)() FunctionPrev = &Struct::previous, Struct *(Struct::*)() FunctionNext = &Struct::next, typename T = originalT>
template<typename _originalT , class _Struct , _Struct *(_Struct::*)() _FunctionPrev, _Struct *(_Struct::*)() _FunctionNext, typename _T >
friend class Iterator
friend

All iterators must be friend in order to allow casts between some iterator types

Definition at line 51 of file Iterator.h.

template<typename originalT, class Struct, Struct *(Struct::*)() FunctionPrev = &Struct::previous, Struct *(Struct::*)() FunctionNext = &Struct::next, typename T = originalT>
template<typename _originalT , class _Struct , _Struct *(_Struct::*)() _FunctionPrev, _Struct *(_Struct::*)() _FunctionNext, typename _T1 , typename _T2 >
bool operator== ( const Iterator< _originalT, _Struct, _FunctionPrev, _FunctionNext, _T1 > &  x1,
const Iterator< _originalT, _Struct, _FunctionPrev, _FunctionNext, _T2 > &  x2 
)
friend

The assignment operator is extern

Member Data Documentation

template<typename originalT, class Struct, Struct *(Struct::*)() FunctionPrev = &Struct::previous, Struct *(Struct::*)() FunctionNext = &Struct::next, typename T = originalT>
T Iterator< originalT, Struct, FunctionPrev, FunctionNext, T >::m_Default
protected
template<typename originalT, class Struct, Struct *(Struct::*)() FunctionPrev = &Struct::previous, Struct *(Struct::*)() FunctionNext = &Struct::next, typename T = originalT>
Struct* Iterator< originalT, Struct, FunctionPrev, FunctionNext, T >::m_Node
protected

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