The Pedigree Project
0.1
|
An iterator applicable for many data structures. More...
#include <Iterator.h>
Public Types | |
typedef TreeIterator< originalT, Struct, FunctionPrev, FunctionNext, K, T const > | Const |
typedef TreeIterator< originalT, Struct, FunctionNext, FunctionPrev, K, T > | Reverse |
typedef TreeIterator< originalT, Struct, FunctionNext, FunctionPrev, K, T const > | ConstReverse |
Public Member Functions | |
TreeIterator () | |
TreeIterator (const TreeIterator &x) | |
template<typename K2 , typename T2 > | |
TreeIterator (const TreeIterator< originalT, Struct, FunctionPrev, FunctionNext, K2, T2 > &x) | |
TreeIterator (Struct *Node) | |
~TreeIterator () | |
TreeIterator & | operator= (const TreeIterator &x) |
TreeIterator & | operator++ () |
TreeIterator & | operator-- () |
T | operator* () |
T | operator-> () |
operator Const () | |
Struct * | __getNode () |
K | key () |
T | value () |
const T & | value (const T &failed=T()) const |
Protected Attributes | |
Struct * | m_Node |
Friends | |
template<typename _originalT , class _Struct , _Struct *(_Struct::*)() _FunctionPrev, _Struct *(_Struct::*)() _FunctionNext, typename _K , typename _T > | |
class | TreeIterator |
template<typename _originalT , class _Struct , _Struct *(_Struct::*)() _FunctionPrev, _Struct *(_Struct::*)() _FunctionNext, typename _K1 , typename _T1 , typename _K2 , typename _T2 > | |
bool | operator== (const TreeIterator< _originalT, _Struct, _FunctionPrev, _FunctionNext, _K1, _T1 > &x1, const TreeIterator< _originalT, _Struct, _FunctionPrev, _FunctionNext, _K2, _T2 > &x2) |
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. This specific Tree-style implementation provides access to a key and value stored in the Struct
[in] | originalT | the original element type of the iterator |
[in] | Struct | the datastructure that provides functions for the next/previous datastructure and a "value" member |
[in] | previous | pointer to the member function used to iterate forward |
[in] | next | pointer to the member function used to iterate backwards |
[in] | T | the real element type of the iterator |
Definition at line 180 of file Iterator.h.
typedef TreeIterator< originalT, Struct, FunctionPrev, FunctionNext, K, T const> TreeIterator< originalT, Struct, FunctionPrev, FunctionNext, K, T >::Const |
Type of the constant bidirectional iterator
Definition at line 206 of file Iterator.h.
typedef TreeIterator< originalT, Struct, FunctionNext, FunctionPrev, K, T const> TreeIterator< originalT, Struct, FunctionPrev, FunctionNext, K, T >::ConstReverse |
Type of the constant reverse iterator
Definition at line 213 of file Iterator.h.
typedef TreeIterator<originalT, Struct, FunctionNext, FunctionPrev, K, T> TreeIterator< originalT, Struct, FunctionPrev, FunctionNext, K, T >::Reverse |
Type of the reverse iterator
Definition at line 209 of file Iterator.h.
|
inline |
The default constructor constructs an invalid/unusable iterator
Definition at line 216 of file Iterator.h.
|
inline |
The copy-constructor
[in] | TreeIterator | the reference object |
Definition at line 221 of file Iterator.h.
|
inline |
The constructor
[in] | TreeIterator | the reference object |
Definition at line 227 of file Iterator.h.
|
inline |
Constructor from a pointer to an instance of the data structure
[in] | Node | pointer to an instance of the data structure |
Definition at line 234 of file Iterator.h.
|
inline |
The destructor does nothing
Definition at line 238 of file Iterator.h.
|
inline |
Get the Node
Definition at line 279 of file Iterator.h.
References Iterator< originalT, Struct, FunctionPrev, FunctionNext, T >::m_Node.
|
inline |
Conversion Operator to a constant iterator
Definition at line 273 of file Iterator.h.
References Iterator< originalT, Struct, FunctionPrev, FunctionNext, T >::m_Node.
|
inline |
Dereference operator yields the element value
Definition at line 262 of file Iterator.h.
References Iterator< originalT, Struct, FunctionPrev, FunctionNext, T >::m_Node.
|
inline |
Preincrement operator
Definition at line 250 of file Iterator.h.
References Iterator< originalT, Struct, FunctionPrev, FunctionNext, T >::m_Node.
|
inline |
Predecrement operator
Definition at line 256 of file Iterator.h.
References Iterator< originalT, Struct, FunctionPrev, FunctionNext, T >::m_Node.
|
inline |
Dereference operator yields the element value
Definition at line 267 of file Iterator.h.
References Iterator< originalT, Struct, FunctionPrev, FunctionNext, T >::m_Node.
|
inline |
The assignment operator
[in] | TreeIterator | the reference object |
Definition at line 244 of file Iterator.h.
References Iterator< originalT, Struct, FunctionPrev, FunctionNext, T >::m_Node, and TreeIterator< originalT, Struct, FunctionPrev, FunctionNext, K, T >::m_Node.
|
friend |
The assignment operator is extern
|
friend |
All iterators must be friend in order to allow casts between some iterator types
Definition at line 188 of file Iterator.h.
|
protected |
Pointer to the instance of the data structure or 0
Definition at line 316 of file Iterator.h.
Referenced by TreeIterator< originalT, Struct, FunctionPrev, FunctionNext, K, T >::operator=(), and operator==().