RCommsBufChain Class Reference

class RCommsBufChain

Constructor & Destructor Documentation

RCommsBufChain()

RCommsBufChain ( ) [inline]

RCommsBufChain(RCommsBuf *)

RCommsBufChain ( RCommsBuf * aHeadBuf ) [inline]

Parameters

RCommsBuf * aHeadBuf

Member Functions Documentation

Align(TInt)

IMPORT_C TInt Align ( TInt aSize )

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

Parameters

TInt aSize A size

Alloc(TInt, TCommsBufAllocator &)

IMPORT_C TInt Alloc ( TInt aSize,
TCommsBufAllocator & aAccessor
)

Allocate a chain of RCommsBuf

Parameters

TInt aSize The requested total size
TCommsBufAllocator & aAccessor A handle to the allocator

Alloc(TInt, TInt, TCommsBufAllocator &)

IMPORT_C TInt Alloc ( TInt aSize,
TInt aMinBufSize,
TCommsBufAllocator & aAccessor
)

Allocate a chain of RCommsBuf

Parameters

TInt aSize The requested total size
TInt aMinBufSize The size that the allocated buffer "must" atleast have
TCommsBufAllocator & aAccessor A handle to the allocator

Alloc(TInt, TInt, TInt, TCommsBufAllocator &)

IMPORT_C TInt Alloc ( TInt aSize,
TInt aMinBufSize,
TInt aMaxBufSize,
TCommsBufAllocator & aAccessor
)

Allocate a chain of RCommsBuf

Parameters

TInt aSize The requested total size
TInt aMinBufSize The size that the allocated buffer can have
TInt aMaxBufSize
TCommsBufAllocator & aAccessor A handle to the allocator

Append(RCommsBufChain &)

IMPORT_C void Append ( RCommsBufChain & aChain )

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

Parameters

RCommsBufChain & aChain The chain to be appended

Append(RCommsBuf *)

IMPORT_C void Append ( RCommsBuf * aBuf )

Append the supplied RCommsBuf to "this" chain.

Parameters

RCommsBuf * aBuf The RCommsBuf to be appended

Append(TInt)

IMPORT_C TInt Append ( TInt aLen )

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 void Assign ( RCommsBufChain & aChain )

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

Parameters

RCommsBufChain & aChain The 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 void Free ( )

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

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

IMPORT_C RCommsBuf * Goto ( TInt aDataOffset,
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 *& resPrevBuf result previous Buf in the chain

Goto(TInt, TInt &, TInt &)

RCommsBuf * Goto ( TInt aDataOffset,
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 TInt Length ( ) const

Returns the actual number of bytes present in the chain

Prepend(RCommsBufChain &)

IMPORT_C void Prepend ( RCommsBufChain & aChain )

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

Parameters

RCommsBufChain & aChain The chain to be prepended

Prepend(RCommsBuf *)

IMPORT_C void Prepend ( RCommsBuf * aBuf )

Prepend the supplied RCommsBuf to "this" chain.

Parameters

RCommsBuf * aBuf The RCommsBuf to be prepended

Prepend(TInt)

IMPORT_C TInt Prepend ( TInt aLen )

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 void Read ( TDes8 & aDes,
TInt aOffset = 0
) const

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

Parameters

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

Split(TInt, RCommsBufChain &)

IMPORT_C TInt Split ( TInt aOffset,
RCommsBufChain & aNewChain
)

Parameters

TInt aOffset
RCommsBufChain & aNewChain

TrimEnd(TInt)

IMPORT_C void TrimEnd ( TInt anOffset )

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

Parameters

TInt anOffset The no. of bytes to be trimmed

TrimStart(TInt)

IMPORT_C void TrimStart ( TInt nBytes )

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

Parameters

TInt nBytes The no. of bytes to be trimmed

Write(const TDesC8 &, TInt)

IMPORT_C void Write ( const TDesC8 & aDes,
TInt aOffset = 0
)

Writes the supplied descriptor at the specified offset within the chain

Parameters

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

Member Data Documentation

RCommsBuf * iNext

RCommsBuf * iNext [protected]