Tools.h++ Manual

104011 Tandem Computers Incorporated 22-5
22
RWTIsvDlist<T>
Synopsis
#include <rw/tidlist.h>
RWTIsvDlist list;
Descripton Class
RWTIsvDlist<T>
is a class that implements intrusive singly-linked lists.
An intrusive list is one where the member of the list must inherit from a
common base class, in this case
RWIsvDlink
. The advantage of such a list is
that memory and space requirements are kept to a minimum. The
disadvantage is that the inheritance hierarchy is inflexible, making it slightly
more difficult to use with an existing class. Class
RWTValDlist<T>
is offered
as an alternative, non-intrusive, linked list.
See Stroustrup (1991; Section 8.3.1) for more information about intrusive lists.
Caution – When you insert an item into an intrusive list, the actual item (not a
copy) is inserted. Because each item carries only one link field, the same item
cannot be inserted into more than one list, nor can it be inserted into the same
list more than once.
!