similar to unordered array except that it will automatically call addref/Release when obj is added/removed.
More...
|
iterator | begin () |
|
const_iterator | begin () const |
|
iterator | end () |
|
const_iterator | end () const |
|
const_iterator | cbegin () const |
|
const_iterator | cend () const |
|
reverse_iterator | rbegin () |
|
const_reverse_iterator | rbegin () const |
|
reverse_iterator | rend () |
|
const_reverse_iterator | rend () const |
|
const_reverse_iterator | crbegin () const |
|
const_reverse_iterator | crend () const |
|
| unordered_ref_array () |
| Constructor.
|
|
| unordered_ref_array (size_t capacity) |
| Constructor with a capacity.
|
|
| ~unordered_ref_array () |
| Destructor.
|
|
| unordered_ref_array (const unordered_ref_array< T > &other) |
| Copy constructor.
|
|
| unordered_ref_array (unordered_ref_array< T > &&other) |
| Move constructor.
|
|
unordered_ref_array< T > & | operator= (const unordered_ref_array< T > &other) |
| Copy assignment operator.
|
|
unordered_ref_array< T > & | operator= (unordered_ref_array< T > &&other) |
| Move assignment operator.
|
|
void | reserve (size_t n) |
| Request a change in capacity. More...
|
|
size_t | capacity () const |
| Returns the size of the storage space currently allocated for the array, expressed in terms of elements. More...
|
|
size_t | size () const |
| Returns the number of elements in the vector. More...
|
|
bool | empty () const |
| Returns whether the vector is empty (i.e. More...
|
|
size_t | max_size () const |
| Returns the maximum number of elements that the vector can hold. More...
|
|
size_t | getIndex (T object) const |
| Returns index of a certain object, return UINT_MAX if doesn't contain the object.
|
|
const_iterator | find (T object) const |
| Find the object in the vector. More...
|
|
iterator | find (T object) |
|
T | at (size_t index) const |
| Returns the element at position 'index' in the vector. More...
|
|
T | front () const |
| Returns the first element in the vector. More...
|
|
T | back () const |
| Returns the last element of the vector. More...
|
|
bool | contains (T object) const |
| Returns a Boolean value that indicates whether object is present in vector. More...
|
|
bool | equals (const unordered_ref_array< T > &other) |
| Returns true if the two vectors are equal.
|
|
void | push_back (T object) |
| Adds a new element at the end of the vector, after its current last element. More...
|
|
void | push_back (const unordered_ref_array< T > &other) |
| Push all elements of an existing vector to the end of current vector. More...
|
|
void | insert (size_t index, T object) |
| Insert a certain object at a certain index. More...
|
|
void | pop_back () |
| Removes the last element in the vector, effectively reducing the container size by one, decrease the reference count of the deleted object.
|
|
void | eraseObject (T object, bool removeAll=false) |
| Remove a certain object in Vector. More...
|
|
iterator | erase (iterator position) |
| Removes from the vector with an iterator. More...
|
|
iterator | erase (iterator first, iterator last) |
| Removes from the vector with a range of elements ( [first, last) ). More...
|
|
iterator | erase (size_t index) |
| Removes from the vector with an index. More...
|
|
void | clear () |
| Removes all elements from the vector (which are destroyed), leaving the container with a size of 0. More...
|
|
void | swap (T object1, T object2) |
| Swap two elements.
|
|
void | swap (size_t index1, size_t index2) |
| Swap two elements with certain indexes.
|
|
void | replace (size_t index, T object) |
| Replace object at index with another object. More...
|
|
void | reverse () |
| reverses the vector
|
|
void | shrink_to_fit () |
| Shrinks the vector so the memory footprint corresponds with the number of items.
|
|
template<typename T>
class unordered_ref_array< T >
similar to unordered array except that it will automatically call addref/Release when obj is added/removed.
it has fast random access, insertion, and deletion. This class is often used to keep track of a collection of CBaseObject or other reference counted objects, such as child nodes. e.g. typedef unordered_ref_array<CBaseObject*> CChildObjectList_Type; typedef unordered_ref_array<CRefCounted*> CChildObjectList_Type;