ContentAccess::RStreamablePtrArray Class Reference

#include <caf/streamableptrarray.h>

class ContentAccess::RStreamablePtrArray

Detailed Description

Template class used to store an array of pointers that can also write itself to a stream

The RStreamablePtrArray owns all the elements contained within it. The close function must be called before the RStreamablePtrArray goes out of scope.

The close function frees all resources and deletes all array elements

The array can be streamed using the InternalizeL() and ExternalizeL() functions

Constructor & Destructor Documentation

RStreamablePtrArray ( )

RStreamablePtrArray()[inline]

Constructor

Member Function Documentation

AppendL ( T * )

voidAppendL(T *aElement)[inline]

Append an element to the array

Ownership of the pointer is transferred to the array

Parameters
aElementThe item to add to the array

Close ( )

voidClose()[inline]

Free all resources held by the array

Calls ResetAndDestroy();

Count ( )

TInt Count()const [inline]

Count the number of objects in the array

ExternalizeL ( RWriteStream & )

voidExternalizeL(RWriteStream &aStream)const [inline]

Write the entire array to a stream

InternalizeL ( RReadStream & )

voidInternalizeL(RReadStream &aStream)[inline]

Add array elements from a stream

RemoveL ( TInt )

voidRemoveL(TIntaIndex)[inline]

Remove an element from the array. Note that the function does not delete the pointer.

ResetAndDestroy ( )

voidResetAndDestroy()[inline]

Delete all elements in the array

operator[] ( TInt )

T *operator[](TIntaIndex)const [inline]

Return a pointer to an element at a given index in the array

Parameters
aIndexThe zero based index in the array, must be less than Count()
Return Value
A pointer to the object stored in the array