#include <nobjvec.h>
Public Methods | |
csNamedObjectVector () | |
constructor. | |
int | GetIndexByName (const char *name) const |
Return the index of the element with the given name, or -1. | |
iObject* | FindByName (const char *name) const |
Find an object by name. | |
void | SetLength (int n) |
Set the length of this vector. | |
int | Length () const |
Return the length of this vector. | |
int | Limit () const |
Return the limit of this vector. | |
void | Exchange (int n1, int n2) |
Exchange two elements of the vector. | |
void | QuickSort (int Left, int Right, int Mode=0) |
Quick-sort the elements, using the given mode. | |
void | QuickSort (int Mode=0) |
Quick-sort the elements, using the given mode. | |
int | Find (iObject *obj) const |
Find an element and return its index. | |
int | FindKey (csConstSome Key, int Mode=0) const |
Find an element using the given key. | |
int | FindSortedKey (csConstSome Key, int Mode=0) const |
Find an element using the given key. Expects the elements to be sorted. | |
iObject* | Pop () |
Pop an element from the vector. | |
iObject* | Top () const |
Return the topmost element. | |
bool | Delete (int n) |
Delete an element from the vector. | |
bool | Delete (iObject *obj) |
Delete an element from the vector. | |
void | DeleteAll () |
Delete all elements. | |
iObject* | Get (int n) const |
Return the pointer to an element. | |
iObject* | operator[] (int n) const |
Return the pointer to an element. | |
void | SetVector (void *vec) |
Static Public Methods | |
int | Compare (csSome Item1, csSome Item2, int Mode) |
int | CompareKey (csSome Item, csConstSome Key, int Mode) |
It assumes that the vector contains iBase objects which implement the iObject interface. This class allows access to the vector as if it was a vector of iObject's. However, it is not possible to add objects to the vector though this interface, because this interface does not know which type of objects is actually contained.
@@ the current implementation uses SCF_QUERY_INTERFACE everywhere. This is slow and also the refcount is not handled correctly.