AlignedArray< T > Class Template Reference

#include <tAlignedArray.h>

Inheritance diagram for AlignedArray< T >:

Inheritance graph
[legend]
List of all members.

Detailed Description


template<typename T> class AlignedArray< T >

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


Public Member Functions

 AlignedArray ()
 AlignedArray (const U32 arraySize, const U32 elementSize)
 Create an AlignedArray.
 AlignedArray (const U32 arraySize, const U32 elementSize, U8 *buffer, bool takeOwn)
 Create an AlignedArray.
 ~AlignedArray ()
void setCapacity (const U32 arraySize, const U32 elementSize)
void setCapacity (const U32 arraySize, const U32 elementSize, U8 *buffer, bool takeOwn)
U32 size () const
 Size of the array.
void setSize (U32 newsize)
 Set a new array size (up to initial size created returned by capacity).
U32 capacity () const
 Capacity of the array (you can setCapacity the size this high).
U32 getElementSize () const
 Returns the size of an element (useful for asserting, etc).
const voidgetBuffer () const
T & operator[] (const U32)
const T & operator[] (const U32) const

Protected Attributes

U32 mElementSize
U32 mElementCount
U32 mCapacity
U8mBuffer
bool mOwnBuffer


Constructor & Destructor Documentation

template<typename T>
AlignedArray< T >::AlignedArray (  )  [inline]

template<typename T>
AlignedArray< T >::AlignedArray ( const U32  arraySize,
const U32  elementSize 
) [inline]

Create an AlignedArray.

Parameters:
arraySize How many items
elementSize Size of each element (including padding)

template<typename T>
AlignedArray< T >::AlignedArray ( const U32  arraySize,
const U32  elementSize,
U8 buffer,
bool  takeOwn 
) [inline]

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

template<typename T>
AlignedArray< T >::~AlignedArray (  )  [inline]


Member Function Documentation

template<typename T>
void AlignedArray< T >::setCapacity ( const U32  arraySize,
const U32  elementSize 
) [inline]

template<typename T>
void AlignedArray< T >::setCapacity ( const U32  arraySize,
const U32  elementSize,
U8 buffer,
bool  takeOwn 
) [inline]

template<typename T>
U32 AlignedArray< T >::size (  )  const [inline]

Size of the array.

template<typename T>
void AlignedArray< T >::setSize ( U32  newsize  )  [inline]

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

template<typename T>
U32 AlignedArray< T >::capacity (  )  const [inline]

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

template<typename T>
U32 AlignedArray< T >::getElementSize (  )  const

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

template<typename T>
const void * AlignedArray< T >::getBuffer (  )  const

template<typename T>
T & AlignedArray< T >::operator[] ( const   U32  )  [inline]

template<typename T>
const T & AlignedArray< T >::operator[] ( const   U32  )  const [inline]


Member Data Documentation

template<typename T>
U32 AlignedArray< T >::mElementSize [protected]

template<typename T>
U32 AlignedArray< T >::mElementCount [protected]

template<typename T>
U32 AlignedArray< T >::mCapacity [protected]

template<typename T>
U8* AlignedArray< T >::mBuffer [protected]

template<typename T>
bool AlignedArray< T >::mOwnBuffer [protected]