*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->IRIX man pages -> ifl/iflListIter (3)              
Title
Content
Arch
Section
 

Contents


iflListIter(3)	  Image	Format Library C++ Reference Manual	iflListIter(3)


NAME    [Toc]    [Back]

     iflListIter, iflListIterRev, iflMultiListIter, iflMultiListIterRev	-
     iterators for iflList and iflMultiList

INHERITS FROM    [Toc]    [Back]

     This is a base class.

HEADER FILE    [Toc]    [Back]

     #include <ifl/iflList.h>

CLASS DESCRIPTION    [Toc]    [Back]

     ifl[Multi]ListIter	and ifl[Multi]ListIterRev provide lightweight
     iterators for doubly-linked lists derived from iflList or iflMultiList.

     Using iflListIter    [Toc]    [Back]

     Say you have built	a list of some sort of item:

	  iflList<someItem> list;
	  for (int i = 0; i < 10; i++)
	      list.append(new someItem(i));


     You can iterate through the items from the	head to	the tail by doing:

	  iflListIter<someItem>	iter(list);
	  someItem* item;
	  while	(item =	iter.next()) {
	      // do something with item	(and possibly unlink/delete it)
	  }


     Alternatively, you	can iterate backwards, from the	tail to	the head with:

	  iflListIterRev<someItem> iter(list);
	  someItem* item;
	  while	(item =	iter.next()) {
	      // do something with item	(and possibly unlink/delete it)
	  }

CLASS MEMBER FUNCTION SUMMARY    [Toc]    [Back]

     Constructors

	  iflListIter<I>(const iflList<I>* list)
	  iflListIter<I>(const iflList<I>& list)

	  iflListIterRev<I>(const iflList<I>* list)
	  iflListIterRev<I>(const iflList<I>& list)

	  iflMultiListIter<I,L>(const iflMultiList<I,L>* list)
	  iflMultiListIter<I,L>(const iflMultiList<I,L>& list)



									Page 1






iflListIter(3)	  Image	Format Library C++ Reference Manual	iflListIter(3)



	  iflMultiListIterRev<I,L>(const iflMultiList<I,L>* list)
	  iflMultiListIterRev<I,L>(const iflMultiList<I,L>& list)


     Traversing    [Toc]    [Back]

	  I* next()
	  I* curr() const
	  void reset()

FUNCTION DESCRIPTIONS    [Toc]    [Back]

     iflListIter()

	  iflListIter<I>(const iflList<I>* list)
	  iflListIter<I>(const iflList<I>& list)


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

     iflMultiListIter()

	  iflMultiListIter<I,L>(const iflMultiList<I,L>* list)
	  iflMultiListIter<I,L>(const iflMultiList<I,L>& list)


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

     iflListIterRev()

	  iflListIterRev<I>(const iflList<I>* list)
	  iflListIterRev<I>(const iflList<I>& list)


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

     iflMultiListIterRev()

	  iflMultiListIterRev<I,L>(const iflMultiList<I,L>* list)
	  iflMultiListIterRev<I,L>(const iflMultiList<I,L>& list)


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

     curr()






									Page 2






iflListIter(3)	  Image	Format Library C++ Reference Manual	iflListIter(3)



	  I* curr() const


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

     next()

	  I* next()


	  Returns the next sequential element (the direction depends on	the
	  type of iterator), or	NULL if	the end	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	first element again.

SEE ALSO    [Toc]    [Back]

      
      
     iflListItem, iflList, iflMultiList


									PPPPaaaaggggeeee 3333
[ Back ]
 Similar pages
Name OS Title
iflListItem IRIX an element of an doubly linked list (iflList or iflMultiList)
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service