GrowArray< T > Class Template Reference

Simple growing array. More...

#include <Memory.h>

List of all members.

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.


Detailed Description

template<typename T>
class GrowArray< T >

Simple growing array.

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.


The documentation for this class was generated from the following file:

Generated on Fri Jan 23 00:21:49 2009 for Raytracer by  doxygen 1.5.7.1