Array< T > Class Template Reference
[Collections]

Fixed length array with DEBUG build bounds checking. More...

#include <Array.h>

Inheritance diagram for Array< T >:
IEnumerable< T > IMemoryValidate

List of all members.

Classes

class  Iterator

Public Member Functions

 Array (int count)
 constructor.
 Array (const Array &v)
 Array (const T *v, int len)
Arrayoperator= (const Array &v)
Iterator Begin () const
ElementAt (const int pos) const
 Get an element.
T & ElementAtRef (const int pos) const
 Get a reference to an element.
void SetElementAt (const int pos, T val)
T & operator[] (const int idx)
const T & operator[] (const int idx) const
 operator T * () const
T * Data () const
void Clear ()
 Resets the vector count to zero.
void Clear (int start, int len)
void ClearBinary ()
void ClearBinary (int start, int len)
int Count () const
 Number of elements in the vector.
int Length () const
bool Equals (const Array< T > &a) const
bool AreElementsEqualTo (const T &val) const
RefCountPtr< Array< T > > Clone () const
void CopyTo (Array< T > &to, int sourceStart) const
void CopyTo (Array< T > &to) const
void CopyToBinary (Array< T > &to, int sourceStart) const
void CopyToBinary (Array< T > &to) const
void CheckMem () const
void ValidateMem () const

Static Public Member Functions

static bool Equals (const Array< T > &a, const Array< T > &b)
static bool Equals (const Array< T > &a, int astart, const Array< T > &b, int bstart, int len)
static void Copy (const Array< T > &from, int fromStart, Array< T > &to, int toStart, int length)
static void CopyBinary (const Array< T > &from, int fromStart, Array< T > &to, int toStart, int length)

Protected Member Functions

virtual RefCountPtr< IIterator
< T > > 
IteratorPtr ()

Detailed Description

template<typename T>
class Array< T >

Fixed length array with DEBUG build bounds checking.

Todo:
There are probably places in the library that should use this instead of raw pointers.

Definition at line 44 of file Array.h.


Constructor & Destructor Documentation

template<typename T>
Array< T >::Array ( int  count  )  [inline]

constructor.

Definition at line 112 of file Array.h.


Member Function Documentation

template<typename T>
void Array< T >::Clear (  )  [inline]

Resets the vector count to zero.

Does not deallocate or clear any vector elements.

Definition at line 277 of file Array.h.

Referenced by Array< byte >::Clear().

template<typename T>
int Array< T >::Count (  )  const [inline]

Number of elements in the vector.

Definition at line 309 of file Array.h.

template<typename T>
T Array< T >::ElementAt ( const int  pos  )  const [inline]

Get an element.

Parameters:
pos[in] Index in the vector.
Returns:
T

Definition at line 218 of file Array.h.

template<typename T>
T& Array< T >::ElementAtRef ( const int  pos  )  const [inline]

Get a reference to an element.

Parameters:
pos[in] Index in the vector.
Returns:
T

Definition at line 234 of file Array.h.


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