Generated on Tue Dec 16 12:50:12 2008 for BIU-2.2.0 by doxygen 1.5.1

biu::VirtualList< T >::Iterator Class Reference

#include <VirtualList.hh>


Detailed Description

template<class T>
class biu::VirtualList< T >::Iterator

the iterator for traversing a list

the iterator can be used in an STL-ish way: e.g. for(Iterator it=list->begin(); list->end()!=it; ++it) {...*it...}

since the iterator holds a pointer to its associated list and uses virtual methods of VirtualList<T>, it behaves "polymorph" due to the polymorphism of its associated list

Definition at line 74 of file VirtualList.hh.

Public Member Functions

 Iterator (const Iterator &it)
const T & operator * () const
bool operator!= (const Iterator &it) const
const Iteratoroperator++ ()
const T * operator-> () const
Iteratoroperator= (const Iterator &it)
virtual ~Iterator ()

Data Fields

T * elem
ItStateitstate
const VirtualList< T > * parent

Private Member Functions

 Iterator (const VirtualList< T > *parent_, ItState *itstate_, T *elem_)

Friends

class VirtualList< T >


Constructor & Destructor Documentation

template<class T>
biu::VirtualList< T >::Iterator::Iterator ( const VirtualList< T > *  parent_,
ItState itstate_,
T *  elem_ 
) [inline, private]

Constructor that is used in begin() and end()

Since only VirtualList<T> should use this, this constructor is private

Definition at line 84 of file VirtualList.hh.

template<class T>
biu::VirtualList< T >::Iterator::Iterator ( const Iterator it  )  [inline]

copying iterators. Since element and iterator state are cloned we get an independent iterator

Definition at line 92 of file VirtualList.hh.

template<class T>
biu::VirtualList< T >::Iterator::~Iterator (  )  [virtual]

Definition at line 188 of file VirtualList.hh.


Member Function Documentation

template<class T>
const T& biu::VirtualList< T >::Iterator::operator * (  )  const [inline]

returns the element referenced by the iterator

Definition at line 130 of file VirtualList.hh.

template<class T>
bool biu::VirtualList< T >::Iterator::operator!= ( const Iterator it  )  const [inline]

compare iterators, only two end-iterators are equal this behavior allows for loop-termination, but differs from the standard behavior of STL-iterators

Definition at line 111 of file VirtualList.hh.

template<class T>
const Iterator& biu::VirtualList< T >::Iterator::operator++ (  )  [inline]

switch iterator to point to next list element

Definition at line 101 of file VirtualList.hh.

template<class T>
const T* biu::VirtualList< T >::Iterator::operator-> (  )  const [inline]

accesses the element referenced by the iterator

Definition at line 135 of file VirtualList.hh.

template<class T>
Iterator& biu::VirtualList< T >::Iterator::operator= ( const Iterator it  )  [inline]

assigning iterators. Since element and iterator state are cloned we get an independent iterator

Definition at line 117 of file VirtualList.hh.


Friends And Related Function Documentation

template<class T>
friend class VirtualList< T > [friend]

Definition at line 75 of file VirtualList.hh.


Field Documentation

template<class T>
T* biu::VirtualList< T >::Iterator::elem

element referenced by iterator

Definition at line 79 of file VirtualList.hh.

template<class T>
ItState* biu::VirtualList< T >::Iterator::itstate

information on iterator state

Definition at line 78 of file VirtualList.hh.

template<class T>
const VirtualList<T>* biu::VirtualList< T >::Iterator::parent

virtual list of iterator

Definition at line 77 of file VirtualList.hh.


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