Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <e32base.h>

Class CArrayFixFlat

class CArrayFixFlat : public CArrayFix< T >;

Description

Array of fixed length objects contained within a flat dynamic buffer.

The elements of the array are instances of the template class T.

The flat dynamic buffer is an instance of a CBufFlat.

The elements can be T or R type objects and must have an accessible default constructor.

Note that, where possible, use the RArray<class T> class as this is more efficient.

Derivation

Members

Defined in CArrayFixFlat:

See also:


Construction and destruction


CArrayFixFlat(TInt)

inline CArrayFixFlat(TInt aGranularity);

Description

Constructs a flat array of fixed length objects with the specified granularity.

The length of all array elements is the length of the class passed as the template parameter. The length must be non-zero.

Note that no memory is allocated to the array buffer by this constructor.

Parameters

TInt aGranularity

The granularity of the array.

Panic codes

E32USER-CBase

17, if the length of the class implied by the template parameter is zero.

E32USER-CBase

18, if aGranularity is not positive.

[Top]


Member functions


SetReserveL(TInt)

inline void SetReserveL(TInt aCount);

Description

Reserves space in the array buffer.

If necessary, the array buffer is allocated or re-allocated so that it can accommodate the specified number of elements.

After a successful call to this function, elements can be added to the array and the process is guaranteed not to fail for lack of memory - provided the total number of elements does not exceed the number specified in this function.

This function does not increase the number of elements in the array; i.e. the member function CArrayFixBase::Count()const returns the same value both before and after a call to CArrayFixFlat::SetReserveL(TInt).

Parameters

TInt aCount

The total number of elements for which space is to be reserved.

Panic codes

E32USER-CBase

27, if aCount is less than the current number of elements in the array.