RCommsBufChain Class Reference

class RCommsBufChain
Public Member Functions
RCommsBufChain()
RCommsBufChain(RCommsBuf *)
IMPORT_C TIntAlign(TInt)
IMPORT_C TIntAlloc(TInt, TCommsBufAllocator &)
IMPORT_C TIntAlloc(TInt, TInt, TCommsBufAllocator &)
IMPORT_C TIntAlloc(TInt, TInt, TInt, TCommsBufAllocator &)
IMPORT_C voidAppend(RCommsBufChain &)
IMPORT_C voidAppend(RCommsBuf *)
IMPORT_C TIntAppend(TInt)
IMPORT_C voidAssign(RCommsBufChain &)
IMPORT_C voidFree()
TBool IsEmpty()
IMPORT_C TIntLength()
IMPORT_C voidPrepend(RCommsBufChain &)
IMPORT_C voidPrepend(RCommsBuf *)
IMPORT_C TIntPrepend(TInt)
IMPORT_C voidRead(TDes8 &, TInt)
IMPORT_C TIntSplit(TInt, RCommsBufChain &)
IMPORT_C voidTrimEnd(TInt)
IMPORT_C voidTrimStart(TInt)
IMPORT_C voidWrite(const TDesC8 &, TInt)
Protected Member Functions
IMPORT_C RCommsBuf *Goto(TInt, TInt &, TInt &, RCommsBuf *&)
RCommsBuf *Goto(TInt, TInt &, TInt &)
IMPORT_C RCommsBuf *Last()
Private Member Functions
RCommsBuf *First()
const RCommsBuf *First()
RCommsBuf *Last()
Protected Attributes
RCommsBuf *iNext

Constructor & Destructor Documentation

RCommsBufChain()

RCommsBufChain()[inline]

RCommsBufChain(RCommsBuf *)

RCommsBufChain(RCommsBuf *aHeadBuf)[inline]

Parameters

RCommsBuf * aHeadBuf

Member Functions Documentation

Align(TInt)

IMPORT_C TIntAlign(TIntaSize)

Ensure that the first aSize bytes can be safely cast to a structure of size aSize.

Parameters

TInt aSizeA size

Alloc(TInt, TCommsBufAllocator &)

IMPORT_C TIntAlloc(TIntaSize,
TCommsBufAllocator &aAccessor
)

Allocate a chain of RCommsBuf

Parameters

TInt aSizeThe requested total size
TCommsBufAllocator & aAccessorA handle to the allocator

Alloc(TInt, TInt, TCommsBufAllocator &)

IMPORT_C TIntAlloc(TIntaSize,
TIntaMinBufSize,
TCommsBufAllocator &aAccessor
)

Allocate a chain of RCommsBuf

Parameters

TInt aSizeThe requested total size
TInt aMinBufSizeThe size that the allocated buffer "must" atleast have
TCommsBufAllocator & aAccessorA handle to the allocator

Alloc(TInt, TInt, TInt, TCommsBufAllocator &)

IMPORT_C TIntAlloc(TIntaSize,
TIntaMinBufSize,
TIntaMaxBufSize,
TCommsBufAllocator &aAccessor
)

Allocate a chain of RCommsBuf

Parameters

TInt aSizeThe requested total size
TInt aMinBufSizeThe size that the allocated buffer can have
TInt aMaxBufSize
TCommsBufAllocator & aAccessorA handle to the allocator

Append(RCommsBufChain &)

IMPORT_C voidAppend(RCommsBufChain &aChain)

Append the supplied RCommsBufChain to "this" chain. After append the supplied RCommsBufChain will be reset and becomes empty

Parameters

RCommsBufChain & aChainThe chain to be appended

Append(RCommsBuf *)

IMPORT_C voidAppend(RCommsBuf *aBuf)

Append the supplied RCommsBuf to "this" chain.

Parameters

RCommsBuf * aBufThe RCommsBuf to be appended

Append(TInt)

IMPORT_C TIntAppend(TIntaLen)

Append space to the end of "this" chain. More RCommsBuf will be allocated if available append length is exceeding the supplied length

Length to appended

Parameters

TInt aLen

Assign(RCommsBufChain &)

IMPORT_C voidAssign(RCommsBufChain &aChain)

Assign the supplied RCommsBufChain to "this" chain. After assign the supplied RCommsBufChain will be reset and becomes empty

Parameters

RCommsBufChain & aChainThe chain to be assigned

First()

RCommsBuf *First()[private, inline]

Returns the first RCommsBuf in the chain.

First()

const RCommsBuf *First()const [private, inline]

Free()

IMPORT_C voidFree()

Frees the RCommsBuf's in the chain. Upon completion the chain will become empty

Goto(TInt, TInt &, TInt &, RCommsBuf *&)

IMPORT_C RCommsBuf *Goto(TIntaDataOffset,
TInt &aBufDataOffset,
TInt &aBufDataLen,
RCommsBuf *&resPrevBuf
)const [protected]

Goto specified byte offset into an CommsBuf chain. Used as part of Read/Write, split etc to position CommsBuf pointer and offset from start of iBuffer.

Parameters

TInt aDataOffset
TInt & aBufDataOffset
TInt & aBufDataLen
RCommsBuf *& resPrevBufresult previous Buf in the chain

Goto(TInt, TInt &, TInt &)

RCommsBuf *Goto(TIntaDataOffset,
TInt &aBufDataOffset,
TInt &aBufDataLen
)const [protected, inline]

Goto specified byte offset into a CommsBuf chain. Used as part of copyin/out, split etc to position RCommsBuf pointer and offset from start of iBuffer.

Parameters

TInt aDataOffset
TInt & aBufDataOffset
TInt & aBufDataLen

IsEmpty()

TBool IsEmpty()const [inline]

Check if the chain is empty. If empty returns ETrue otherwise EFalse

Last()

IMPORT_C RCommsBuf *Last()const [protected]

Returns the const pointer to the last RCommsBuf in the chain

Last()

RCommsBuf *Last()[private]

Returns the pointer to the last RCommsBuf in the chain

Length()

IMPORT_C TIntLength()const

Returns the actual number of bytes present in the chain

Prepend(RCommsBufChain &)

IMPORT_C voidPrepend(RCommsBufChain &aChain)

Prepend the supplied RCommsBufChain to "this" chain. After prepend the supplied RCommsBufChain will be reset and becomes empty

Parameters

RCommsBufChain & aChainThe chain to be prepended

Prepend(RCommsBuf *)

IMPORT_C voidPrepend(RCommsBuf *aBuf)

Prepend the supplied RCommsBuf to "this" chain.

Parameters

RCommsBuf * aBufThe RCommsBuf to be prepended

Prepend(TInt)

IMPORT_C TIntPrepend(TIntaLen)

Prepend space to the end of "this" chain. More RCommsBuf will be allocated if available prepend length is exceeding the supplied length

Length to prepended

Parameters

TInt aLen

Read(TDes8 &, TInt)

IMPORT_C voidRead(TDes8 &aDes,
TIntaOffset = 0
)const

Read to the supplied descriptor at the specified offset within the chain

Parameters

TDes8 & aDesDescriptor to read
TInt aOffset = 0Offset within the chain

Split(TInt, RCommsBufChain &)

IMPORT_C TIntSplit(TIntaOffset,
RCommsBufChain &aNewChain
)

Parameters

TInt aOffset
RCommsBufChain & aNewChain

TrimEnd(TInt)

IMPORT_C voidTrimEnd(TIntanOffset)

Trim the rightmost part of the data in the chain with the no. of bytes that is supplied

Parameters

TInt anOffsetThe no. of bytes to be trimmed

TrimStart(TInt)

IMPORT_C voidTrimStart(TIntnBytes)

Trim the leftmost part of the data in the chain with the no. of bytes that is supplied

Parameters

TInt nBytesThe no. of bytes to be trimmed

Write(const TDesC8 &, TInt)

IMPORT_C voidWrite(const TDesC8 &aDes,
TIntaOffset = 0
)

Writes the supplied descriptor at the specified offset within the chain

Parameters

const TDesC8 & aDesDescriptor to write
TInt aOffset = 0Offset within the chain

Member Data Documentation

RCommsBuf * iNext

RCommsBuf *iNext[protected]