Functions



DSList


public:

DSList (void);
Discussion

Creates a new empty List.


append


public:

void append (     DSListElement * node );
Discussion

Appends the specified ListElement to the end of the list, as opposed to insert, which inserts it at the top of the list.

Parameter Descriptions
node
Specifies the new element. This is not copied, and is inserted directly into the list.

append


public:

void append (     char* Key,     void* Data,     int cleanup=0 );
Discussion

Appends the specified key/value to the end of the list, as opposed to insert, which inserts it at the top of the list.

Parameter Descriptions
Key
Specifies the key of the new value. Remember, this data is not copied, but the pointer is used directly. You should copy your own data if it isn't constant.
Data
Specifies the data of the new value. Remember, this data is not copied, but the pointer is used directly. You should copy your own data if it isn't constant.
cleanup
Specifies the bitwise combination of flags used to clean up data. See the ListElement class for a list of permissable flags.

append


public:

void append (     unsigned int Key,     void* Data,     int cleanup=0 );
Discussion

Appends the specified key/value to the end of the list, as opposed to insert, which inserts it at the top of the list.

Parameter Descriptions
Key
Specifies the numeric key of the new value.
Data
Specifies the data of the new value. Remember, this data is not copied, but the pointer is used directly. You should copy your own data if it isn't constant.
cleanup
Specifies the bitwise combination of flags used to clean up data. See the ListElement class for a list of permissable flags.

append


public:

void append (     char* Key,     unsigned int Data,     int cleanup=0 );
Discussion

Appends the specified key/value to the end of the list, as opposed to insert, which inserts it at the top of the list.

Parameter Descriptions
Key
Specifies the key of the new value. Remember, this data is not copied, but the pointer is used directly. You should copy your own data if it isn't constant.
Data
Specifies the numeric data of the new value.
cleanup
Specifies the bitwise combination of flags used to clean up data. See the ListElement class for a list of permissable flags.

append


public:

void append (     unsigned int Key,     unsigned int Data,     int cleanup=0 );
Discussion

Appends the specified key/value to the end of the list, as opposed to insert, which inserts it at the top of the list.

Parameter Descriptions
Key
Specifies the numeric key of the new value.
Data
Specifies the numeric data of the new value.
cleanup
Specifies the bitwise combination of flags used to clean up data. See the ListElement class for a list of permissable flags. In this call, as both values are numeric, this parameter has no effect. but is retained for consistency.

close


public:

void close (void);
Discussion

Removes all the elements from the list, and destroys data in accordance with the cleanup flags of each element. The List remains available for use.


delElement


public:

void delElement (     DSListElement* ele );
Discussion

Removes the specified element from the List.

Parameter Descriptions
ele
Points to a ListElement which is to be removed from the list. Its data will be dealt with according to its cleanup flags.

delHead


public:

void delHead (void);
Discussion

Removes the first element from the List.


delItem


public:

void delItem (     unsigned int Key );
Discussion

Removes elements with the specified Key from the List.

Parameter Descriptions
Key
Specifies a numeric key corresponding to the items to be removed. Its data will be dealt with according to its cleanup flags.

delItem


public:

void delItem (     const char* Key );
Discussion

Removes elements with the specified Key from the List.

Parameter Descriptions
Key
Specifies a string key corresponding to the items to be removed. Its data will be dealt with according to its cleanup flags.

delTail


public:

void delTail (void);
Discussion

Removes the last element from the List.


getElement


public:

DSListElement* getElement (     unsigned int Key );
Discussion

Retrieves an element from the list with the specified Key.

Parameter Descriptions
Key
A numeric key corresponding to the desired element.
function result
A pointer to the requested ListElement in the list, or NULL if the element was not found.

getElement


public:

DSListElement* getElement (     const char* Key );
Discussion

Retrieves an element from the list with the specified Key.

Parameter Descriptions
Key
A string key corresponding to the desired element.
function result
A pointer to the requested ListElement in the list, or NULL if the element was not found.

getHead


public:

DSListElement* getHead (void);
Discussion

Retrieves the first element in the List.

function result
A pointer to the first ListElement in the list, or NULL if there are no elements in the list.

getNumericValue


public:

unsigned int getNumericValue (     const char* Key );
Discussion

Retrieves the value of an element from the list with the specified Key.

Parameter Descriptions
Key
A string key corresponding to the desired value.
function result
The requested value in the list, or 0 if the element was not found.

getNumericValue


public:

unsigned int getNumericValue (     unsigned int Key );
Discussion

Retrieves the value of an element from the list with the specified Key.

Parameter Descriptions
Key
A numeric key corresponding to the desired value.
function result
The requested value in the list, or 0 if the element was not found.

getPtrValue


public:

void* getPtrValue (     const char* Key );
Discussion

Retrieves the value of an element from the list with the specified Key.

Parameter Descriptions
Key
A string key corresponding to the desired value.
function result
A pointer to the requested value in the list, or NULL if the element was not found.

getPtrValue


public:

void* getPtrValue (     unsigned int Key );
Discussion

Retrieves the value of an element from the list with the specified Key.

Parameter Descriptions
Key
A numeric key corresponding to the desired value.
function result
A pointer to the requested value in the list, or NULL if the element was not found.

getTail


public:

DSListElement* getTail (void);
Discussion

Retrieves the last element in the List.

function result
A pointer to the last ListElement in the list, or NULL if there are no elements in the list.

inSort


public:

void inSort (     char* Key,     void* Data,     int cleanup=0 );
Discussion

Inserts the specified key/value to the list maintaining ascending order.

Parameter Descriptions
Key
Specifies the string key of the new value. Remember, this data is not copied, but the pointer is used directly. You should copy your own data if it isn't constant.
Data
Specifies the data of the new value. Remember, this data is not copied, but the pointer is used directly. You should copy your own data if it isn't constant.
cleanup
Specifies the bitwise combination of flags used to clean up data. See the ListElement class for a list of permissable flags.

inSort


public:

void inSort (     unsigned int Key,     void* Data,     int cleanup=0 );
Discussion

Inserts the specified key/value to the list, maintaining ascending order.

Parameter Descriptions
Key
Specifies the numeric key of the new value.
Data
Specifies the data of the new value. Remember, this data is not copied, but the pointer is used directly. You should copy your own data if it isn't constant.
cleanup
Specifies the bitwise combination of flags used to clean up data. See the ListElement class for a list of permissable flags.

inSort


public:

void inSort (     char* Key,     unsigned int Data,     int cleanup=0 );
Discussion

Inserts the specified key/value to the list, maintaining ascending order.

Parameter Descriptions
Key
Specifies the string key of the new value. Remember, this data is not copied, but the pointer is used directly. You should copy your own data if it isn't constant.
Data
Specifies the numeric data of the new value.
cleanup
Specifies the bitwise combination of flags used to clean up data. See the ListElement class for a list of permissable flags.

inSort


public:

void inSort (     unsigned int Key,     unsigned int Data,     int cleanup=0 );
Discussion

Inserts the specified key/value to the list, maintaining ascending order.

Parameter Descriptions
Key
Specifies the numeric key of the new value.
Data
Specifies the numeric data of the new value.
cleanup
Specifies the bitwise combination of flags used to clean up data. See the ListElement class for a list of permissable flags.

init


public:

void init (void);
Discussion

Creates a new linked list where the constructor can't be used, ie., after allocating a List using malloc. This should not be used in any other case, and the use of malloc is strongly discouraged in favor of new.


insert


public:

void insert (     DSListElement * node );
Discussion

Inserts the specified ListElement to the head of the list.

Parameter Descriptions
node
Specifies the new ListElement. Remember, this data is not copied, but the pointer is used directly. You should copy your own data if it isn't constant.

insert


public:

void insert (     char* Key,     void* Data,     int cleanup=0 );
Discussion

Inserts the specified key/value to the head of the list.

Parameter Descriptions
Key
Specifies the string key of the new value. Remember, this data is not copied, but the pointer is used directly. You should copy your own data if it isn't constant.
Data
Specifies the data of the new value. Remember, this data is not copied, but the pointer is used directly. You should copy your own data if it isn't constant.
cleanup
Specifies the bitwise combination of flags used to clean up data. See the ListElement class for a list of permissable flags.

insert


public:

void insert (     unsigned int Key,     void* Data,     int cleanup=0 );
Discussion

Inserts the specified key/value to the head of the list.

Parameter Descriptions
Key
Specifies the numeric key of the new value.
Data
Specifies the data of the new value. Remember, this data is not copied, but the pointer is used directly. You should copy your own data if it isn't constant.
cleanup
Specifies the bitwise combination of flags used to clean up data. See the ListElement class for a list of permissable flags.

insert


public:

void insert (     char* Key,     unsigned int Data,     int cleanup=0 );
Discussion

Inserts the specified key/value to the head of the list.

Parameter Descriptions
Key
Specifies the string key of the new value. Remember, this data is not copied, but the pointer is used directly. You should copy your own data if it isn't constant.
Data
Specifies the numeric data of the new value.
cleanup
Specifies the bitwise combination of flags used to clean up data. See the ListElement class for a list of permissable flags.

insert


public:

void insert (     unsigned int Key,     unsigned int Data,     int cleanup=0 );
Discussion

Inserts the specified key/value to the head of the list.

Parameter Descriptions
Key
Specifies the numeric key of the new value.
Data
Specifies the numeric data of the new value.
cleanup
Specifies the bitwise combination of flags used to clean up data. See the ListElement class for a list of permissable flags.

occurenceCount


public:

unsigned int occurenceCount (     const char* Key );
Discussion

Returns the number of occurences of the specified Key there are in the list.

Parameter Descriptions
Specifies
the Key that needs counting.
function result
The number of entries of the specified Key in the list.

setKeyValue


public:

BOOL setKeyValue (     const char* Key,     char * data );
Discussion

Changes the value of the key represented in the list by the specified key. The previous key is destroyed. The cleanup value governing the ListElement remains unaffected by the use of this call.

Parameter Descriptions
Key
A string key corresponding to the desired value.
data
A pointer to the new key string.
function result
Returns TRUE if the data was successfully changed, or FALSE of the element could not be found.

setKeyValue


public:

BOOL setKeyValue (     const char* Key,     unsigned int data );
Discussion

Changes the value of the key represented in the list by the specified key. The previous key is destroyed. The cleanup value governing the ListElement remains unaffected by the use of this call.

Parameter Descriptions
Key
A string key corresponding to the desired value.
data
The new numeric key.
function result
Returns TRUE if the data was successfully changed, or FALSE of the element could not be found.

setKeyValue


public:

BOOL setKeyValue (     unsigned int Key,     char * data );
Discussion

Changes the value of the key represented in the list by the specified key. The previous key is destroyed. The cleanup value governing the ListElement remains unaffected by the use of this call.

Parameter Descriptions
Key
A numeric key corresponding to the desired value.
data
A pointer to the new key string.
function result
Returns TRUE if the data was successfully changed, or FALSE of the element could not be found.

setKeyValue


public:

BOOL setKeyValue (     unsigned int Key,     unsigned int data );
Discussion

Changes the value of the key represented in the list by the specified key. The previous key is destroyed. The cleanup value governing the ListElement remains unaffected by the use of this call.

Parameter Descriptions
Key
A numeric key corresponding to the desired value.
data
The new numeric key.
function result
Returns TRUE if the data was successfully changed, or FALSE of the element could not be found.

setValue


public:

BOOL setValue (     const char* Key,     void * data );
Discussion

Changes the value of the data represented in the list by the specified key. Any previous data is destroyed. The cleanup value governing the ListElement remains unaffected by the use of this call.

Parameter Descriptions
Key
A string key corresponding to the desired value.
data
A pointer to the new data.
function result
Returns TRUE if the value were successfully changed, or FALSE of the element could not be found.

setValue


public:

BOOL setValue (     const char* Key,     unsigned int data );
Discussion

Changes the value of the data represented in the list by the specified key. Any previous data is destroyed. The cleanup value governing the ListElement remains unaffected by the use of this call.

Parameter Descriptions
Key
A string key corresponding to the desired value.
data
A numeric value of the new data.
function result
Returns TRUE if the value were successfully changed, or FALSE of the element could not be found.

setValue


public:

BOOL setValue (     unsigned int Key,     void * data );
Discussion

Changes the value of the data represented in the list by the specified key. Any previous data is destroyed. The cleanup value governing the ListElement remains unaffected by the use of this call.

Parameter Descriptions
Key
A numeric key corresponding to the desired value.
data
A pointer to the new data.
function result
Returns TRUE if the value were successfully changed, or FALSE of the element could not be found.

setValue


public:

BOOL setValue (     unsigned int Key,     unsigned int data );
Discussion

Changes the value of the data represented in the list by the specified key. Any previous data is destroyed. The cleanup value governing the ListElement remains unaffected by the use of this call.

Parameter Descriptions
Key
A numeric key corresponding to the desired value.
data
A numeric value of the new data.
function result
Returns TRUE if the value were successfully changed, or FALSE of the element could not be found.

sortAsNumeric


public:

BOOL sortAsNumeric (     BOOL bDescend=FALSE );
Discussion

Sorts the linked list by numeric key.

Parameter Descriptions
bDescend
If TRUE, sort in descending order; if FALSE or omitted, sort in ascending order.
function result
Returns TRUE if the data was successfully sorted, or FALSE if an error occurred.

sortAsString


public:

BOOL sortAsString (     BOOL bDescend=FALSE );
Discussion

Sorts the linked list by string key.

Parameter Descriptions
bDescend
If TRUE, sort in descending order; if FALSE or omitted, sort in ascending order.
function result
Returns TRUE if the data was successfully sorted, or FALSE if an error occurred.

~List


public:

~DSList (void);
Discussion

Destroys a List.

(Last Updated 9/24/2004)