Original Symbian headers
Selected EUSER, Window Server, networking, graphics and device declarations
Loading...
Searching...
No Matches
TFixedArray< T, S > Class Template Reference

A thin wrapper class for C++ arrays allowing automatic checking of index values to ensure that all accesses are legal. More...

#include <e32std.h>

Public Member Functions

 TFixedArray ()
 Default constructor.
 
 TFixedArray (const T *aList, TInt aLength)
 Constructs a C++ array initialised with the specified objects.
 
void Copy (const T *aList, TInt aLength)
 Copies the specified set of contiguous objects into the C++ array.
 
void Reset ()
 Fills every element of the array with binary zeroes.
 
void DeleteAll ()
 Invokes the delete operator on every member of the array.
 
TInt Count () const
 Gets the size of the array.
 
TInt Length () const
 Gets the size of an array element, in bytes.
 
T & operator[] (TInt aIndex)
 Gets a reference to the specified element within the C++ array.
 
const T & operator[] (TInt aIndex) const
 Gets a const reference to the specified element within the C++ array.
 
T & At (TInt aIndex)
 Gets a reference to the specified element within the C++ array.
 
const T & At (TInt aIndex) const
 Gets a const reference to the specified element within the C++ array.
 
T * Begin ()
 Gets a pointer to the first element of the array.
 
T * End ()
 Gets a pointer to the first byte following the end of the array.
 
const T * Begin () const
 Gets a pointer to the first element of the array.
 
const T * End () const
 Gets a pointer to the first byte following the end of the array.
 
TArray< T > Array () const
 Creates and returns a generic array for this C++ array.
 

Static Protected Member Functions

static TBool InRange (TInt aIndex)
 
static TInt CountFunctionR (const CBase *aThis)
 
static const TAny * AtFunctionR (const CBase *aThis, TInt aIndex)
 

Protected Attributes

T iRep [S]
 

Detailed Description

template<class T, TInt S>
class TFixedArray< T, S >

A thin wrapper class for C++ arrays allowing automatic checking of index values to ensure that all accesses are legal.

The class also supports the deletion of objects.

The class is templated, based on a class type and an integer value. The class type defines the type of object contained in the array; the integer value defines the size (dimension) of the array.

A wrapper object can be:

  1. embedded in objects allocated on the heap.
  2. used on the program stack.
API status
Published to all clients. Released API.

Definition at line 5517 of file e32std.h.

Constructor & Destructor Documentation

◆ TFixedArray() [1/2]

template<class T , TInt S>
TFixedArray< T, S >::TFixedArray ( )
inline

Default constructor.

Constructs an uninitialised C++ array.

(generated from Symbian Developer Library)

◆ TFixedArray() [2/2]

template<class T , TInt S>
TFixedArray< T, S >::TFixedArray ( const T *  aList,
TInt  aLength 
)
inline

Constructs a C++ array initialised with the specified objects.

Parameters
aListA pointer to a set of contiguous objects.
aLengthThe number of contiguous objects to be copied. This value must not be negative and must not be greater than the size of the array as defined by the integer template parameter.

Panic condition: USER 133, in a debug build only, if aLength is negative or is greater than the size of the array as defined by the integer template parameter.

(generated from Symbian Developer Library)

Member Function Documentation

◆ Array()

template<class T , TInt S>
TArray< T > TFixedArray< T, S >::Array ( ) const
inline

Creates and returns a generic array for this C++ array.

(generated from Symbian Developer Library)

◆ At() [1/2]

template<class T , TInt S>
T & TFixedArray< T, S >::At ( TInt  aIndex)
inline

Gets a reference to the specified element within the C++ array.

Parameters
aIndexThe position of the element within the array. This is an offset value; a zero value refers to the first element in the array. This value must be greater than or equal to zero and less than the size of the array.

Panic condition: USER 133, if aIndex is negative or greater than or equal to the size of the array as defined by the integer template parameter.

(generated from Symbian Developer Library)

◆ At() [2/2]

template<class T , TInt S>
const T & TFixedArray< T, S >::At ( TInt  aIndex) const
inline

Gets a const reference to the specified element within the C++ array.

Parameters
aIndexThe position of the element within the array. This is an offset value; a zero value refers to the first element in the array. This value must be greater than or equal to zero and less than the size of the array.

Panic condition: USER 133, in a debug build only, if aIndex is negative or greater than or equal to the size of the array as defined by the integer template parameter.

(generated from Symbian Developer Library)

◆ AtFunctionR()

template<class T , TInt S>
static const TAny * TFixedArray< T, S >::AtFunctionR ( const CBase *  aThis,
TInt  aIndex 
)
inlinestaticprotected

◆ Begin() [1/2]

template<class T , TInt S>
T * TFixedArray< T, S >::Begin ( )
inline

Gets a pointer to the first element of the array.

(generated from Symbian Developer Library)

◆ Begin() [2/2]

template<class T , TInt S>
const T * TFixedArray< T, S >::Begin ( ) const
inline

Gets a pointer to the first element of the array.

(generated from Symbian Developer Library)

◆ Copy()

template<class T , TInt S>
void TFixedArray< T, S >::Copy ( const T *  aList,
TInt  aLength 
)
inline

Copies the specified set of contiguous objects into the C++ array.

The copy operation starts at the beginning of the array, replacing any existing data.

Parameters
aListA pointer to a set of contiguous objects.
aLengthThe number of contiguous objects to be copied. This value must not be negative and must not be greater than the size of the array as defined by the integer template parameter.

Panic condition: USER 133, in a debug build only, if aLength is negative or is greater than the size of the array as defined by the integer template parameter.

(generated from Symbian Developer Library)

◆ Count()

template<class T , TInt S>
TInt TFixedArray< T, S >::Count ( ) const
inline

Gets the size of the array.

For any instance of this class, the array size is fixed and has the same value as the integer template parameter.

(generated from Symbian Developer Library)

◆ CountFunctionR()

template<class T , TInt S>
static TInt TFixedArray< T, S >::CountFunctionR ( const CBase *  aThis)
inlinestaticprotected

◆ DeleteAll()

template<class T , TInt S>
void TFixedArray< T, S >::DeleteAll ( )
inline

Invokes the delete operator on every member of the array.

The function can only be used for arrays of pointers to CBase derived objects.

If the array is to be used after a call to this function, it is good practice to call TFixedArray<class T,TInt S>Reset() to set all array elements to NULL.

(generated from Symbian Developer Library)

◆ End() [1/2]

template<class T , TInt S>
T * TFixedArray< T, S >::End ( )
inline

Gets a pointer to the first byte following the end of the array.

(generated from Symbian Developer Library)

◆ End() [2/2]

template<class T , TInt S>
const T * TFixedArray< T, S >::End ( ) const
inline

Gets a pointer to the first byte following the end of the array.

(generated from Symbian Developer Library)

◆ InRange()

template<class T , TInt S>
static TBool TFixedArray< T, S >::InRange ( TInt  aIndex)
inlinestaticprotected

◆ Length()

template<class T , TInt S>
TInt TFixedArray< T, S >::Length ( ) const
inline

Gets the size of an array element, in bytes.

(generated from Symbian Developer Library)

◆ operator[]() [1/2]

template<class T , TInt S>
T & TFixedArray< T, S >::operator[] ( TInt  aIndex)
inline

Gets a reference to the specified element within the C++ array.

Parameters
aIndexThe position of the element within the array. This is an offset value; a zero value refers to the first element in the array. This value must be greater than or equal to zero and less than the size of the array.

Panic condition: USER 133, in a debug build only, if aIndex is negative or greater than or equal to the size of the array as defined by the integer template parameter.

(generated from Symbian Developer Library)

◆ operator[]() [2/2]

template<class T , TInt S>
const T & TFixedArray< T, S >::operator[] ( TInt  aIndex) const
inline

Gets a const reference to the specified element within the C++ array.

Parameters
aIndexThe position of the element within the array. This is an offset value; a zero value refers to the first element in the array. This value must be greater than or equal to zero and less than the size of the array.

Panic condition: USER 133, in a debug build only, if aIndex is negative or greater than or equal to the size of the array as defined by the integer template parameter.

(generated from Symbian Developer Library)

◆ Reset()

template<class T , TInt S>
void TFixedArray< T, S >::Reset ( )
inline

Fills every element of the array with binary zeroes.

(generated from Symbian Developer Library)

Member Data Documentation

◆ iRep

template<class T , TInt S>
T TFixedArray< T, S >::iRep[S]
protected

Definition at line 5548 of file e32std.h.


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