CMTPTypeCompoundBase Class Reference

class CMTPTypeCompoundBase : public CBase

Defines the MTP compound data types base class. Compound data types are used to represent MTP datasets comprising mixed sequences of simple, flat, and complex data type elements. These elements may be either of fixed or variable length. This class implements generic compound data type storage management capabilities and is intended for derivation by concrete classes which implement specific MTP datasets. Note that this class does NOT assume ownership of any of the data elements passed to it.

Inherits from

  • CMTPTypeCompoundBase
Public Member Functions
~CMTPTypeCompoundBase()
IMPORT_C MMTPType *CommitChunkL(TPtr8 &)
IMPORT_C TBoolCommitRequired()
IMPORT_C TIntFirstReadChunk(TPtrC8 &)
IMPORT_C TIntFirstWriteChunk(TPtr8 &)
IMPORT_C voidGetL(TInt, MMTPType &)
IMPORT_C TInt16Int16L(TInt)
IMPORT_C TInt32Int32L(TInt)
IMPORT_C TInt64Int64L(TInt)
IMPORT_C TInt8Int8L(TInt)
IMPORT_C TIntNextReadChunk(TPtrC8 &)
IMPORT_C TIntNextWriteChunk(TPtr8 &)
IMPORT_C TIntNextWriteChunk(TPtr8 &, TUint)
IMPORT_C voidSetInt16L(TInt, TInt16)
IMPORT_C voidSetInt32L(TInt, TInt32)
IMPORT_C voidSetInt64L(TInt, TInt64)
IMPORT_C voidSetInt8L(TInt, TInt8)
IMPORT_C voidSetL(TInt, const MMTPType &)
IMPORT_C voidSetStringL(TInt, const TDesC &)
IMPORT_C voidSetUint16L(TInt, TUint16)
IMPORT_C voidSetUint32L(TInt, TUint32)
IMPORT_C voidSetUint64L(TInt, TUint64)
IMPORT_C voidSetUint8L(TInt, TUint8)
IMPORT_C TUint64Size()
IMPORT_C const TDesC &StringCharsL(TInt)
IMPORT_C TUint8StringNumCharsL(TInt)
IMPORT_C TUintType()
IMPORT_C TUint16Uint16L(TInt)
IMPORT_C TUint32Uint32L(TInt)
IMPORT_C TUint64Uint64L(TInt)
IMPORT_C TUint8Uint8L(TInt)
IMPORT_C TIntValidate()
Protected Member Functions
CMTPTypeCompoundBase(TBool, TUint)
IMPORT_C voidChunkAppendL(const MMTPType &)
IMPORT_C TUintChunkCount()
IMPORT_C voidChunkRemove(TUint)
const TElementInfo &ElementInfo(TInt)
IMPORT_C TBoolReadableElementL(TInt)
IMPORT_C voidReset()
IMPORT_C voidSetExpectedChunkCount(TUint)
IMPORT_C TIntValidateChunkCount()
IMPORT_C TBoolWriteableElementL(TInt)
Private Member Functions
TInt UpdateReadState(TInt)
TInt UpdateWriteState(TInt)
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()
Protected Member Enumerations
enumTReadWriteSequenceState { EIdle, EInProgressFirst, EInProgressNext }
Public Attributes
const TIntKMTPNotApplicable
Protected Attributes
const TBoolKJustInTimeConstruction
const TUintKVariableChunkCount
RPointerArray< MMTPType >iChunks
TUint iWriteChunk
TUint iWriteSequenceState
Private Attributes
TUint iExpectedChunkCount
TBool iJustInTimeConstruction
TUint iReadChunk
TUint iReadSequenceState
TInt iWriteErr

Constructor & Destructor Documentation

CMTPTypeCompoundBase(TBool, TUint)

IMPORT_CCMTPTypeCompoundBase(TBoolaJustInTimeConstruction,
TUintaExpectedChunkCount
)[protected]

Parameters

TBool aJustInTimeConstructionThis flag indicates that the derived class uses a just-in-time construction technique when constructing iteself from a write data stream. Typically this is used for types whose final structure is dependant upon data contained within the data stream itself, e.g. a dataset with an element whose data type is determined by meta data which precedes the element in the data stream.
TUint aExpectedChunkCountThis flag is used by the derived class to indicate the number of chunks which make up the compound type. A value of KVariableChunkCount indicates that the type is of variable rather than fixed length (e.g. a list of elements). If KVariableChunkCount is specified then the derived class's ValidChunkCount method is invoked when the compound type is validated (

~CMTPTypeCompoundBase()

IMPORT_C~CMTPTypeCompoundBase()[virtual]

Destructor

Member Functions Documentation

ChunkAppendL(const MMTPType &)

IMPORT_C voidChunkAppendL(const MMTPType &aElement)[protected]

Appends the specified data chunk to the compound type's sequence of chunks.

Parameters

const MMTPType & aElementThe chunk to be appended.

ChunkCount()

IMPORT_C TUintChunkCount()const [protected]

Provides the number of discrete data chunks of which the compound type is composed.

ChunkRemove(TUint)

IMPORT_C voidChunkRemove(TUintaChunkId)[protected]

Removes the chunk at the specified position in the chunk sequence.

Parameters

TUint aChunkIdThe index of the chunk in in the chunk sequence.

CommitChunkL(TPtr8 &)

IMPORT_C MMTPType *CommitChunkL(TPtr8 &aChunk)[virtual]

Parameters

TPtr8 & aChunk

CommitRequired()

IMPORT_C TBoolCommitRequired()const [virtual]

ElementInfo(TInt)

const TElementInfo &ElementInfo(TIntaElementId)const [protected, pure virtual]

Provides the TElementInfo data for the specified element.

Parameters

TInt aElementIdThe identifier of the requested element.

FirstReadChunk(TPtrC8 &)

IMPORT_C TIntFirstReadChunk(TPtrC8 &aChunk)const [virtual]

Parameters

TPtrC8 & aChunk

FirstWriteChunk(TPtr8 &)

IMPORT_C TIntFirstWriteChunk(TPtr8 &aChunk)[virtual]

Parameters

TPtr8 & aChunk

GetL(TInt, MMTPType &)

IMPORT_C voidGetL(TIntaElementId,
MMTPType &aElement
)const [virtual]
Provides a copy of the specified element.
leave
KErrNotSupported, if the element is not readable.
leave
One of the system wide error code, if a processing error occurs.
panic
MTPDataTypes 3, if the target buffer type does not match the requested element.

Parameters

TInt aElementIdThe identifier of the requested element.
MMTPType & aElementThe MMTPType target data buffer.

Int16L(TInt)

IMPORT_C TInt16Int16L(TIntaElementId)const [virtual]
Provides the value of the specified element.
leave
KErrNotSupported, if the element is not readable.
leave
One of the system wide error code, if a processing error occurs.
panic
MTPDataTypes 3, if the source buffer type does not match the requested element.

Parameters

TInt aElementIdThe identifier of the requested element.

Int32L(TInt)

IMPORT_C TInt32Int32L(TIntaElementId)const [virtual]
Provides the value of the specified element.
leave
KErrNotSupported, if the element is not readable.
leave
One of the system wide error code, if a processing error occurs.
panic
MTPDataTypes 3, if the source buffer type does not match the requested element.

Parameters

TInt aElementIdThe identifier of the requested element.

Int64L(TInt)

IMPORT_C TInt64Int64L(TIntaElementId)const [virtual]
Provides the value of the specified element.
leave
KErrNotSupported, if the element is not readable.
leave
One of the system wide error code, if a processing error occurs.
panic
MTPDataTypes 3, if the source buffer type does not match the requested element.

Parameters

TInt aElementIdThe identifier of the requested element.

Int8L(TInt)

IMPORT_C TInt8Int8L(TIntaElementId)const [virtual]
Provides the value of the specified element.
leave
KErrNotSupported, if the element is not readable.
leave
One of the system wide error code, if a processing error occurs.
panic
MTPDataTypes 3, if the source buffer type does not match the requested element.

Parameters

TInt aElementIdThe identifier of the requested element.

NextReadChunk(TPtrC8 &)

IMPORT_C TIntNextReadChunk(TPtrC8 &aChunk)const [virtual]

Parameters

TPtrC8 & aChunk

NextWriteChunk(TPtr8 &)

IMPORT_C TIntNextWriteChunk(TPtr8 &aChunk)[virtual]

Parameters

TPtr8 & aChunk

NextWriteChunk(TPtr8 &, TUint)

IMPORT_C TIntNextWriteChunk(TPtr8 &aChunk,
TUintaDataLength
)[virtual]

Parameters

TPtr8 & aChunk
TUint aDataLength

ReadableElementL(TInt)

IMPORT_C TBoolReadableElementL(TIntaElementId)const [protected, virtual]

Indicates if the specified element can be read from.

Parameters

TInt aElementIdThe identifier of the requested element.

Reset()

IMPORT_C voidReset()[protected]

Resets the compound base, removing all data chunk references.

SetExpectedChunkCount(TUint)

IMPORT_C voidSetExpectedChunkCount(TUintaExpectedChunkCount)[protected]

Sets the expected chunk count. This flag is used by the derived class to indicate the number of chunks which make up the compound type. A value of KVariableChunkCount indicates that the type is of variable rather than fixed length (e.g. a list of elements). If KVariableChunkCount is specified then the derived class's ValidChunkCount method is invoked when the compound type is validated (ValidateChunkCount).

Parameters

TUint aExpectedChunkCountThe new expected chunk count.

SetInt16L(TInt, TInt16)

IMPORT_C voidSetInt16L(TIntaElementId,
TInt16aData
)[virtual]
Updates the specified element.
leave
KErrNotSupported, if the element is not writeable.
leave
One of the system wide error code, if a processing error occurs.
panic
MTPDataTypes 3, if the source data type does not match the requested element.

Parameters

TInt aElementIdThe identifier of the element to update.
TInt16 aDataThe source data.

SetInt32L(TInt, TInt32)

IMPORT_C voidSetInt32L(TIntaElementId,
TInt32aData
)[virtual]
Updates the specified element.
leave
KErrNotSupported, if the element is not writeable.
leave
One of the system wide error code, if a processing error occurs.
panic
MTPDataTypes 3, if the source data type does not match the requested element.

Parameters

TInt aElementIdThe identifier of the element to update.
TInt32 aDataThe source data.

SetInt64L(TInt, TInt64)

IMPORT_C voidSetInt64L(TIntaElementId,
TInt64aData
)[virtual]
Updates the specified element.
leave
KErrNotSupported, if the element is not writeable.
leave
One of the system wide error code, if a processing error occurs.
panic
MTPDataTypes 3, if the source data type does not match the requested element.

Parameters

TInt aElementIdThe identifier of the element to update.
TInt64 aDataThe source data.

SetInt8L(TInt, TInt8)

IMPORT_C voidSetInt8L(TIntaElementId,
TInt8aData
)[virtual]
Updates the specified element.
leave
KErrNotSupported, if the element is not writeable.
leave
One of the system wide error code, if a processing error occurs.
panic
MTPDataTypes 3, if the source data type does not match the requested element.

Parameters

TInt aElementIdThe identifier of the element to update.
TInt8 aDataThe source data.

SetL(TInt, const MMTPType &)

IMPORT_C voidSetL(TIntaElementId,
const MMTPType &aElement
)[virtual]
Updates the specified element.
leave
KErrNotSupported, if the element is not writeable.
leave
One of the system wide error code, if a processing error occurs.
panic
MTPDataTypes 3, if the source buffer type does not match the requested element.

Parameters

TInt aElementIdThe identifier of the element to update.
const MMTPType & aElementThe MMTPType source data buffer.

SetStringL(TInt, const TDesC &)

IMPORT_C voidSetStringL(TIntaElementId,
const TDesC &aString
)[virtual]
Updates the specified element.
leave
KErrNotSupported, if the element is not writeable.
leave
One of the system wide error code, if a processing error occurs.
panic
MTPDataTypes 3, if the source data type does not match the requested element.

Parameters

TInt aElementIdThe identifier of the element to update.
const TDesC & aStringThe source data.

SetUint16L(TInt, TUint16)

IMPORT_C voidSetUint16L(TIntaElementId,
TUint16aData
)[virtual]
Updates the specified element.
leave
KErrNotSupported, if the element is not writeable.
leave
One of the system wide error code, if a processing error occurs.
panic
MTPDataTypes 3, if the source data type does not match the requested element.

Parameters

TInt aElementIdThe identifier of the element to update.
TUint16 aDataThe source data.

SetUint32L(TInt, TUint32)

IMPORT_C voidSetUint32L(TIntaElementId,
TUint32aData
)[virtual]
Updates the specified element.
leave
KErrNotSupported, if the element is not writeable.
leave
One of the system wide error code, if a processing error occurs.
panic
MTPDataTypes 3, if the source data type does not match the requested element.

Parameters

TInt aElementIdThe identifier of the element to update.
TUint32 aDataThe source data.

SetUint64L(TInt, TUint64)

IMPORT_C voidSetUint64L(TIntaElementId,
TUint64aData
)[virtual]
Updates the specified element.
leave
KErrNotSupported, if the element is not writeable.
leave
One of the system wide error code, if a processing error occurs.
panic
MTPDataTypes 3, if the source data type does not match the requested element.

Parameters

TInt aElementIdThe identifier of the element to update.
TUint64 aDataThe source data.

SetUint8L(TInt, TUint8)

IMPORT_C voidSetUint8L(TIntaElementId,
TUint8aData
)[virtual]
Updates the specified element.
leave
KErrNotSupported, if the element is not writeable.
leave
One of the system wide error code, if a processing error occurs.
panic
MTPDataTypes 3, if the source data type does not match the requested element.

Parameters

TInt aElementIdThe identifier of the element to update.
TUint8 aDataThe source data.

Size()

IMPORT_C TUint64Size()const [virtual]

StringCharsL(TInt)

IMPORT_C const TDesC &StringCharsL(TIntaElementId)const [virtual]
Provides the value of the specified element.
leave
KErrNotSupported, if the element is not readable.
leave
One of the system wide error code, if a processing error occurs.
panic
MTPDataTypes 3, if the source buffer type does not match the requested element.

Parameters

TInt aElementIdThe identifier of the requested element.

StringNumCharsL(TInt)

IMPORT_C TUint8StringNumCharsL(TIntaElementId)const [virtual]
Provides the value of the specified element.
leave
KErrNotSupported, if the element is not readable.
leave
One of the system wide error code, if a processing error occurs.
panic
MTPDataTypes 3, if the source buffer type does not match the requested element.

Parameters

TInt aElementIdThe identifier of the requested element.

Type()

IMPORT_C TUintType()const [virtual]

Uint16L(TInt)

IMPORT_C TUint16Uint16L(TIntaElementId)const [virtual]
Provides the value of the specified element.
leave
KErrNotSupported, if the element is not readable.
leave
One of the system wide error code, if a processing error occurs.
panic
MTPDataTypes 3, if the source buffer type does not match the requested element.

Parameters

TInt aElementIdThe identifier of the requested element.

Uint32L(TInt)

IMPORT_C TUint32Uint32L(TIntaElementId)const [virtual]
Provides the value of the specified element.
leave
KErrNotSupported, if the element is not readable.
leave
One of the system wide error code, if a processing error occurs.
panic
MTPDataTypes 3, if the source buffer type does not match the requested element.

Parameters

TInt aElementIdThe identifier of the requested element.

Uint64L(TInt)

IMPORT_C TUint64Uint64L(TIntaElementId)const [virtual]
Provides the value of the specified element.
leave
KErrNotSupported, if the element is not readable.
leave
One of the system wide error code, if a processing error occurs.
panic
MTPDataTypes 3, if the source buffer type does not match the requested element.

Parameters

TInt aElementIdThe identifier of the requested element.

Uint8L(TInt)

IMPORT_C TUint8Uint8L(TIntaElementId)const [virtual]
Provides the value of the specified element.
leave
KErrNotSupported, if the element is not readable.
leave
One of the system wide error code, if a processing error occurs.
panic
MTPDataTypes 3, if the source buffer type does not match the requested element.

Parameters

TInt aElementIdThe identifier of the requested element.

UpdateReadState(TInt)

TInt UpdateReadState(TIntaErr)const [private]

Parameters

TInt aErr

UpdateWriteState(TInt)

TInt UpdateWriteState(TIntaErr)[private]

Parameters

TInt aErr

Validate()

IMPORT_C TIntValidate()const [virtual]

ValidateChunkCount()

IMPORT_C TIntValidateChunkCount()const [protected, virtual]

Validates that the number of chunks making up the compound type is valid. This method is invoked on variable length compound types by the default Valid implementation. Valid KVariableChunkCount

WriteableElementL(TInt)

IMPORT_C TBoolWriteableElementL(TIntaElementId)const [protected, virtual]

Indicates if the specified element can be written to.

Parameters

TInt aElementIdThe identifier of the requested element.

Member Enumerations Documentation

Enum TReadWriteSequenceState

The read and write data stream states.

Enumerators

EIdle

Data stream is inactive.

EInProgressFirst

Streaming the first data chunk.

EInProgressNext

Streaming a subsequent data chunk.

Member Data Documentation

const TBool KJustInTimeConstruction

const TBoolKJustInTimeConstruction[protected, static]

This flag is used by derived classes to signal the use of just-in-time techniques during construction from a write data stream. CMTPTypeCompoundBase

const TInt KMTPNotApplicable

const TIntKMTPNotApplicable[static]

Initialisation value for TElementInfo data values that are non applicable for an element, e.g. when specifying iFlatChunkInfo values for non-flat elements such as arrays and strings.

const TUint KVariableChunkCount

const TUintKVariableChunkCount[protected, static]

This flag is used by the derived class to indicate that the number of chunks making up the compound type is variable rather than fixed (e.g. a list of elements.)

RPointerArray< MMTPType > iChunks

RPointerArray< MMTPType >iChunks[protected]

Ordered data type element chunk table.

TUint iExpectedChunkCount

TUint iExpectedChunkCount[private]

This flag indicates the number of chunks which make up the compound type. A value of KVariableChunkCount indicates that the type is of variable rather than fixed length (e.g. a list of elements). If KVariableChunkCount is specified then the derived class's ValidChunkCount method is invoked by the default Valid implementation.

TBool iJustInTimeConstruction

TBool iJustInTimeConstruction[private]

This flag indicates that the compound data type uses just-in-time techniques when constructing iteself from a write data stream. Typically this is used for types whose final structure is dependant upon data contained within the data stream itself, e.g. a dataset with an element whose data type is determined by meta data which precedes the element in the data stream.

TUint iReadChunk

TUint iReadChunk[private]

The read data stream data chunk table index. Note that this is declared mutable to allow state updates while processing a read data stream.

TUint iReadSequenceState

TUint iReadSequenceState[private]

The read data stream state variable. Note that this is declared mutable to allow state updates while processing a read data stream.

TUint iWriteChunk

TUint iWriteChunk[protected]

The write data stream data chunk table index.

TInt iWriteErr

TInt iWriteErr[private]

The write data stream error state.

TUint iWriteSequenceState

TUint iWriteSequenceState[protected]

The write data stream state variable.