ListItem Class Template Reference

A simple container class that is used by LinkedList. More...

#include <LinkedList.h>

List of all members.

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

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 >


Detailed Description

template<class T>
class ListItem< T >

A simple container class that is used by 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.


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