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-ishAn 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
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
biu::VirtualList< T >::VirtualList | ( | ) | [inline] |
Definition at line 141 of file VirtualList.hh.
virtual biu::VirtualList< T >::~VirtualList | ( | ) | [inline, virtual] |
Definition at line 142 of file VirtualList.hh.
Member Function Documentation
Iterator biu::VirtualList< T >::begin | ( | ) | const [inline] |
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.
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
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:
- src/biu/VirtualList.hh