CMMFTransferBuffer Class Reference

#include <mmf/server/mmfdatabuffer.h>

Link against: mmfserverbaseclasses.lib

class CMMFTransferBuffer : public CMMFDataBuffer

Inherits from

Constructor & Destructor Documentation

~CMMFTransferBuffer ( )

IMPORT_C~CMMFTransferBuffer()

CMMFTransferBuffer destructor

Destructor maps out RTransferBuffer and closes RTransferWindow.

Member Function Documentation

BufferSize ( )

TUint BufferSize()const [virtual]

Returns the actual data size (ie. not the max length) of the data contained in the CMMFTransferBuffer.

Returns: The size in bytes of the data contained in the CMMFTransferBuffer.

Data ( )

TDes8 &Data()[virtual]

Reimplemented from CMMFDataBuffer::Data()

Returns a descriptor to the data contained in the CMMFTransferBuffer.

Returns: A reference to a TPtr containing the CMMFTransferBuffer data.

Data ( )

const TDesC8 &Data()const [virtual]

Reimplemented from CMMFDataBuffer::Data()const

Returns a descriptor to the data contained in the CMMFTransferBuffer.

Returns: A const reference to a TPtr containing the CMMFTransferBuffer data.

MapOutBuffer ( )

IMPORT_C voidMapOutBuffer()

Maps the buffer out of the transfer window.

This method should be called in preference to calling MapOutBuffer directly on the RtransferWindow so that the CMMFTransferBuffer knows that it is no longer available.

NewL ( RTransferWindow &, TUint )

IMPORT_C CMMFTransferBuffer *NewL(RTransferWindow &aTransferWindow,
TUintaDataLength = 0
)[static]

This function is not supported under EKA2.

Method to instantiate a CMMFTransferBuffer. This NewL creates a CMMFTransferBuffer.

ParameterDescription
aTransferWindowThis is a valid RTransferWindow that has an RTransferBuffer mapped in.
aDataLengthThis parameter sets the length of the actual data present in the transferbuffer. This is because the length of actual data may be less than the length of the mapped in transfer buffer.

Returns: A pointer to a new CMMFTransferBuffer.

SetPosition ( TUint )

voidSetPosition(TUintaPosition)[virtual]

Sets the position.

This method is used by components (eg codecs) which read data from a buffer and wish to store a read position marker for further reads.

Note: The position cannot exceed the size of the actual data not the max length.

ParameterDescription
aPositionThe position.

SetRequestSizeL ( TInt )

voidSetRequestSizeL(TIntaSize)[virtual]

Sets the request size.

This function is used in cases where a component (eg. a data source) may not be able or be desirable to write to the entire max length of the buffer (eg. variable bit rate codecs). In this case, the SetRequestSizeL can be set which can be read by the RequestSize() function in the component so that it knows to only write data upto the request size and not fill the buffer up to its max length.

ParameterDescription
aSizeThe request size.

TransferWindow ( )

IMPORT_C RTransferWindow &TransferWindow()

This function is not supported under EKA2.

Returns a reference to the transfer window currently used by the CMMFtransferBuffer.

Returns: A reference to the current RTransferWindow.

UpdateTransferWindow ( RTransferWindow &, TUint )

IMPORT_C TIntUpdateTransferWindow(RTransferWindow &aTransferWindow,
TUintaDataLength = 0
)

This method is not supported under EKA2.

Modifies the CMMFTransferBuffer by updating the RTransferWindow.

This method is used if the same CMMFTransferBuffer is used throughout eg. if a single CMMFTransferBuffer is created upfront but a different transfer window (or the same transfer window with a different buffer mapped in is used). That is the same CMMFTransferBuffer but the actrual buffer may be different.

Note: If the updated RTransferWindow is new, then the old buffer must be mapped out first by a call to CMMFTransferBuffer::MapOutBuffer() and the RtransferWindow handle closed outside the CMMFTransferBuffer.

ParameterDescription
aTransferWindowThe RTransferWindow to update - can be a new RTransferWindow or the same RTransferWindow with a new RTransferBuffer mapped in.
aDataLengthThe length of the data.

Returns: An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.