RioEngine  0.1
My first attempt to create a 3D WYSIWYG Game Engine
CArray< T > Class Template Reference

#include <carray.h>

Inheritance diagram for CArray< T >:
CObject

Public Member Functions

 CArray (T *_array, unsigned int size)
 CArray. More...
 
 CArray (const CArray &_array)
 CArray. More...
 
objectAtIndex (unsigned int index) const
 
T * data () const
 
unsigned int size () const
 
std::vector< T > * toStdVector () const
 
 ~CArray ()
 
- Public Member Functions inherited from CObject
 CObject ()
 
 CObject (const CObject &object)
 
CObjectoperator= (const CObject &object)
 
CObjectretain ()
 
unsigned int release () const
 
CObjectautorelease ()
 
unsigned int retainCount () const
 
bool isValidCObject () const
 
virtual ~CObject ()
 

Static Public Member Functions

static CArrayfromStdVector (std::vector< T > *vec)
 
static CArrayfromBtAlignedObjectArray (btAlignedObjectArray< T > *vec)
 
- Static Public Member Functions inherited from CObject
static void safeRetain (void *pointer)
 
template<class T >
static void safeRelease (T *pointer)
 
template<class T >
static void safeReleaseArray (T *array)
 
static void safeRelease (const char *pointer)
 

Protected Attributes

unsigned int m_size
 
T * m_array
 

Additional Inherited Members

- Protected Member Functions inherited from CObject
virtual void copyValuesFromObject (const CObject &object)
 

Detailed Description

template<class T>
class CArray< T >

Very simple Array Wrapper class that holds an array of the specified type along with its size. It is immutable once initalized. PS: Very shallow compared to std::vector, but it was very fun to work with it!

Definition at line 43 of file carray.h.

Constructor & Destructor Documentation

template<class T>
CArray< T >::CArray ( T *  _array,
unsigned int  size 
)
inline

CArray.

Parameters
_arrayThe raw array
sizeThe size of the array

Definition at line 50 of file carray.h.

template<class T>
CArray< T >::CArray ( const CArray< T > &  _array)
inline

CArray.

Parameters
_arrayThe original CArray object

Definition at line 64 of file carray.h.

template<class T>
CArray< T >::~CArray ( )
inline

Definition at line 168 of file carray.h.

Member Function Documentation

template<class T>
T* CArray< T >::data ( ) const
inline

Returns the raw array

Definition at line 95 of file carray.h.

template<class T>
static CArray* CArray< T >::fromBtAlignedObjectArray ( btAlignedObjectArray< T > *  vec)
inlinestatic

Creates a CArray object from a btAlignedObjectArray object

Definition at line 150 of file carray.h.

template<class T>
static CArray* CArray< T >::fromStdVector ( std::vector< T > *  vec)
inlinestatic

Creates a CArray object from a std::vector object

Definition at line 129 of file carray.h.

template<class T>
T CArray< T >::objectAtIndex ( unsigned int  index) const
inline

Returns the object at the specified index

Definition at line 83 of file carray.h.

template<class T>
unsigned int CArray< T >::size ( ) const
inline

Returns the size of the array

Definition at line 104 of file carray.h.

template<class T>
std::vector<T>* CArray< T >::toStdVector ( ) const
inline

Creates a std::vector object from a CArray object

Definition at line 113 of file carray.h.

Member Data Documentation

template<class T>
T* CArray< T >::m_array
protected

Definition at line 174 of file carray.h.

template<class T>
unsigned int CArray< T >::m_size
protected

Definition at line 173 of file carray.h.


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