![]() |
Public API Reference |
#include <csvector.h>
Inheritance diagram for csVector:
Public Methods | |
csVector (int ilimit=8, int ithreshold=16) | |
Initialize object to hold initially 'ilimit' elements, and increase storage by 'ithreshold' each time the upper bound is exceeded. More... | |
virtual | ~csVector () |
Destroy the vector object. More... | |
int | FindKey (const void *Key, int Mode=0) const |
Find a element by key (using CompareKey method). More... | |
int | FindSortedKey (const void *Key, int Mode=0) const |
Find a element in a SORTED array by key (using CompareKey method). More... | |
void | QuickSort (int Left, int Right, int Mode=0) |
Partially sort the array. More... | |
void | QuickSort (int Mode=0) |
Same but for all elements. More... | |
bool | Delete (int n, bool FreeIt=true) |
Delete element number 'n' from vector. More... | |
bool | Delete (void *Item, bool FreeIt=true) |
Delete the given element from vector. More... | |
bool | Replace (int n, void *what, bool FreePrevious=true) |
Replace n-th item with another (free previous value). More... | |
void | DeleteAll (bool FreeThem=true) |
Delete all elements. More... | |
int | InsertSorted (void *Item, int *oEqual=NULL, int Mode=0) |
Insert element 'Item' so that array remains sorted (assumes its already). More... | |
virtual bool | FreeItem (void *Item) |
Virtual function which frees a vector element; returns success status. More... | |
virtual int | Compare (void *Item1, void *Item2, int Mode) const |
Compare two array elements in given Mode. More... | |
virtual int | CompareKey (void *Item, const void *Key, int Mode) const |
Compare entry with a key; for csVector just compare (int)Key vs (int)Item. More... |
Note that FreeItem() returns a boolean value which is the success status. This is used in Delete() and DeleteAll() to decide whenever an element can be really deleted - if the element has a good reason to stay 'sticky' it can return false from FreeItem().
Definition at line 114 of file csvector.h.
|
Initialize object to hold initially 'ilimit' elements, and increase storage by 'ithreshold' each time the upper bound is exceeded.
Definition at line 121 of file csvector.h. |
|
Destroy the vector object.
Definition at line 125 of file csvector.h. |
|
Compare two array elements in given Mode.
Reimplemented in csStrVector. |
|
Compare entry with a key; for csVector just compare (int)Key vs (int)Item.
Reimplemented in csStrVector. |
|
Delete the given element from vector.
Definition at line 229 of file csvector.h. References Delete, and csBasicVector::Find. |
|
Delete element number 'n' from vector.
Referenced by csTreeNode::BSF, Delete, and csTreeNode::RemoveChild. |
|
Delete all elements.
Referenced by csTreeNode::BSF. |
|
Find a element by key (using CompareKey method).
Referenced by csWSTexVector::FindTexture. |
|
Find a element in a SORTED array by key (using CompareKey method).
Referenced by csSparseGrid::GetAt. |
|
Virtual function which frees a vector element; returns success status.
Reimplemented in csStrVector. |
|
Insert element 'Item' so that array remains sorted (assumes its already).
Referenced by csSparseGrid::GetAt. |
|
Same but for all elements.
Definition at line 236 of file csvector.h. References QuickSort. |
|
Partially sort the array.
Referenced by QuickSort. |
|
Replace n-th item with another (free previous value).
|