Vector
Engine/source/core/util/tVector.h
A dynamic array template class.
STL interface
bool
empty()
push_front(const T & )
push_front_unique(const T & )
push_back_unique(const T & )
T &
T &
operator[](S32 i)
operator[](S32 i)
Extended interface
sort(compare_func f)
Public Friends
class
Protected Attributes
Protected Functions
Public Functions
Detailed Description
A dynamic array template class.
The vector grows as you insert or append elements. Insertion is fastest at the end of the array. Resizing of the array can be avoided by pre-allocating space using the reserve() method.
STL interface
operator=(const Vector< T > & p)
begin()
begin()
end()
end()
size()
empty()
contains(const T & )
insert(iterator , const T & )
erase(iterator )
front()
front()
back()
back()
push_front(const T & )
push_back(const T & )
push_front_unique(const T & )
push_back_unique(const T & )
find_next(const T & , U32 start)
pop_front()
pop_back()
operator[](U32 )
operator[](U32 )
operator[](S32 i)
operator[](S32 i)
reserve(U32 )
capacity()
typedef T value_type
typedef T & reference
typedef const T & const_reference
typedef T * iterator
typedef const T * const_iterator
typedef S32 difference_type
typedef U32 size_type
typedef difference_type(QSORT_CALLBACK * compare_func )(const T *a, const T *b)
Extended interface
memSize()
address()
setSize(U32 )
increment()
decrement()
increment(U32 )
decrement(U32 )
insert(U32 )
insert(U32 , const T & )
erase(U32 )
erase_fast(U32 )
erase(U32 index, U32 count)
erase_fast(iterator )
clear()
compact()
sort(compare_func f)
fill(const T & value)
remove(const T & )
Finds the first matching element and erases it.
return:
Returns true if a match is found.
first()
last()
first()
last()
set(void * addr, U32 sz)
merge(const Vector & p)
Appends the content of the vector to this one.
merge(const T * addr, U32 count)
Appends the content of the array to the vector.
Parameters:
addr | A pointer to the first item of the array to merge. |
count | The number of elements in the array to merge. |
reverse()
Public Friends
Protected Attributes
T * mArray
Pointer to the Vector elements.
U32 mArraySize
Number of elements allocated for the Vector.
U32 mElementCount
Number of elements currently in the Vector.