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

biu::VirtualList< T > Class Template Reference

#include <VirtualList.hh>


Detailed Description

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

Implementation of virtual lists that can be iterated STL-ish

An example of usage is provided in testVirtualList.cc

The elements of virtual lists are constructed on demand and exist only as long as an iterator points to them

The class VirtualList<T> is an abstract class that serves as base class for concrete virtual lists of elements T.

Child classes have to implement the abstract methods

virtual T* next(ItState *itstate, T* elem) const = 0; virtual T* first(ItState **itstate) const = 0;

and usually refine the iterator state (class ItState) by deriving from the nested class ItState.

class T must implement a clone() function

Author:
Sebastian Will <will@informatik.uni-freiburg.de>

Definition at line 41 of file VirtualList.hh.

Public Member Functions

Iterator begin () const
Iterator end () const
 VirtualList ()
virtual ~VirtualList ()

Protected Member Functions

virtual T * first (ItState **itstate) const=0
virtual T * next (ItState *itstate, T *const elem) const=0

Data Structures

class  Iterator
class  ItState


Constructor & Destructor Documentation

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

Definition at line 141 of file VirtualList.hh.

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

Definition at line 142 of file VirtualList.hh.


Member Function Documentation

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

Returns:
iterator pointing at first element of list

Definition at line 145 of file VirtualList.hh.

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

Returns:
iterator pointing at entry after last element of list end() can be compared to an iterator by !=

Definition at line 155 of file VirtualList.hh.

template<class T>
virtual T* biu::VirtualList< T >::first ( ItState **  itstate  )  const [protected, pure virtual]

returns pointer to first element of the virtual list and a pointer to a new, initialized itstate

first() must delete (or overwrite) itstate if itstate!=0

Parameters:
itstate is an in-out parameter

template<class T>
virtual T* biu::VirtualList< T >::next ( ItState itstate,
T *const  elem 
) const [protected, pure virtual]

Changes elem to be next element and returns the elem pointer. Position specific information should be drawn from itstate and/or elem. next may overwrite *elem (or delete old elem and create new one) but NEVER delete elem completely. This is done internally.

Returns:
NULL if no next element is available or the changed elem pointer


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