AlignedArray

Engine/source/core/util/tAlignedArray.h

This is a fixed size class that will align its elements on configurable boundaries.

More...

Public Functions

AlignedArray(const U32 arraySize, const U32 elementSize)

Create an AlignedArray.

AlignedArray(const U32 arraySize, const U32 elementSize, U8 * buffer, bool takeOwn)

Create an AlignedArray.

Capacity of the array (you can setCapacity the size this high)

Returns a pointer to the raw buffer data.

Returns the size of an element (useful for asserting, etc)

setCapacity(const U32 arraySize, const U32 elementSize)
setCapacity(const U32 arraySize, const U32 elementSize, U8 * buffer, bool takeOwn)
setSize(U32 newsize)

Set a new array size (up to initial size created returned by capacity)

size()

Size of the array.

Detailed Description

This is a fixed size class that will align its elements on configurable boundaries.

Protected Attributes

U8 * mBuffer 
U32 mCapacity 
U32 mElementCount 
U32 mElementSize 
bool mOwnBuffer 

Public Functions

AlignedArray()

AlignedArray(const U32 arraySize, const U32 elementSize)

Create an AlignedArray.

Parameters:

arraySize

How many items

elementSize

Size of each element (including padding)

AlignedArray(const U32 arraySize, const U32 elementSize, U8 * buffer, bool takeOwn)

Create an AlignedArray.

Parameters:

arraySize

How many items

elementSize

Size of each element (including padding)

buffer

Preallocated buffer (with data and aligned on elementSize boundaries)

takeOwn

If true, this class will take ownership of the buffer and free on destruct

~AlignedArray()

capacity()

Capacity of the array (you can setCapacity the size this high)

getBuffer()

getBuffer()

Returns a pointer to the raw buffer data.

getBufferSize()

getElementSize()

Returns the size of an element (useful for asserting, etc)

operator[](const U32)

operator[](const U32)

setCapacity(const U32 arraySize, const U32 elementSize)

setCapacity(const U32 arraySize, const U32 elementSize, U8 * buffer, bool takeOwn)

setSize(U32 newsize)

Set a new array size (up to initial size created returned by capacity)

size()

Size of the array.