NAME
-
iflListItem - an element of an doubly linked list (iflList or iflMultiList)
HEADER FILE
-
#include <ifl/iflList.h>
PUBLIC METHOD SUMMARY
Constructing and destroying
Initialization
Query
Manipulation
PUBLIC MEMBER SUMMARY
- iflListItem* next;
- iflListItem* prev;
CLASS DESCRIPTION
-
iflListItem is a base class from which to derive elements to be
placed in either an iflList or an iflMultiList.
Using iflListItem
-
To make a list of integers, for example, define a derivation of
iflListItem to hold the integer:
struct intItem : public iflListItem {
intItem(int val) { i = val; }
int i;
};
-
This class can then be used to build a list of integer values:
iflList<intItem> list;
for (int i = 0; i < 10; i++)
list.append(new intItem(i));
METHOD DESCRIPTIONS
iflListItem()
-
Creates an iflListItem with NULL linkage (not part of any
list).
~iflListItem()
-
Destroys an iflListItem, the item must not be a member of any
list (debug libraries will get an assertion failure).
initLinks()
-
Reset the linkage of this item to NULL. This is mainly used
is special initialization cases (like allocation from a shared
arena).
isLinked()
-
Returns TRUE if this item is currently on a list,
FALSE otherwise.
unlink()
-
Removes an item from whatever list it is currently linked on to.
Bad things will happen if you call this method on an item that is
already unlinked.
MEMBER DESCRIPTIONS
next
- iflListItem* next;
-
Points to the next item in the list. This member should not
be accessed directly (it's public because we can't figure out
how to make it private and still compile). Use iflListIter
or iflListIterRev to traverse lists.
prev
- iflListItem* prev;
-
Points to the previous item in the list. This member should
not be accessed directly. Use iflListIter or
iflListIterRev to traverse lists.
SEE ALSO
-
iflList, iflMultiList