XBinder
Version 2.9.x
|
ArrayList functions. More...
#include "rtxsrc/rtxContext.h"
Go to the source code of this file.
Functions | |
EXTERNRT void | rtxArrayListInit (OSRTArrayList *pArrayList, OSSIZE capacity) |
This function initializes an array list structure. More... | |
EXTERNRT OSRTArrayList * | rtxNewArrayList (OSCTXT *pctxt, OSSIZE capacity) |
This function creates a new array list to hold the initial capacity of elements. More... | |
EXTERNRT void | rtxFreeArrayList (OSCTXT *pctxt, OSRTArrayList *pArrayList) |
This function frees all dynamic memory held by the array list. More... | |
EXTERNRT int | rtxArrayListAdd (OSCTXT *pctxt, OSRTArrayList *pArrayList, void *pdata, OSSIZE *pindex) |
This function adds an element to an array list. More... | |
EXTERNRT void | rtxArrayListRemove (OSCTXT *pctxt, OSRTArrayList *pArrayList, void *pdata) |
This function removes an element from an array list. More... | |
EXTERNRT void | rtxArrayListRemoveIndexed (OSCTXT *pctxt, OSRTArrayList *pArrayList, OSSIZE idx) |
This function removes the element at the given index from the array list. More... | |
EXTERNRT int | rtxArrayListInsert (OSCTXT *pctxt, OSRTArrayList *pArrayList, void *pdata, OSSIZE idx) |
This function inserts an element at the given position in the array list. More... | |
EXTERNRT int | rtxArrayListReplace (OSRTArrayList *pArrayList, void *pdata, OSSIZE idx) |
This function replaces (overwrites) the element at the given position in the array list with the new element. More... | |
EXTERNRT void * | rtxArrayListGetIndexed (const OSRTArrayList *pArrayList, OSSIZE idx) |
This function gets the indexed data item from the array list. More... | |
EXTERNRT int | rtxArrayListIndexOf (OSRTArrayList *pArrayList, void *pdata) |
This function returns the index of the given data item in the list. More... | |
EXTERNRT int | rtxArrayListInitIter (OSRTArrayListIter *piter, const OSRTArrayList *pArrayList, OSSIZE startIndex) |
This function initializes an array list iterator with the given start index. More... | |
EXTERNRT OSBOOL | rtxArrayListHasNextItem (OSRTArrayListIter *piter) |
This function determines if another element exists at the next sequential position in the array list. More... | |
EXTERNRT void * | rtxArrayListNextItem (OSRTArrayListIter *piter) |
This function gets the next item from the array list. More... | |
ArrayList functions.
Definition in file rtxArrayList.h.
EXTERNRT int rtxArrayListAdd | ( | OSCTXT * | pctxt, |
OSRTArrayList * | pArrayList, | ||
void * | pdata, | ||
OSSIZE * | pindex | ||
) |
This function adds an element to an array list.
pctxt | Pointer to a context structure. |
pArrayList | Pointer to array list structure to initialize. |
pdata | Pointer to data item to add. |
pindex | Pointer to index variable to receive index at which entry was added. |
EXTERNRT void* rtxArrayListGetIndexed | ( | const OSRTArrayList * | pArrayList, |
OSSIZE | idx | ||
) |
This function gets the indexed data item from the array list.
pArrayList | Pointer to array list structure to initialize. |
idx | Index of location where item should be inserted. |
EXTERNRT OSBOOL rtxArrayListHasNextItem | ( | OSRTArrayListIter * | piter | ) |
This function determines if another element exists at the next sequential position in the array list.
piter | Pointer to array list iterator structure. |
EXTERNRT int rtxArrayListIndexOf | ( | OSRTArrayList * | pArrayList, |
void * | pdata | ||
) |
This function returns the index of the given data item in the list.
The 'equals' callback function is used to do comparisons.
pArrayList | Pointer to array list structure to initialize. |
pdata | Pointer to data item to find in list. |
EXTERNRT void rtxArrayListInit | ( | OSRTArrayList * | pArrayList, |
OSSIZE | capacity | ||
) |
This function initializes an array list structure.
pArrayList | Pointer to array list structure to initialize. |
capacity | Initial capacity of the array or zero to use default. |
EXTERNRT int rtxArrayListInitIter | ( | OSRTArrayListIter * | piter, |
const OSRTArrayList * | pArrayList, | ||
OSSIZE | startIndex | ||
) |
This function initializes an array list iterator with the given start index.
piter | Pointer to array list iterator structure. |
pArrayList | Pointer to array list structure. |
startIndex | Index from which iteration is to start. |
EXTERNRT int rtxArrayListInsert | ( | OSCTXT * | pctxt, |
OSRTArrayList * | pArrayList, | ||
void * | pdata, | ||
OSSIZE | idx | ||
) |
This function inserts an element at the given position in the array list.
pctxt | Pointer to a context structure. |
pArrayList | Pointer to array list structure to initialize. |
pdata | Pointer to data item to insert. |
idx | Index of location where item should be inserted. |
EXTERNRT void* rtxArrayListNextItem | ( | OSRTArrayListIter * | piter | ) |
This function gets the next item from the array list.
piter | Pointer to array list iterator structure. |
EXTERNRT void rtxArrayListRemove | ( | OSCTXT * | pctxt, |
OSRTArrayList * | pArrayList, | ||
void * | pdata | ||
) |
This function removes an element from an array list.
pctxt | Pointer to a context structure. |
pArrayList | Pointer to array list structure to initialize. |
pdata | Pointer to data item to remove. |
EXTERNRT void rtxArrayListRemoveIndexed | ( | OSCTXT * | pctxt, |
OSRTArrayList * | pArrayList, | ||
OSSIZE | idx | ||
) |
This function removes the element at the given index from the array list.
pctxt | Pointer to a context structure. |
pArrayList | Pointer to array list structure to initialize. |
idx | Index of item to remove. -1 indicates tail item should be removed. |
EXTERNRT int rtxArrayListReplace | ( | OSRTArrayList * | pArrayList, |
void * | pdata, | ||
OSSIZE | idx | ||
) |
This function replaces (overwrites) the element at the given position in the array list with the new element.
pArrayList | Pointer to array list structure to initialize. |
pdata | Pointer to data item to insert. |
idx | Index of location where item should be inserted. |
EXTERNRT void rtxFreeArrayList | ( | OSCTXT * | pctxt, |
OSRTArrayList * | pArrayList | ||
) |
This function frees all dynamic memory held by the array list.
It does not free the array list structure itself, just the internal data array.
pctxt | Pointer to a context structure. |
pArrayList | Pointer to array list structure. |
EXTERNRT OSRTArrayList* rtxNewArrayList | ( | OSCTXT * | pctxt, |
OSSIZE | capacity | ||
) |
This function creates a new array list to hold the initial capacity of elements.
pctxt | Pointer to a context structure. |
capacity | Initial capacity of the array or zero to use default. |