TStreamExchange Class Reference

class TStreamExchange

Manages access to a shared host buffer for shared stream buffers.

The class maintains independent markers for the shared stream buffer that has most recently read or written to the shared host buffer.

This is the way in which multiple requests from the same shared stream buffer are handled without the need for repeated seeking. The shared host buffer only needs to seek when a new shared buffer needs to use it

RShareBuf

Public Member Functions
TStreamExchange()
TStreamExchange(MStreamBuf *)
IMPORT_C MStreamBuf *Host()
IMPORT_C MStreamBuf *HostL()
TBool IsActive()
IMPORT_C voidRelease()
voidShare(MStreamBuf *)
IMPORT_C TIntSizeL()
Private Member Functions
TStreamExchange(const TStreamExchange &)
MStreamBuf &Buf()
MStreamBuf &BufL()
IMPORT_C TIntDoReadL(TAny *, TInt, TStreamMark &)
IMPORT_C TIntDoReadL(TDes8 &, TInt, TRequestStatus &, TStreamMark &)
IMPORT_C TStreamTransferDoReadL(MStreamInput &, TStreamTransfer, TStreamMark &)
IMPORT_C TStreamPosDoSeekL(TStreamMark &, TStreamLocation, TInt)
IMPORT_C voidDoWriteL(const TAny *, TInt, TStreamMark &)
IMPORT_C TIntDoWriteL(const TDesC8 &, TInt, TRequestStatus &, TStreamMark &)
IMPORT_C TStreamTransferDoWriteL(MStreamOutput &, TStreamTransfer, TStreamMark &)
IMPORT_C voidDrop(const TStreamMark &)
IMPORT_C voidGetL(TStreamMark &)
TStreamPos MarkSeekL(TStreamMark &, TStreamLocation, TInt)
TInt PrepareAndReadL(TAny *, TInt, TStreamMark &)
TInt PrepareAndReadL(TDes8 &, TInt, TRequestStatus &, TStreamMark &)
TStreamTransfer PrepareAndReadL(MStreamInput &, TStreamTransfer, TStreamMark &)
voidPrepareAndWriteL(const TAny *, TInt, TStreamMark &)
TInt PrepareAndWriteL(const TDesC8 &, TInt, TRequestStatus &, TStreamMark &)
TStreamTransfer PrepareAndWriteL(MStreamOutput &, TStreamTransfer, TStreamMark &)
voidPrepareForReadingL(TStreamMark &)
voidPrepareForWritingL(TStreamMark &)
IMPORT_C TBoolRefersTo(const TStreamMark &)
TStreamExchange &operator=(const TStreamExchange &)
Private Member Type Definitions
typedef MStreamBuf::TMark TMark
Private Attributes
MStreamBuf *iHost
TStreamMark *iRMrk
TStreamMark *iWMrk

Constructor & Destructor Documentation

TStreamExchange()

TStreamExchange()[inline]

Constructs an empty object.

Call Share() to prepare for access to a shared stream buffer.

TStreamExchange(MStreamBuf *)

TStreamExchange(MStreamBuf *aHost)[inline]

Constructs the object, specifying the stream buffer that will act as the shared host.

Parameters

MStreamBuf * aHostA pointer to a stream buffer that will act as the shared host.

TStreamExchange(const TStreamExchange &)

TStreamExchange(const TStreamExchange &)[private]

Constructs an empty object.

Call Share() to prepare for access to a shared stream buffer.

Parameters

const TStreamExchange &

Member Functions Documentation

Buf()

MStreamBuf &Buf()const [private, inline]

BufL()

MStreamBuf &BufL()const [private, inline]

DoReadL(TAny *, TInt, TStreamMark &)

IMPORT_C TIntDoReadL(TAny *aPtr,
TIntaMaxLength,
TStreamMark &aMark
)[private]

Parameters

TAny * aPtr
TInt aMaxLength
TStreamMark & aMark

DoReadL(TDes8 &, TInt, TRequestStatus &, TStreamMark &)

IMPORT_C TIntDoReadL(TDes8 &aDes,
TIntaMaxLength,
TRequestStatus &aStatus,
TStreamMark &aMark
)[private]

Parameters

TDes8 & aDes
TInt aMaxLength
TRequestStatus & aStatus
TStreamMark & aMark

DoReadL(MStreamInput &, TStreamTransfer, TStreamMark &)

IMPORT_C TStreamTransferDoReadL(MStreamInput &anInput,
TStreamTransferaTransfer,
TStreamMark &aMark
)[private]

Parameters

MStreamInput & anInput
TStreamTransfer aTransfer
TStreamMark & aMark

DoSeekL(TStreamMark &, TStreamLocation, TInt)

IMPORT_C TStreamPosDoSeekL(TStreamMark &aMark,
TStreamLocationaLocation,
TIntanOffset
)[private]

Parameters

TStreamMark & aMark
TStreamLocation aLocation
TInt anOffset

DoWriteL(const TAny *, TInt, TStreamMark &)

IMPORT_C voidDoWriteL(const TAny *aPtr,
TIntaLength,
TStreamMark &aMark
)[private]

Parameters

const TAny * aPtr
TInt aLength
TStreamMark & aMark

DoWriteL(const TDesC8 &, TInt, TRequestStatus &, TStreamMark &)

IMPORT_C TIntDoWriteL(const TDesC8 &aDes,
TIntaMaxLength,
TRequestStatus &aStatus,
TStreamMark &aMark
)[private]

Parameters

const TDesC8 & aDes
TInt aMaxLength
TRequestStatus & aStatus
TStreamMark & aMark

DoWriteL(MStreamOutput &, TStreamTransfer, TStreamMark &)

IMPORT_C TStreamTransferDoWriteL(MStreamOutput &anOutput,
TStreamTransferaTransfer,
TStreamMark &aMark
)[private]

Parameters

MStreamOutput & anOutput
TStreamTransfer aTransfer
TStreamMark & aMark

Drop(const TStreamMark &)

IMPORT_C voidDrop(const TStreamMark &aMark)[private]

Parameters

const TStreamMark & aMark

GetL(TStreamMark &)

IMPORT_C voidGetL(TStreamMark &aMark)[private]

Parameters

TStreamMark & aMark

Host()

IMPORT_C MStreamBuf *Host()

Gets a pointer to the stream buffer that acts as the shared host.

The function refreshes the active read/write marks and gives the caller exclusive use of the shared host.

HostL()

IMPORT_C MStreamBuf *HostL()

Gets a pointer to the stream buffer that acts as the shared host, and leaves if this object is not active.

The function refreshes the active read/write marks and gives the caller exclusive use of the shared host.

IsActive()

IsActive()

TBool IsActive()const [inline]

Tests whether this object is using a stream buffer that is acting as shared host.

MarkSeekL(TStreamMark &, TStreamLocation, TInt)

TStreamPos MarkSeekL(TStreamMark &aMark,
TStreamLocationaLocation,
TIntanOffset
)[private]

Parameters

TStreamMark & aMark
TStreamLocation aLocation
TInt anOffset

PrepareAndReadL(TAny *, TInt, TStreamMark &)

TInt PrepareAndReadL(TAny *aPtr,
TIntaMaxLength,
TStreamMark &aMark
)[private]

Parameters

TAny * aPtr
TInt aMaxLength
TStreamMark & aMark

PrepareAndReadL(TDes8 &, TInt, TRequestStatus &, TStreamMark &)

TInt PrepareAndReadL(TDes8 &aDes,
TIntaMaxLength,
TRequestStatus &aStatus,
TStreamMark &aMark
)[private]

Parameters

TDes8 & aDes
TInt aMaxLength
TRequestStatus & aStatus
TStreamMark & aMark

PrepareAndReadL(MStreamInput &, TStreamTransfer, TStreamMark &)

TStreamTransfer PrepareAndReadL(MStreamInput &anInput,
TStreamTransferaTransfer,
TStreamMark &aMark
)[private]

Parameters

MStreamInput & anInput
TStreamTransfer aTransfer
TStreamMark & aMark

PrepareAndWriteL(const TAny *, TInt, TStreamMark &)

voidPrepareAndWriteL(const TAny *aPtr,
TIntaLength,
TStreamMark &aMark
)[private]

Parameters

const TAny * aPtr
TInt aLength
TStreamMark & aMark

PrepareAndWriteL(const TDesC8 &, TInt, TRequestStatus &, TStreamMark &)

TInt PrepareAndWriteL(const TDesC8 &aDes,
TIntaMaxLength,
TRequestStatus &aStatus,
TStreamMark &aMark
)[private]

Parameters

const TDesC8 & aDes
TInt aMaxLength
TRequestStatus & aStatus
TStreamMark & aMark

PrepareAndWriteL(MStreamOutput &, TStreamTransfer, TStreamMark &)

TStreamTransfer PrepareAndWriteL(MStreamOutput &anOutput,
TStreamTransferaTransfer,
TStreamMark &aMark
)[private]

Parameters

MStreamOutput & anOutput
TStreamTransfer aTransfer
TStreamMark & aMark

PrepareForReadingL(TStreamMark &)

voidPrepareForReadingL(TStreamMark &aMark)[private]

Parameters

TStreamMark & aMark

PrepareForWritingL(TStreamMark &)

voidPrepareForWritingL(TStreamMark &aMark)[private]

Parameters

TStreamMark & aMark

RefersTo(const TStreamMark &)

IMPORT_C TBoolRefersTo(const TStreamMark &aMark)[private]

Parameters

const TStreamMark & aMark

Release()

IMPORT_C voidRelease()

Releases the reference to the shared host, and drops any active read or write marks.

Share(MStreamBuf *)

voidShare(MStreamBuf *aHost)[inline]

Tells the object to use the specified stream buffer that will act as the shared host.

Parameters

MStreamBuf * aHostA pointer to a stream buffer that will act as the shared host.

SizeL()

IMPORT_C TIntSizeL()const

Gets the size of the shared host buffer.

operator=(const TStreamExchange &)

TStreamExchange &operator=(const TStreamExchange &)[private]

Parameters

const TStreamExchange &

Member Type Definitions Documentation

Typedef TMark

typedef MStreamBuf::TMark TMark[private]

Used to identify the type of mark in a stream.

The type is used by functions of this class and derived classes that perform seek operations to marks within a stream.

The type uses the ERead and EWrite enumeration values, as bit flags, to identify the read and write marks respectively.

ERead is an MStreamBuf::TRead enumerator. EWrite is an MStreamBuf::EWrite enumerator.

MStreamBuf::TRead MStreamBuf::TWrite

Member Data Documentation

MStreamBuf * iHost

MStreamBuf *iHost[private]

TStreamMark * iRMrk

TStreamMark *iRMrk[private]

TStreamMark * iWMrk

TStreamMark *iWMrk[private]