Proud::CFixedLengthArray< size, TYPE, ARG_TYPE > Class Template Reference

Public Member Functions

void CheckValidIndex (int nIndex) const
 
int GetSize () const
 
int GetCount () const
 
bool IsEmpty () const
 
const TYPE & GetAt (int nIndex) const
 
TYPE & GetAt (int nIndex)
 
void SetAt (int nIndex, ARG_TYPE newElement)
 
const TYPE & ElementAt (int nIndex) const
 
TYPE & ElementAt (int nIndex)
 
const TYPE * GetData () const
 
TYPE * GetData ()
 
const TYPE & operator[] (int nIndex) const
 
TYPE & operator[] (int nIndex)
 

Detailed Description

template<int size, typename TYPE, typename ARG_TYPE = const TYPE&>
class Proud::CFixedLengthArray< size, TYPE, ARG_TYPE >

Array class with fixed size

  • To 'bounds check' a simple, fixed size array of T data[] format, it is possible to replace with this class to draw stability.

General usage

  • Has similar usage of CAtlArray since this is copied and made from it, but it does not have insertion/removal/cleanup functions since it is static. (of course...)

Note

  • If replacing the existing static array with CFixedLengthArray then there can be cases that either _countof() or sizeof() is used. << must modify them correctly. This is because of the fact that _countof() will always return 1.

Member Function Documentation

template<int size, typename TYPE , typename ARG_TYPE = const TYPE&>
const TYPE& Proud::CFixedLengthArray< size, TYPE, ARG_TYPE >::ElementAt ( int  nIndex) const
inline

Array item accessor

template<int size, typename TYPE , typename ARG_TYPE = const TYPE&>
TYPE& Proud::CFixedLengthArray< size, TYPE, ARG_TYPE >::ElementAt ( int  nIndex)
inline

Array item accessor

template<int size, typename TYPE , typename ARG_TYPE = const TYPE&>
const TYPE& Proud::CFixedLengthArray< size, TYPE, ARG_TYPE >::GetAt ( int  nIndex) const
inline

Array item accessor

template<int size, typename TYPE , typename ARG_TYPE = const TYPE&>
TYPE& Proud::CFixedLengthArray< size, TYPE, ARG_TYPE >::GetAt ( int  nIndex)
inline

Array item accessor

template<int size, typename TYPE , typename ARG_TYPE = const TYPE&>
int Proud::CFixedLengthArray< size, TYPE, ARG_TYPE >::GetCount ( ) const
inline

Gets length of array

template<int size, typename TYPE , typename ARG_TYPE = const TYPE&>
const TYPE* Proud::CFixedLengthArray< size, TYPE, ARG_TYPE >::GetData ( ) const
inline

Gets pointer of array buffer object

template<int size, typename TYPE , typename ARG_TYPE = const TYPE&>
TYPE* Proud::CFixedLengthArray< size, TYPE, ARG_TYPE >::GetData ( )
inline

Gets pointer of array buffer object

template<int size, typename TYPE , typename ARG_TYPE = const TYPE&>
int Proud::CFixedLengthArray< size, TYPE, ARG_TYPE >::GetSize ( ) const
inline

Gets length of array

template<int size, typename TYPE , typename ARG_TYPE = const TYPE&>
bool Proud::CFixedLengthArray< size, TYPE, ARG_TYPE >::IsEmpty ( ) const
inline

Is array empty?

template<int size, typename TYPE , typename ARG_TYPE = const TYPE&>
const TYPE& Proud::CFixedLengthArray< size, TYPE, ARG_TYPE >::operator[] ( int  nIndex) const
inline

Array item accessor

template<int size, typename TYPE , typename ARG_TYPE = const TYPE&>
TYPE& Proud::CFixedLengthArray< size, TYPE, ARG_TYPE >::operator[] ( int  nIndex)
inline

Array item accessor

template<int size, typename TYPE , typename ARG_TYPE = const TYPE&>
void Proud::CFixedLengthArray< size, TYPE, ARG_TYPE >::SetAt ( int  nIndex,
ARG_TYPE  newElement 
)
inline

Array item accessor