next up previous contents
Next: Hostile string iterators Up: Iterators Previous: Iterators

A Generic list iterator

class FeatureListIterator {
public:
    FeatureListIterator( const FeatureList *sl = 0 )
      : _list( sl ), _head( sl ), _index( 0 ) {}
    
    GenericFeature *feature() const;
    void              increment();     // historical please ignore
    operator          int();           // historical please ignore
    
    void              reset( const FeatureList *newList = 0 );
    
protected:
    GenericFeature *  next(); // subclass then cast to get at the pointer.

private:


    const FeatureList * _head;
    const FeatureList * _list;
    int                 _index;
};



P J Leonard
Tue Oct 1 15:25:19 BST 1996