CMTPTypeArray Class Reference

class CMTPTypeArray : public CBase

Defines the MTP array data type. MTP arrays consist of a contiguous sequence of objects of the same fixed length type, and are zero based. MTP does not define variable length arrays, e.g. of string objects. Arrays are prepended with a single 32-bit unsigned integer that identifies the number of elements to follow. An empty array would consist of a single 32-bit integer containing the value 0x00000000.

MTP arrays are stored in a flat buffer to optimize streaming performance to/from the MTP transport connection.

Inherits from

Public Member Functions
~CMTPTypeArray ()
IMPORT_C void AppendInt64L ( TInt64 )
IMPORT_C void AppendIntL ( TInt )
IMPORT_C void AppendL (const MMTPType &)
IMPORT_C void AppendL (const RArray < TInt > &)
IMPORT_C void AppendL (const RArray < TUint > &)
IMPORT_C void AppendL (const RArray < TInt64 > &)
IMPORT_C void AppendL (const RArray < TUint64 > &)
IMPORT_C void AppendUint64L ( TUint64 )
IMPORT_C void AppendUintL ( TUint )
IMPORT_C void Array ( RArray < TInt > &)
IMPORT_C void Array ( RArray < TUint > &)
IMPORT_C void Array ( RArray < TInt64 > &)
IMPORT_C void Array ( RArray < TUint64 > &)
IMPORT_C MMTPType * CommitChunkL ( TPtr8 &)
IMPORT_C TBool CommitRequired ()
IMPORT_C TInt ElementInt ( TUint )
IMPORT_C TInt64 ElementInt64 ( TUint )
IMPORT_C void ElementL ( TUint , MMTPType &)
IMPORT_C TInt ElementType ()
IMPORT_C TUint ElementUint ( TUint )
IMPORT_C TUint64 ElementUint64 ( TUint )
IMPORT_C TInt FirstReadChunk ( TPtrC8 &)
IMPORT_C TInt FirstWriteChunk ( TPtr8 &)
IMPORT_C CMTPTypeArray * NewL ( TInt , TUint )
IMPORT_C CMTPTypeArray * NewL ( TInt , TInt , TUint )
IMPORT_C CMTPTypeArray * NewL ( TInt )
IMPORT_C CMTPTypeArray * NewL ( TInt , const RArray < TInt > &)
IMPORT_C CMTPTypeArray * NewL ( TInt , const RArray < TUint > &)
IMPORT_C CMTPTypeArray * NewL (const RArray < TInt64 > &)
IMPORT_C CMTPTypeArray * NewL (const RArray < TUint64 > &)
IMPORT_C CMTPTypeArray * NewLC ( TInt , TUint )
IMPORT_C CMTPTypeArray * NewLC ( TInt , TInt , TUint )
IMPORT_C CMTPTypeArray * NewLC ( TInt )
IMPORT_C CMTPTypeArray * NewLC ( TInt , const RArray < TInt > &)
IMPORT_C CMTPTypeArray * NewLC ( TInt , const RArray < TUint > &)
IMPORT_C CMTPTypeArray * NewLC (const RArray < TInt64 > &)
IMPORT_C CMTPTypeArray * NewLC (const RArray < TUint64 > &)
IMPORT_C TInt NextReadChunk ( TPtrC8 &)
IMPORT_C TInt NextWriteChunk ( TPtr8 &)
IMPORT_C TUint32 NumElements ()
IMPORT_C void SetByDesL (const TDesC8 &)
IMPORT_C TUint64 Size ()
IMPORT_C void ToDes ( TDes8 &)
IMPORT_C TUint Type ()
IMPORT_C TInt Validate ()
Private Member Functions
CMTPTypeArray ( TInt , TInt , TUint )
void AppendL (const TAny *)
TUint64 BufferSize ( TUint32 )
void ConstructL ( TUint32 )
void ConstructL (const RPointerArray < MMTPType > &)
void Element ( TUint , TAny *)
TUint Offset ( TUint )
void ReAllocBufferL ( TUint32 )
void SetInvalidL ()
void SetNumElements ( TUint32 )
void SimpleArrayTypeMetaDataL ( TInt , TInt &, TUint &)
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Private Member Enumerations
enum TWriteSequenceState { EIdle , ENumElements , EElements }
Private Attributes
TInt iArrayType
RBuf8 iBuffer
TUint64 iElementSize
TInt iElementType
TInt iValidationState
TUint iWriteSequenceState

Constructor & Destructor Documentation

CMTPTypeArray(TInt, TInt, TUint)

CMTPTypeArray ( TInt aArrayType,
TInt aElementType,
TUint aElementSize
) [private]

Parameters

TInt aArrayType
TInt aElementType
TUint aElementSize

~CMTPTypeArray()

IMPORT_C ~CMTPTypeArray ( )

Destructor

Member Functions Documentation

AppendInt64L(TInt64)

IMPORT_C void AppendInt64L ( TInt64 aElement )
Appends the specified element to the end of the MTP array. The array element type MUST be of the MTP INT64 type.
leave
One of the system wide error codes, if a processing failure occurs.
panic
MTPDataTypes 3, if aElement does not match the MTP array's element type.

Parameters

TInt64 aElement The element to be appended to the MTP array.

AppendIntL(TInt)

IMPORT_C void AppendIntL ( TInt aElement )
Appends the specified element to the end of the MTP array. The array element type MUST be one of the MTP INT8, INT16, or INT32 types.
leave
One of the system wide error codes, if a processing failure occurs.
panic
MTPDataTypes 3, if aElement does not match the MTP array's element type.

Parameters

TInt aElement The element to be appended to the MTP array.

AppendL(const MMTPType &)

IMPORT_C void AppendL ( const MMTPType & aElement )
Appends the specified element to the end of the MTP array.
leave
One of the system wide error codes, if a processing failure occurs.
panic
MTPDataTypes 3, if aElement does not match the MTP type of the elements contained in the array.

Parameters

const MMTPType & aElement The element to be appended to the MTP array.

AppendL(const RArray< TInt > &)

IMPORT_C void AppendL ( const RArray < TInt > & aElements )
Appends the specified elements to the end of the MTP array. The array element type MUST be one of the MTP INT8, INT16, or INT32 types.
leave
One of the system wide error codes, if a processing failure occurs.
panic
MTPDataTypes 3, if aElement does not match the MTP array's element type.

Parameters

const RArray < TInt > & aElements The elements to be appended to the MTP array.

AppendL(const RArray< TUint > &)

IMPORT_C void AppendL ( const RArray < TUint > & aElements )
Appends the specified elements to the end of the MTP array. The array element type MUST be one of the MTP UINT8, UINT16, or UINT32 types.
leave
One of the system wide error codes, if a processing failure occurs.
panic
MTPDataTypes 3, if aElement does not match the MTP array's element type.

Parameters

const RArray < TUint > & aElements The elements to be appended to the MTP array.

AppendL(const RArray< TInt64 > &)

IMPORT_C void AppendL ( const RArray < TInt64 > & aElements )
Appends the specified elements to the end of the MTP array. The array element type MUST be of the MTP INT64 type.
leave
One of the system wide error codes, if a processing failure occurs.
panic
MTPDataTypes 3, if aElement does not match the MTP array's element type.

Parameters

const RArray < TInt64 > & aElements The elements to be appended to the MTP array.

AppendL(const RArray< TUint64 > &)

IMPORT_C void AppendL ( const RArray < TUint64 > & aElements )
Appends the specified elements to the end of the MTP array. The array element type MUST be of the MTP UINT64 type.
leave
One of the system wide error codes, if a processing failure occurs.
panic
MTPDataTypes 3, if aElement does not match the MTP array's element type.

Parameters

const RArray < TUint64 > & aElements The elements to be appended to the MTP array.

AppendL(const TAny *)

void AppendL ( const TAny * aElement ) [private]

Parameters

const TAny * aElement

AppendUint64L(TUint64)

IMPORT_C void AppendUint64L ( TUint64 aElement )
Appends the specified element to the end of the MTP array. The array element type MUST be of the MTP UINT64 type.
leave
One of the system wide error codes, if a processing failure occurs.
panic
MTPDataTypes 3, if aElement does not match the MTP array's element type.

Parameters

TUint64 aElement The element to be appended to the MTP array.

AppendUintL(TUint)

IMPORT_C void AppendUintL ( TUint aElement )
Appends the specified element to the end of the MTP array. The array element type MUST be one of the MTP UINT8, UINT16, or UINT32 types.
leave
One of the system wide error codes, if a processing failure occurs.
panic
MTPDataTypes 3, if aElement does not match the MTP array's element type.

Parameters

TUint aElement The element to be appended to the MTP array.

Array(RArray< TInt > &)

IMPORT_C void Array ( RArray < TInt > & aElements ) const
Provides a copy of the MTP array's element content. The array element type MUST be one of the MTP INT8, INT16, or INT32 types.
panic
MTPDataTypes 3, if aElement does not match the MTP array's element type.

Parameters

RArray < TInt > & aElements On completion, a copy of the MTP array's element content.

Array(RArray< TUint > &)

IMPORT_C void Array ( RArray < TUint > & aElements ) const
Provides a copy of the MTP array's element content. The array element type MUST be one of the MTP UINT8, UINT16, or UINT32 types.
panic
MTPDataTypes 3, if aElement does not match the MTP array's element type.

Parameters

RArray < TUint > & aElements On completion, a copy of the MTP array's element content.

Array(RArray< TInt64 > &)

IMPORT_C void Array ( RArray < TInt64 > & aElements ) const
Provides a copy of the MTP array's element content. The array element type MUST be of the MTP INT64 type.
panic
MTPDataTypes 3, if aElement does not match the MTP array's element type.

Parameters

RArray < TInt64 > & aElements On completion, a copy of the MTP array's element content.

Array(RArray< TUint64 > &)

IMPORT_C void Array ( RArray < TUint64 > & aElements ) const
Provides a copy of the MTP array's element content. The array element type MUST be of the MTP UINT64 type.
panic
MTPDataTypes 3, if aElement does not match the MTP array's element type.

Parameters

RArray < TUint64 > & aElements On completion, a copy of the MTP array's element content.

BufferSize(TUint32)

TUint64 BufferSize ( TUint32 aNumElements ) const [private]

Parameters

TUint32 aNumElements

CommitChunkL(TPtr8 &)

IMPORT_C MMTPType * CommitChunkL ( TPtr8 & aChunk )

Parameters

TPtr8 & aChunk

CommitRequired()

IMPORT_C TBool CommitRequired ( ) const

ConstructL(TUint32)

void ConstructL ( TUint32 aNumElements ) [private]

Parameters

TUint32 aNumElements

ConstructL(const RPointerArray< MMTPType > &)

void ConstructL ( const RPointerArray < MMTPType > & aElements ) [private]

Parameters

const RPointerArray < MMTPType > & aElements

Element(TUint, TAny *)

void Element ( TUint aIndex,
TAny * aElement
) const [private]

Parameters

TUint aIndex
TAny * aElement

ElementInt(TUint)

IMPORT_C TInt ElementInt ( TUint aIndex ) const
Provides a copy of the MTP element at the specified array index. The array element type MUST be one of the MTP INT8, INT16, or INT32 types.
panic
MTPDataTypes 2, if aIndex is greater than or equal to the number of objects currently contained in the array.
panic
MTPDataTypes 3, if aElement does not match the MTP array's element type.

Parameters

TUint aIndex The index in the MTP array of the required element.

ElementInt64(TUint)

IMPORT_C TInt64 ElementInt64 ( TUint aIndex ) const
Provides a copy of the MTP element at the specified array index. The array element type MUST be of the MTP INT64 type.
panic
MTPDataTypes 2, if aIndex is greater than or equal to the number of objects currently contained in the array.
panic
MTPDataTypes 3, if aElement does not match the MTP array's element type.

Parameters

TUint aIndex The index in the MTP array of the required element.

ElementL(TUint, MMTPType &)

IMPORT_C void ElementL ( TUint aIndex,
MMTPType & aElement
) const
Provides a copy of the MTP element at the specified array index.
leave
One of the system wide error codes, if a processing failure occurs.
panic
MTPDataTypes 2, if aIndex is greater than or equal to the number of objects currently contained in the array.
panic
MTPDataTypes 3, if aElement does not match the MTP type of the elements contained in the array.
panic
MTPDataTypes 4, if aElement's size does not match that of the elements contained in the array.

Parameters

TUint aIndex The index in the MTP array of the required element.
MMTPType & aElement On completion, a copy of the required element.

ElementType()

IMPORT_C TInt ElementType ( ) const

Provides the MTP identifier of the elements contained in the array.

ElementUint(TUint)

IMPORT_C TUint ElementUint ( TUint aIndex ) const
Provides a copy of the MTP element at the specified array index. The array element type MUST be one of the MTP UINT8, UINT16, or UINT32 types.
panic
MTPDataTypes 2, if aIndex is greater than or equal to the number of objects currently contained in the array.
panic
MTPDataTypes 3, if aElement does not match the MTP array's element type.

Parameters

TUint aIndex The index in the MTP array of the required element.

ElementUint64(TUint)

IMPORT_C TUint64 ElementUint64 ( TUint aIndex ) const
Provides a copy of the MTP element at the specified array index. The array element type MUST be of the MTP UINT64 type.
panic
MTPDataTypes 2, if aIndex is greater than or equal to the number of objects currently contained in the array.
panic
MTPDataTypes 3, if aElement does not match the MTP array's element type.

Parameters

TUint aIndex The index in the MTP array of the required element.

FirstReadChunk(TPtrC8 &)

IMPORT_C TInt FirstReadChunk ( TPtrC8 & aChunk ) const

Parameters

TPtrC8 & aChunk

FirstWriteChunk(TPtr8 &)

IMPORT_C TInt FirstWriteChunk ( TPtr8 & aChunk )

Parameters

TPtr8 & aChunk

NewL(TInt, TUint)

IMPORT_C CMTPTypeArray * NewL ( TInt aElementType,
TUint aElementSize
) [static]
MTP array data type factory method. This method is used to create an empty MTP array.
leave
One of the system wide error codes, if a processing failure occurs.

Parameters

TInt aElementType The MTP type identifier of the elements contained in the array.
TUint aElementSize The size (in bytes) of the elements contained in the array.

NewL(TInt, TInt, TUint)

IMPORT_C CMTPTypeArray * NewL ( TInt aArrayType,
TInt aElementType,
TUint aElementSize
) [static]
MTP array data type factory method. This method is used to create an empty MTP array of the specified MTP array type.
leave
One of the system wide error codes, if a processing failure occurs.

Parameters

TInt aArrayType The MTP type identifier to be assigned to the array.
TInt aElementType The MTP type identifier of the elements contained in the array.
TUint aElementSize The size (in bytes) of the elements contained in the array.

NewL(TInt)

IMPORT_C CMTPTypeArray * NewL ( TInt aArrayType ) [static]
MTP simple data type array factory method. This method is used to create an empty MTP array of the specified MTP simple data type.
leave
KErrArgument, if aArrayType is not in the range EMTPTypeFirstSimpleArrayType ... EMTPTypeLastSimpleArrayType.
leave
One of the system wide error codes, if a processing failure occurs.

Parameters

TInt aArrayType The array data type indentifier datacode. This must be in the range EMTPTypeFirstSimpleArrayType ... EMTPTypeLastSimpleArrayType.

NewL(TInt, const RArray< TInt > &)

IMPORT_C CMTPTypeArray * NewL ( TInt aArrayType,
const RArray < TInt > & aElements
) [static]
MTP simple data type array factory method. This method is used to create an MTP array of the specified MTP simple data type with the specified element content.
leave
KErrArgument, if aArrayType is not in the range EMTPTypeFirstSimpleArrayType ... EMTPTypeLastSimpleArrayType.
leave
One of the system wide error codes, if a processing failure occurs.

Parameters

TInt aArrayType The array data type indentifier datacode. This must be in the range EMTPTypeFirstSimpleArrayType ... EMTPTypeLastSimpleArrayType.
const RArray < TInt > & aElements The initial set of element values.

NewL(TInt, const RArray< TUint > &)

IMPORT_C CMTPTypeArray * NewL ( TInt aArrayType,
const RArray < TUint > & aElements
) [static]
MTP simple data type array factory method. This method is used to create an MTP array of the specified MTP simple data type with the specified element content.
leave
KErrArgument, if aArrayType is not in the range EMTPTypeFirstSimpleArrayType ... EMTPTypeLastSimpleArrayType.
leave
One of the system wide error codes, if a processing failure occurs.

Parameters

TInt aArrayType The array data type indentifier datacode. This must be in the range EMTPTypeFirstSimpleArrayType ... EMTPTypeLastSimpleArrayType.
const RArray < TUint > & aElements The initial set of element values.

NewL(const RArray< TInt64 > &)

IMPORT_C CMTPTypeArray * NewL ( const RArray < TInt64 > & aElements ) [static]
MTP AINT64 array factory method. This method is used to create an MTP AINT64 array with the specified element content.
leave
KErrArgument, if aArrayType is not in the range EMTPTypeFirstSimpleArrayType ... EMTPTypeLastSimpleArrayType.
leave
One of the system wide error codes, if a processing failure occurs.

Parameters

const RArray < TInt64 > & aElements The initial set of element values.

NewL(const RArray< TUint64 > &)

IMPORT_C CMTPTypeArray * NewL ( const RArray < TUint64 > & aElements ) [static]
MTP AUINT64 array factory method. This method is used to create an MTP AINT64 array with the specified element content.
leave
KErrArgument, if aArrayType is not in the range EMTPTypeFirstSimpleArrayType ... EMTPTypeLastSimpleArrayType.
leave
One of the system wide error codes, if a processing failure occurs.

Parameters

const RArray < TUint64 > & aElements The initial set of element values.

NewLC(TInt, TUint)

IMPORT_C CMTPTypeArray * NewLC ( TInt aElementType,
TUint aElementSize
) [static]
MTP array data type factory method. This method is used to create an empty MTP array. A pointer to the MTP array data type is placed on the cleanup stack.
leave
One of the system wide error codes, if a processing failure occurs.

Parameters

TInt aElementType The MTP type identifier of the elements contained in the array.
TUint aElementSize The size (in bytes) of the elements which contained in array.

NewLC(TInt, TInt, TUint)

IMPORT_C CMTPTypeArray * NewLC ( TInt aArrayType,
TInt aElementType,
TUint aElementSize
) [static]
MTP array data type factory method. This method is used to create an empty MTP array of the specified MTP array type. A pointer to the MTP array data type is placed on the cleanup stack.
leave
One of the system wide error codes, if a processing failure occurs.

Parameters

TInt aArrayType The MTP type identifier to be assigned to the array.
TInt aElementType The MTP type identifier of the elements contained in the array.
TUint aElementSize The size (in bytes) of the elements which contained in array.

NewLC(TInt)

IMPORT_C CMTPTypeArray * NewLC ( TInt aArrayType ) [static]
MTP simple data type array factory method. This method is used to create an empty MTP array of the specified MTP simple data type. A pointer to the MTP array data type is placed on the cleanup stack.
leave
KErrArgument, if aArrayType is not in the range EMTPTypeFirstSimpleArrayType ... EMTPTypeLastSimpleArrayType.
leave
One of the system wide error codes, if a processing failure occurs.

Parameters

TInt aArrayType The array data type indentifier datacode. This must be in the range EMTPTypeFirstSimpleArrayType ... EMTPTypeLastSimpleArrayType.

NewLC(TInt, const RArray< TInt > &)

IMPORT_C CMTPTypeArray * NewLC ( TInt aArrayType,
const RArray < TInt > & aElements
) [static]
MTP simple data type array factory method. This method is used to create an MTP array of the specified MTP simple data type with the specified element content. A pointer to the MTP array data type is placed on the cleanup stack.
leave
KErrArgument, if aArrayType is not in the range EMTPTypeFirstSimpleArrayType ... EMTPTypeLastSimpleArrayType.
leave
One of the system wide error codes, if a processing failure occurs.

Parameters

TInt aArrayType The array data type indentifier datacode. This must be in the range EMTPTypeFirstSimpleArrayType ... EMTPTypeLastSimpleArrayType.
const RArray < TInt > & aElements The initial set of element values.

NewLC(TInt, const RArray< TUint > &)

IMPORT_C CMTPTypeArray * NewLC ( TInt aArrayType,
const RArray < TUint > & aElements
) [static]
MTP simple data type array factory method. This method is used to create an MTP array of the specified MTP simple data type with the specified element content. A pointer to the MTP array data type is placed on the cleanup stack.
leave
KErrArgument, if aArrayType is not in the range EMTPTypeFirstSimpleArrayType ... EMTPTypeLastSimpleArrayType.
leave
One of the system wide error codes, if a processing failure occurs.

Parameters

TInt aArrayType The array data type indentifier datacode. This must be in the range EMTPTypeFirstSimpleArrayType ... EMTPTypeLastSimpleArrayType.
const RArray < TUint > & aElements The initial set of element values.

NewLC(const RArray< TInt64 > &)

IMPORT_C CMTPTypeArray * NewLC ( const RArray < TInt64 > & aElements ) [static]
MTP AINT64 array factory method. This method is used to create an MTP AINT64 array with the specified element content. A pointer to the MTP array data type is placed on the cleanup stack.
leave
KErrArgument, if aArrayType is not in the range EMTPTypeFirstSimpleArrayType ... EMTPTypeLastSimpleArrayType.
leave
One of the system wide error codes, if a processing failure occurs.

Parameters

const RArray < TInt64 > & aElements The initial set of element values.

NewLC(const RArray< TUint64 > &)

IMPORT_C CMTPTypeArray * NewLC ( const RArray < TUint64 > & aElements ) [static]
MTP AUINT64 array factory method. This method is used to create an MTP AUINT64 array with the specified element content. A pointer to the MTP array data type is placed on the cleanup stack.
leave
KErrArgument, if aArrayType is not in the range EMTPTypeFirstSimpleArrayType ... EMTPTypeLastSimpleArrayType.
leave
One of the system wide error codes, if a processing failure occurs.

Parameters

const RArray < TUint64 > & aElements The initial set of element values.

NextReadChunk(TPtrC8 &)

IMPORT_C TInt NextReadChunk ( TPtrC8 & aChunk ) const

Parameters

TPtrC8 & aChunk

NextWriteChunk(TPtr8 &)

IMPORT_C TInt NextWriteChunk ( TPtr8 & aChunk )

Parameters

TPtr8 & aChunk

NumElements()

IMPORT_C TUint32 NumElements ( ) const

Provides the number of elements contained in the MTP array.

Offset(TUint)

TUint Offset ( TUint aIndex ) const [private]

Parameters

TUint aIndex

ReAllocBufferL(TUint32)

void ReAllocBufferL ( TUint32 aNumElements ) [private]

Parameters

TUint32 aNumElements

SetByDesL(const TDesC8 &)

IMPORT_C void SetByDesL ( const TDesC8 & aDesc )

Parameters

const TDesC8 & aDesc

SetInvalidL()

void SetInvalidL ( ) [private]

SetNumElements(TUint32)

void SetNumElements ( TUint32 aNumElements ) [private]

Parameters

TUint32 aNumElements

SimpleArrayTypeMetaDataL(TInt, TInt &, TUint &)

void SimpleArrayTypeMetaDataL ( TInt aArrayType,
TInt & aElementType,
TUint & aElementSize
) [private, static]

Parameters

TInt aArrayType
TInt & aElementType
TUint & aElementSize

Size()

IMPORT_C TUint64 Size ( ) const

ToDes(TDes8 &)

IMPORT_C void ToDes ( TDes8 & aRetDes ) const

Parameters

TDes8 & aRetDes

Type()

IMPORT_C TUint Type ( ) const [virtual]

Validate()

IMPORT_C TInt Validate ( ) const

Member Enumerations Documentation

Enum TWriteSequenceState

The write data stream states.

Enumerators

EIdle

Write data stream is inactive.

ENumElements

Streaming the NumElements data chunk.

EElements

Streaming the array Element chunks.

Member Data Documentation

TInt iArrayType

TInt iArrayType [private]

The array type's MTP datatype code.

RBuf8 iBuffer

RBuf8 iBuffer [private]

The data buffer.

TUint64 iElementSize

TUint64 iElementSize [private]

The array element type's size in bytes.

TInt iElementType

TInt iElementType [private]

The array element type's MTP datatype code.

TInt iValidationState

TInt iValidationState [private]

The array type's validation state.

TUint iWriteSequenceState

TUint iWriteSequenceState [private]

The write data stream state variable.