#include <Memory.h>
Public Member Functions | |
GrowArray (unsigned start=512) | |
unsigned | getNext () |
Request one new elements. Return as index to array. | |
unsigned | getMore (unsigned number) |
Request several new elements. Return index to array of the first element. | |
T * | operator[] (unsigned index) |
Return elemnt at given index. The return pointer can be invalid after subsequent memory requests. | |
size_t | size () |
Return number of used elements. | |
Private Attributes | |
unsigned | count |
Number of currently used elements. | |
unsigned | allocated |
Number of currently alocated elements. | |
T * | data |
Array of elements. |
Somewhat similar to std::vector but using realloc function on out of capacity, so growing might not require data copy. It doe's not support iterators but data placed in this array will usualy be copied to video card memory, where iterator cannot be used anyway and using index for all operations is therefore more benefitial.