VR-Link API Documentation for DIS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Protected Member Functions
DtIntrusiveList Class Reference

An intrusive list is a list that assumes that the elements that you add are pointers to instances of classes derived from DtListedObject. More...

+ Inheritance diagram for DtIntrusiveList:
+ Collaboration diagram for DtIntrusiveList:

Protected Member Functions

virtual void addToList (DtListItem *item, DtListItem *after)
 Override of virtual function. More...
 
virtual void removeFromList (DtListItem *item)
 Override of virtual function. More...
 
void removeAndDelete (const DtListedObj *data)
 Remove and delete an element from the list. More...
 
virtual void removeAndDelete (DtListItem *item)
 Remove and delete an element from the list. More...
 
virtual void removeAllAndDelete ()
 Same as removeAll, except that this DOES delete the data in the list. More...
 

Additional Inherited Members

- Public Member Functions inherited from DtList
 DtList ()
 Constructor. More...
 
virtual ~DtList ()
 Destructor - does NOT free memory of data associated with the items. More...
 
 DtList (const DtList &orig)
 Copy constructor. More...
 
DtListoperator= (const DtList &orig)
 Assignment operator. More...
 
DtListItemfirst () const
 Return first and last item on the list. More...
 
DtListItemlast () const
 
unsigned count () const
 Returns the number of elements in the list. More...
 
DtListItemadd (void *data)
 Add element to the end of the list. More...
 
DtListItemaddToStart (void *data)
 Add element to the beginning of the list. More...
 
DtListItemaddToEnd (void *data)
 Add element to the end of the list. More...
 
DtListItemaddBefore (void *data, DtListItem *before)
 Add element to the list just before the indicated item. More...
 
DtListItemaddAfter (void *data, DtListItem *after)
 Add element to the list just after the indicated item. More...
 
void * remove (DtListItem *item)
 Remove an element from the list. More...
 
void removeAll ()
 Calls remove for all elements in the list. More...
 
DtListItemitemLookup (const void *data) const
 Returns the DtListItem envelope object containing the indicated data element. More...
 
- Protected Attributes inherited from DtList
DtListItemmyFirst
 
DtListItemmyLast
 
unsigned myCount
 

Detailed Description

An intrusive list is a list that assumes that the elements that you add are pointers to instances of classes derived from DtListedObject.

When an intrusive list is use, you can get previous and next pointers directly from the listed elements, (through the base DtListedObject class), without having to go through the DtList itself.

Member Function Documentation

virtual void DtIntrusiveList::addToList ( DtListItem item,
DtListItem after 
)
protectedvirtual

Override of virtual function.

Saves pointer to the list and to the item in the DtListedObj.

Reimplemented from DtList.

virtual void DtIntrusiveList::removeAllAndDelete ( )
protectedvirtual

Same as removeAll, except that this DOES delete the data in the list.

void DtIntrusiveList::removeAndDelete ( const DtListedObj data)
protected

Remove and delete an element from the list.

virtual void DtIntrusiveList::removeAndDelete ( DtListItem item)
protectedvirtual

Remove and delete an element from the list.

Item is the envelope containing the data element you would like to remove.

virtual void DtIntrusiveList::removeFromList ( DtListItem item)
protectedvirtual

Override of virtual function.

Removes the item from this list, and cleans up the DtListedObj's item and list pointers.

Reimplemented from DtList.


The documentation for this class was generated from the following file:

Document ID: Generated on Mon Apr 25 03:39:01 EDT 2022 from SVN revision 242502
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)