OpenBarnyard
 
Loading...
Searching...
No Matches
T2Array< T, Capacity > Class Template Reference

#include <T2Array.h>

Public Member Functions

void InitialiseAll (const T &a_oValue)
 
TINT GetCapacity () const
 
T * GetArray () const
 
T & operator[] (TINT a_iIndex)
 
const T & operator[] (TINT a_iIndex) const
 

Detailed Description

template<class T, TINT Capacity>
class T2Array< T, Capacity >

Definition at line 6 of file T2Array.h.

Member Function Documentation

◆ GetArray()

template<class T, TINT Capacity>
T * T2Array< T, Capacity >::GetArray ( ) const
inline

Definition at line 22 of file T2Array.h.

23 {
24 return TREINTERPRETCAST( T*, m_pData );
25 }
#define TREINTERPRETCAST(TYPE, VALUE)
Definition Defines.h:68

◆ GetCapacity()

template<class T, TINT Capacity>
TINT T2Array< T, Capacity >::GetCapacity ( ) const
inline

Definition at line 17 of file T2Array.h.

18 {
19 return Capacity;
20 }

◆ InitialiseAll()

template<class T, TINT Capacity>
void T2Array< T, Capacity >::InitialiseAll ( const T & a_oValue)
inline

Definition at line 9 of file T2Array.h.

10 {
11 for ( TINT i = 0; i < Capacity; i++ )
12 {
13 this->operator[]( i ) = a_oValue;
14 }
15 }
T & operator[](TINT a_iIndex)
Definition T2Array.h:27

◆ operator[]() [1/2]

template<class T, TINT Capacity>
T & T2Array< T, Capacity >::operator[] ( TINT a_iIndex)
inline

Definition at line 27 of file T2Array.h.

28 {
29 TASSERT( a_iIndex >= 0 && a_iIndex < Capacity );
30 return *( TREINTERPRETCAST( T*, m_pData ) + a_iIndex );
31 }
#define TASSERT(X,...)
Definition Defines.h:138

◆ operator[]() [2/2]

template<class T, TINT Capacity>
const T & T2Array< T, Capacity >::operator[] ( TINT a_iIndex) const
inline

Definition at line 33 of file T2Array.h.

34 {
35 TASSERT( a_iIndex >= 0 && a_iIndex < Capacity );
36 return *( TREINTERPRETCAST( T*, m_pData ) + a_iIndex );
37 }

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