![]() |
Public API Reference |
#include <refarr.h>
Inheritance diagram for csRefArray:
Public Methods | |
csRefArray (int ilimit=0, int ithreshold=0) | |
Initialize object to hold initially 'ilimit' elements, and increase storage by 'ithreshold' each time the upper bound is exceeded. More... | |
void | TransferTo (csRefArray< T > &destination) |
Transfer the entire contents of one array to the other. More... | |
void | DeleteAll () |
Clear entire vector. More... | |
~csRefArray () | |
Destroy the container and release all contained references. More... | |
void | SetLength (int n) |
Set vector length to n. More... | |
int | Length () const |
Query vector length. More... | |
int | Limit () const |
Query vector limit. More... | |
const csRef< T > & | Get (int n) const |
Get a const reference. More... | |
const csRef< T > & | operator[] (int n) const |
Get a const reference. More... | |
csRef< T > & | operator[] (int n) |
Get a reference. More... | |
int | Find (T *which) const |
Find a element in array and return its index (or -1 if not found). More... | |
int | Push (T *what) |
Push a element on 'top' of vector. More... | |
int | PushSmart (T *what) |
Push a element on 'top' of vector if it is not already there. More... | |
csPtr< T > | Pop () |
Pop an element from vector 'top'. More... | |
T * | Top () const |
Return the top element but don't remove it. More... | |
bool | Delete (int n) |
Delete element number 'n' from vector. More... | |
bool | Delete (T *item) |
Delete the given element from vector. More... | |
bool | Insert (int n, T *item) |
Insert element 'Item' before element 'n'. More... | |
int | FindSortedKey (void *key, ArrayCompareKeyFunction *comparekey) const |
Find an element based on some key. More... | |
int | InsertSorted (T *item, ArrayCompareFunction *compare) |
Insert an element at a sorted position. More... | |
void | QuickSort (ArrayCompareFunction *compare) |
Same but for all elements. More... | |
void | QuickSort (int Left, int Right, ArrayCompareFunction *compare) |
Partially sort the array. More... |
Definition at line 29 of file refarr.h.
|
Initialize object to hold initially 'ilimit' elements, and increase storage by 'ithreshold' each time the upper bound is exceeded.
|
|
Destroy the container and release all contained references.
|
|
Delete the given element from vector.
|
|
Delete element number 'n' from vector.
Definition at line 200 of file refarr.h. Referenced by csRefArray< iCameraPosition >::Delete, csObjectWatcher::RemoveListener, and csObjectModel::RemoveListener. |
|
Clear entire vector.
Definition at line 74 of file refarr.h. Referenced by csShadowBlock::DeleteShadows, csRefArray< iCameraPosition >::SetLength, csRefArray< iCameraPosition >::TransferTo, and csRefArray< iCameraPosition >::~csRefArray. |
|
Find a element in array and return its index (or -1 if not found).
Definition at line 161 of file refarr.h. Referenced by csRefArray< iCameraPosition >::Delete, csRefArray< iCameraPosition >::PushSmart, and csObjectModel::RemoveListener. |
|
Find an element based on some key.
|
|
Get a const reference.
Definition at line 138 of file refarr.h. Referenced by csSectorList::Get, csMeshFactoryList::Get, csMeshList::Get, and csLightList::Get. |
|
Insert element 'Item' before element 'n'.
Definition at line 231 of file refarr.h. Referenced by csRefArray< iCameraPosition >::InsertSorted. |
|
Insert an element at a sorted position. Assumes array is already sorted. |
|
Query vector length.
Definition at line 126 of file refarr.h. Referenced by csRefArray< iCameraPosition >::Find, csRefArray< iCameraPosition >::FindSortedKey, csObjectModel::FireListeners, csSectorList::GetCount, csMeshFactoryList::GetCount, csMeshList::GetCount, csLightList::GetCount, csCollection::GetObjectCount, csShadowBlock::GetShadow, csShadowBlock::GetShadowCount, csRefArray< iCameraPosition >::InsertSorted, and csShadowBlock::Transform. |
|
Query vector limit.
|
|
Get a reference.
|
|
Get a const reference.
|
|
Pop an element from vector 'top'.
|
|
Push a element on 'top' of vector.
Definition at line 171 of file refarr.h. Referenced by csObjectWatcher::AddListener, csObjectModel::AddListener, csCollection::AddObject, csRefArray< iCameraPosition >::PushSmart, and csMeshWrapper::SetDrawCallback. |
|
Push a element on 'top' of vector if it is not already there.
|
|
Partially sort the array.
|
|
Same but for all elements.
Definition at line 304 of file refarr.h. Referenced by csRefArray< iCameraPosition >::QuickSort. |
|
Set vector length to n.
Definition at line 96 of file refarr.h. Referenced by csRefArray< iCameraPosition >::Delete, csRefArray< iCameraPosition >::Insert, csRefArray< iCameraPosition >::operator[], csRefArray< iCameraPosition >::Pop, and csRefArray< iCameraPosition >::Push. |
|
Return the top element but don't remove it.
|
|
Transfer the entire contents of one array to the other. The end result will be that this array will be completely empty and the other array will have all items that originally were in this array. This operation is very efficient. |