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 voidAppendInt64L(TInt64)
IMPORT_C voidAppendIntL(TInt)
IMPORT_C voidAppendL(const MMTPType &)
IMPORT_C voidAppendL(const RArray< TInt > &)
IMPORT_C voidAppendL(const RArray< TUint > &)
IMPORT_C voidAppendL(const RArray< TInt64 > &)
IMPORT_C voidAppendL(const RArray< TUint64 > &)
IMPORT_C voidAppendUint64L(TUint64)
IMPORT_C voidAppendUintL(TUint)
IMPORT_C voidArray(RArray< TInt > &)
IMPORT_C voidArray(RArray< TUint > &)
IMPORT_C voidArray(RArray< TInt64 > &)
IMPORT_C voidArray(RArray< TUint64 > &)
IMPORT_C MMTPType *CommitChunkL(TPtr8 &)
IMPORT_C TBoolCommitRequired()
IMPORT_C TIntElementInt(TUint)
IMPORT_C TInt64ElementInt64(TUint)
IMPORT_C voidElementL(TUint, MMTPType &)
IMPORT_C TIntElementType()
IMPORT_C TUintElementUint(TUint)
IMPORT_C TUint64ElementUint64(TUint)
IMPORT_C TIntFirstReadChunk(TPtrC8 &)
IMPORT_C TIntFirstWriteChunk(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 TIntNextReadChunk(TPtrC8 &)
IMPORT_C TIntNextWriteChunk(TPtr8 &)
IMPORT_C TUint32NumElements()
IMPORT_C voidSetByDesL(const TDesC8 &)
IMPORT_C TUint64Size()
IMPORT_C voidToDes(TDes8 &)
IMPORT_C TUintType()
IMPORT_C TIntValidate()
Private Member Functions
CMTPTypeArray(TInt, TInt, TUint)
voidAppendL(const TAny *)
TUint64 BufferSize(TUint32)
voidConstructL(TUint32)
voidConstructL(const RPointerArray< MMTPType > &)
voidElement(TUint, TAny *)
TUint Offset(TUint)
voidReAllocBufferL(TUint32)
voidSetInvalidL()
voidSetNumElements(TUint32)
voidSimpleArrayTypeMetaDataL(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
enumTWriteSequenceState { 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(TIntaArrayType,
TIntaElementType,
TUintaElementSize
)[private]

Parameters

TInt aArrayType
TInt aElementType
TUint aElementSize

~CMTPTypeArray()

IMPORT_C~CMTPTypeArray()

Destructor

Member Functions Documentation

AppendInt64L(TInt64)

IMPORT_C voidAppendInt64L(TInt64aElement)
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 aElementThe element to be appended to the MTP array.

AppendIntL(TInt)

IMPORT_C voidAppendIntL(TIntaElement)
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 aElementThe element to be appended to the MTP array.

AppendL(const MMTPType &)

IMPORT_C voidAppendL(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 & aElementThe element to be appended to the MTP array.

AppendL(const RArray< TInt > &)

IMPORT_C voidAppendL(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 > & aElementsThe elements to be appended to the MTP array.

AppendL(const RArray< TUint > &)

IMPORT_C voidAppendL(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 > & aElementsThe elements to be appended to the MTP array.

AppendL(const RArray< TInt64 > &)

IMPORT_C voidAppendL(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 > & aElementsThe elements to be appended to the MTP array.

AppendL(const RArray< TUint64 > &)

IMPORT_C voidAppendL(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 > & aElementsThe elements to be appended to the MTP array.

AppendL(const TAny *)

voidAppendL(const TAny *aElement)[private]

Parameters

const TAny * aElement

AppendUint64L(TUint64)

IMPORT_C voidAppendUint64L(TUint64aElement)
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 aElementThe element to be appended to the MTP array.

AppendUintL(TUint)

IMPORT_C voidAppendUintL(TUintaElement)
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 aElementThe element to be appended to the MTP array.

Array(RArray< TInt > &)

IMPORT_C voidArray(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 > & aElementsOn completion, a copy of the MTP array's element content.

Array(RArray< TUint > &)

IMPORT_C voidArray(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 > & aElementsOn completion, a copy of the MTP array's element content.

Array(RArray< TInt64 > &)

IMPORT_C voidArray(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 > & aElementsOn completion, a copy of the MTP array's element content.

Array(RArray< TUint64 > &)

IMPORT_C voidArray(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 > & aElementsOn completion, a copy of the MTP array's element content.

BufferSize(TUint32)

TUint64 BufferSize(TUint32aNumElements)const [private]

Parameters

TUint32 aNumElements

CommitChunkL(TPtr8 &)

IMPORT_C MMTPType *CommitChunkL(TPtr8 &aChunk)

Parameters

TPtr8 & aChunk

CommitRequired()

IMPORT_C TBoolCommitRequired()const

ConstructL(TUint32)

voidConstructL(TUint32aNumElements)[private]

Parameters

TUint32 aNumElements

ConstructL(const RPointerArray< MMTPType > &)

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

Parameters

const RPointerArray< MMTPType > & aElements

Element(TUint, TAny *)

voidElement(TUintaIndex,
TAny *aElement
)const [private]

Parameters

TUint aIndex
TAny * aElement

ElementInt(TUint)

IMPORT_C TIntElementInt(TUintaIndex)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 aIndexThe index in the MTP array of the required element.

ElementInt64(TUint)

IMPORT_C TInt64ElementInt64(TUintaIndex)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 aIndexThe index in the MTP array of the required element.

ElementL(TUint, MMTPType &)

IMPORT_C voidElementL(TUintaIndex,
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 aIndexThe index in the MTP array of the required element.
MMTPType & aElementOn completion, a copy of the required element.

ElementType()

IMPORT_C TIntElementType()const

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

ElementUint(TUint)

IMPORT_C TUintElementUint(TUintaIndex)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 aIndexThe index in the MTP array of the required element.

ElementUint64(TUint)

IMPORT_C TUint64ElementUint64(TUintaIndex)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 aIndexThe index in the MTP array of the required element.

FirstReadChunk(TPtrC8 &)

IMPORT_C TIntFirstReadChunk(TPtrC8 &aChunk)const

Parameters

TPtrC8 & aChunk

FirstWriteChunk(TPtr8 &)

IMPORT_C TIntFirstWriteChunk(TPtr8 &aChunk)

Parameters

TPtr8 & aChunk

NewL(TInt, TUint)

IMPORT_C CMTPTypeArray *NewL(TIntaElementType,
TUintaElementSize
)[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 aElementTypeThe MTP type identifier of the elements contained in the array.
TUint aElementSizeThe size (in bytes) of the elements contained in the array.

NewL(TInt, TInt, TUint)

IMPORT_C CMTPTypeArray *NewL(TIntaArrayType,
TIntaElementType,
TUintaElementSize
)[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 aArrayTypeThe MTP type identifier to be assigned to the array.
TInt aElementTypeThe MTP type identifier of the elements contained in the array.
TUint aElementSizeThe size (in bytes) of the elements contained in the array.

NewL(TInt)

IMPORT_C CMTPTypeArray *NewL(TIntaArrayType)[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 aArrayTypeThe array data type indentifier datacode. This must be in the range EMTPTypeFirstSimpleArrayType ... EMTPTypeLastSimpleArrayType.

NewL(TInt, const RArray< TInt > &)

IMPORT_C CMTPTypeArray *NewL(TIntaArrayType,
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 aArrayTypeThe array data type indentifier datacode. This must be in the range EMTPTypeFirstSimpleArrayType ... EMTPTypeLastSimpleArrayType.
const RArray< TInt > & aElementsThe initial set of element values.

NewL(TInt, const RArray< TUint > &)

IMPORT_C CMTPTypeArray *NewL(TIntaArrayType,
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 aArrayTypeThe array data type indentifier datacode. This must be in the range EMTPTypeFirstSimpleArrayType ... EMTPTypeLastSimpleArrayType.
const RArray< TUint > & aElementsThe 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 > & aElementsThe 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 > & aElementsThe initial set of element values.

NewLC(TInt, TUint)

IMPORT_C CMTPTypeArray *NewLC(TIntaElementType,
TUintaElementSize
)[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 aElementTypeThe MTP type identifier of the elements contained in the array.
TUint aElementSizeThe size (in bytes) of the elements which contained in array.

NewLC(TInt, TInt, TUint)

IMPORT_C CMTPTypeArray *NewLC(TIntaArrayType,
TIntaElementType,
TUintaElementSize
)[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 aArrayTypeThe MTP type identifier to be assigned to the array.
TInt aElementTypeThe MTP type identifier of the elements contained in the array.
TUint aElementSizeThe size (in bytes) of the elements which contained in array.

NewLC(TInt)

IMPORT_C CMTPTypeArray *NewLC(TIntaArrayType)[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 aArrayTypeThe array data type indentifier datacode. This must be in the range EMTPTypeFirstSimpleArrayType ... EMTPTypeLastSimpleArrayType.

NewLC(TInt, const RArray< TInt > &)

IMPORT_C CMTPTypeArray *NewLC(TIntaArrayType,
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 aArrayTypeThe array data type indentifier datacode. This must be in the range EMTPTypeFirstSimpleArrayType ... EMTPTypeLastSimpleArrayType.
const RArray< TInt > & aElementsThe initial set of element values.

NewLC(TInt, const RArray< TUint > &)

IMPORT_C CMTPTypeArray *NewLC(TIntaArrayType,
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 aArrayTypeThe array data type indentifier datacode. This must be in the range EMTPTypeFirstSimpleArrayType ... EMTPTypeLastSimpleArrayType.
const RArray< TUint > & aElementsThe 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 > & aElementsThe 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 > & aElementsThe initial set of element values.

NextReadChunk(TPtrC8 &)

IMPORT_C TIntNextReadChunk(TPtrC8 &aChunk)const

Parameters

TPtrC8 & aChunk

NextWriteChunk(TPtr8 &)

IMPORT_C TIntNextWriteChunk(TPtr8 &aChunk)

Parameters

TPtr8 & aChunk

NumElements()

IMPORT_C TUint32NumElements()const

Provides the number of elements contained in the MTP array.

Offset(TUint)

TUint Offset(TUintaIndex)const [private]

Parameters

TUint aIndex

ReAllocBufferL(TUint32)

voidReAllocBufferL(TUint32aNumElements)[private]

Parameters

TUint32 aNumElements

SetByDesL(const TDesC8 &)

IMPORT_C voidSetByDesL(const TDesC8 &aDesc)

Parameters

const TDesC8 & aDesc

SetInvalidL()

voidSetInvalidL()[private]

SetNumElements(TUint32)

voidSetNumElements(TUint32aNumElements)[private]

Parameters

TUint32 aNumElements

SimpleArrayTypeMetaDataL(TInt, TInt &, TUint &)

voidSimpleArrayTypeMetaDataL(TIntaArrayType,
TInt &aElementType,
TUint &aElementSize
)[private, static]

Parameters

TInt aArrayType
TInt & aElementType
TUint & aElementSize

Size()

IMPORT_C TUint64Size()const

ToDes(TDes8 &)

IMPORT_C voidToDes(TDes8 &aRetDes)const

Parameters

TDes8 & aRetDes

Type()

IMPORT_C TUintType()const [virtual]

Validate()

IMPORT_C TIntValidate()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.