GL Studio C++ Runtime API
ListItem Class Reference

#include <list.h>

Public Member Functions

 ListItem (const void *data, int len)
 
 ListItem ()
 
virtual ~ListItem ()
 
void * Data ()
 
void * DataPtr ()
 
ListItemNext ()
 
ListItemPrev ()
 
int Priority () const
 
void Next (ListItem *pNext)
 
void Prev (ListItem *pPrev)
 
void Data (void *item)
 
void Priority (int priority)
 
void AllocateItemData (int size)
 

Protected Attributes

void * _data
 

Detailed Description

Implements a list item for use in a List_c

Constructor & Destructor Documentation

ListItem ( const void *  data,
int  len 
)

Creates a ListItem given data. This method will allocate storage for the data passed in.

Parameters
dataA pointer to data to copy
lenLength of data to copy
ListItem ( )

Creates a ListItem without allocating internal storage.

virtual ~ListItem ( )
virtual

Destroys a ListItem, deallocating any storage the item has allocated

Member Function Documentation

void AllocateItemData ( int  size)

Allocates the specified amount of data for the item. Does not deallocate the old data!

Parameters
sizeSize of the data to allocate
void* Data ( )
Returns
The data member of this ListItem.
void Data ( void *  item)

Set the data associated with this item. This merely changes the value of the Data pointer, it does not allocate or copy data

Parameters
itemThe new data for this item
void* DataPtr ( )
Returns
What the data member of this ListItem is pointing to (a double indirection)
ListItem* Next ( )
Returns
The ListItem after this in the list, or NULL if there is no next ListItem
void Next ( ListItem pNext)

Set the Next ListItem in the List

Parameters
pNextPointer to the item that will become this item's next item
ListItem* Prev ( )
Returns
The ListItem before this in the list, or NULL if there is no previous ListItem
void Prev ( ListItem pPrev)

Set the Previous ListItem in the List

Parameters
pPrevPointer to the item that will become this item's previous item
int Priority ( ) const
inline
Returns
The priority of this ListItem
void Priority ( int  priority)

Change the priority of this list item. NOTE: Changing an item's priority does not resort the list.

Parameters
priorityThe new priority of the list item

Member Data Documentation

void* _data
protected

Item priority, used for priority queue behavior


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