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
 Pointer to list item data.
 

Detailed Description

Implements a list item for use in a List_c

Constructor & Destructor Documentation

◆ ListItem() [1/2]

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() [2/2]

ListItem ( )

Creates a ListItem without allocating internal storage.

◆ ~ListItem()

virtual ~ListItem ( )
virtual

Destroys a ListItem, deallocating any storage the item has allocated

Member Function Documentation

◆ AllocateItemData()

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

◆ Data() [1/2]

void * Data ( )
Returns
The data member of this ListItem.

◆ Data() [2/2]

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

◆ DataPtr()

void * DataPtr ( )
Returns
What the data member of this ListItem is pointing to (a double indirection)

◆ Next() [1/2]

ListItem * Next ( )
Returns
The ListItem after this in the list, or NULL if there is no next ListItem

◆ Next() [2/2]

void Next ( ListItem pNext)

Set the Next ListItem in the List

Parameters
pNextPointer to the item that will become this item's next item

◆ Prev() [1/2]

ListItem * Prev ( )
Returns
The ListItem before this in the list, or NULL if there is no previous ListItem

◆ Prev() [2/2]

void Prev ( ListItem pPrev)

Set the Previous ListItem in the List

Parameters
pPrevPointer to the item that will become this item's previous item

◆ Priority() [1/2]

int Priority ( ) const
inline
Returns
The priority of this ListItem

◆ Priority() [2/2]

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

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