VIPER REFERENCE MANUAL


NAME
iflMultiListIterRev - backward iterator for iflMultiList

HEADER FILE
#include <ifl/iflList.h>

PUBLIC METHOD SUMMARY
template<class itemType, class linkageType> iflMultiListIterRev ( const iflMultiList<itemType, linkageType>* list);
template<class itemType, class linkageType> iflMultiListIterRev ( const iflMultiList<itemType, linkageType>& list);
itemType* next (  );
itemType* curr (  ) const;
void reset (  );

CLASS DESCRIPTION
iflMultiListIter provides a lightweight backwards iterator for doubly-linked lists derived from iflMultiList. For iflList derived lists use iflListIterRev

   Using iflMultiListIterRev
Say you have built a list of some sort of item:
    iflMultiList<someItem,linkType> list;
    for (int i = 0; i < 10; i++) 
        list.append(new someItem(i));
You can iterate backwards, from the tail to the head with:
    iflMultiListIterRev<someItem,linkType> iter(list);
    someItem* item;
    while (item = iter.next()) {
        // do something with item (and possibly unlink/delete it)
    }

METHOD DESCRIPTIONS

   iflMultiListIterRev()
template<class itemType, class linkageType> iflMultiListIterRev ( const iflMultiList<itemType, linkageType>* list);
template<class itemType, class linkageType> iflMultiListIterRev ( const iflMultiList<itemType, linkageType>& list);

Constructs a backwar (tail to head) iterator from a pointer or reference to an iflMultiList, given by list.

   curr()
itemType* curr (  ) const;

Returns the current element of the iteration; this is the same value as that last returned from next().

   next()
itemType* next (  );

Returns the previous sequential element, or NULL if the head of the list has been reached. The iterator is designed in such a way that it is safe to remove the current item while traversing a list; no items will be skipped or revisited.

   reset()
void reset (  );

Resets the iterator to start from the tail element again.

SEE ALSO
iflListIterRev, iflMultiList