#include <caf/streamableptrarray.h>
class ContentAccess::RStreamablePtrArray |
Public Member Functions | |
---|---|
RStreamablePtrArray() | |
void | AppendL(T *) |
void | Close() |
TInt | Count() |
void | ExternalizeL(RWriteStream &) |
void | InternalizeL(RReadStream &) |
void | RemoveL(TInt) |
void | ResetAndDestroy() |
T * | operator[](TInt) |
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
void | AppendL | ( | T * | aElement | ) | [inline] |
Append an element to the array
Ownership of the pointer is transferred to the array
Parameter | Description |
---|---|
aElement | The item to add to the array |
void | ExternalizeL | ( | RWriteStream & | aStream | ) | const [inline] |
Write the entire array to a stream
void | InternalizeL | ( | RReadStream & | aStream | ) | [inline] |
Add array elements from a stream
void | RemoveL | ( | TInt | aIndex | ) | [inline] |
Remove an element from the array. Note that the function does not delete the pointer.
T * | operator[] | ( | TInt | aIndex | ) | const [inline] |
Return a pointer to an element at a given index in the array
Parameter | Description |
---|---|
aIndex | The zero based index in the array, must be less than Count() |
Returns: A pointer to the object stored in the array