LinkedList.
More...
#include <LinkedList.h>
Public Methods | |
| ListItem (T &Data_) | |
| Construct an item with the given data value. | |
| T & | data () |
| Return the item's data value. | |
| int | operator== (const ListItem< T > &item) |
Return TRUE if item equals the data value in the current item. | |
Static Public Methods | |
| void | delete_unused () |
Deletes the list of unused ListItem objects. | |
Protected Methods | |
| void * | operator new (size_t) |
Allocates a ListItem, taking items off of the unused list first. | |
| void | operator delete (void *, size_t) |
Deletes a ListItem, adding it to the unused list. | |
Protected Attributes | |
| T | Data |
| The item's data value. | |
| ListItem * | next |
| The next item in the list. | |
| ListItem * | prev |
| The previous item in the list. | |
Static Protected Attributes | |
| ListItem * | unused = NULL |
The pointer to the list of unused ListItem objects. | |
Friends | |
| class | LinkedList< T > |
LinkedList.
This code includes the management of a list of unused ListItem's, which are used first before new ListItem's are constructed. The user can clear the unused items if that is desirable.