#include <Vector.hpp>
Public Member Functions | |
Vector (UInt32 preferredAllocSize=defaultAllocChunkSize, UInt32 preferredAllocChunkSize=defaultAllocChunkSize) | |
~Vector () | |
T & | operator[] (UInt32 location) |
void | addData (T *dataToAdd, UInt32 count) |
void | setAllocChunkSize (UInt32 preferredAllocChunkSize) |
UInt32 | getStorageSize () |
UInt32 | getSize () |
UInt32 | setSize (UInt32 newSize) |
void | setStorageSize (UInt32 size) |
UInt32 | getStorage (T **storage) |
Vector< T >::Vector | ( | UInt32 | preferredAllocSize = defaultAllocChunkSize , |
|
UInt32 | preferredAllocChunkSize = defaultAllocChunkSize | |||
) | [inline] |
Class constructor with preferred parameters
preferredAllocSize | The allocation size initially | |
preferredAllocChunkSize | The chunk size used for each re-allocation |
void Vector< T >::addData | ( | T * | dataToAdd, | |
UInt32 | count | |||
) | [inline] |
Add directly bytes of data provided into storage.
dataToAdd | Address of location from where data is to be added | |
count | Number of bytes to be added |
UInt32 Vector< T >::getSize | ( | ) | [inline] |
Get the actualy size of stored data
UInt32 Vector< T >::getStorage | ( | T ** | storage | ) | [inline] |
Return the actual storage area of data along with the size of the data contained.
storage | Place where the addess of the storage is saved |
UInt32 Vector< T >::getStorageSize | ( | ) | [inline] |
Get the allocated size of memory allocated
T& Vector< T >::operator[] | ( | UInt32 | location | ) | [inline] |
Access operator for both read and write operation.
Access operator for both read and write operation. Allocates more if access is out of bound No difference was observed specifying const qualifier for read operation, atleast MSVC cannot differentiate between the two.
location | Where to read and/or write |
void Vector< T >::setAllocChunkSize | ( | UInt32 | preferredAllocChunkSize | ) | [inline] |
Set the preferred chunk allocation size
preferredAllocChunkSize | The new preferred size of allocation |
UInt32 Vector< T >::setSize | ( | UInt32 | newSize | ) | [inline] |
Set the stored data size to new value
void Vector< T >::setStorageSize | ( | UInt32 | size | ) | [inline] |
Set the storage size to a new value, more memory might be allocated in the process
size | Required new size |