RMBufChain Class Reference

class RMBufChain : public RCommsBufChain

Inherits from

Public Member Functions
RMBufChain()
RMBufChain(RCommsBuf *)
IMPORT_C TIntAlign(TInt)
IMPORT_C TIntAlloc(TInt)
IMPORT_C TIntAlloc(TInt, TInt)
IMPORT_C TIntAlloc(TInt, TInt, TInt)
IMPORT_C TIntAlloc(TInt, RMBufAllocator &)
IMPORT_C TIntAlloc(TInt, TInt, RMBufAllocator &)
IMPORT_C TIntAlloc(TInt, TInt, TInt, RMBufAllocator &)
IMPORT_C voidAllocL(TInt)
IMPORT_C voidAllocL(TInt, RMBufAllocator &)
IMPORT_C voidAppend(RMBufChain &)
IMPORT_C TIntAppend(TInt)
IMPORT_C TIntAppend(TInt, RMBufAllocator &)
IMPORT_C voidAppendL(TInt)
IMPORT_C voidAssign(RMBufQ &)
IMPORT_C voidAssign(RMBufChain &)
TInt Copy(RMBufChain &)
TInt Copy(RMBufChain &, TInt)
TInt Copy(RMBufChain &, TInt, TInt)
IMPORT_C TIntCopy(RMBufChain &, TInt, TInt, TInt)
IMPORT_C voidCopyIn(const TDesC8 &, TInt)
IMPORT_C voidCopyL(RMBufChain &, TInt, TInt)
IMPORT_C voidCopyOut(TDes8 &, TInt)
IMPORT_C TIntCreate(const TDesC8 &, TInt)
IMPORT_C voidCreateL(const TDesC8 &, TInt)
IMPORT_C voidFillZ(TInt)
RMBuf *First()
const RMBuf *First()
IMPORT_C voidFree()
IMPORT_C TBoolGoto(TInt, RMBuf *&, TInt &, TInt &, RMBuf *&)
TBool Goto(TInt, RMBuf *&, TInt &, TInt &)
voidInit()
TBool IsEmpty()
IMPORT_C RMBuf *Last()
IMPORT_C TIntLength()
voidLink(RMBufChain &)
RMBufChain &Next()
const RMBufChain &Next()
IMPORT_C TIntNumBufs()
IMPORT_C TIntPrepend(TInt)
IMPORT_C TIntPrepend(TInt, RMBufAllocator &)
IMPORT_C voidPrepend(RMBuf *)
IMPORT_C voidPrepend(RMBufChain &)
IMPORT_C voidPrependL(TInt)
IMPORT_C TIntReAlloc(TInt)
IMPORT_C voidReAllocL(TInt)
IMPORT_C RMBuf *Remove()
IMPORT_C TIntSplit(TInt, RMBufChain &)
IMPORT_C TIntSplit(TInt, RMBufChain &, RMBufAllocator &)
IMPORT_C voidSplitL(TInt, RMBufChain &)
IMPORT_C voidTrimEnd(TInt)
IMPORT_C voidTrimStart(TInt)
voidUnlink()
RMBufChain &operator=(RMBuf *)
Private Member Functions
TInt Alloc(TInt, const RMBufChain &)
TInt Alloc(TInt, const RMBufChain &, RMBufAllocator &)
Inherited Functions
RCommsBufChain::Alloc(TInt,TCommsBufAllocator &)
RCommsBufChain::Alloc(TInt,TInt,TCommsBufAllocator &)
RCommsBufChain::Alloc(TInt,TInt,TInt,TCommsBufAllocator &)
RCommsBufChain::Append(RCommsBuf *)
RCommsBufChain::Append(RCommsBufChain &)
RCommsBufChain::Assign(RCommsBufChain &)
RCommsBufChain::Goto(TInt,TInt &,TInt &)const
RCommsBufChain::Goto(TInt,TInt &,TInt &,RCommsBuf *&)const
RCommsBufChain::Prepend(RCommsBuf *)
RCommsBufChain::Prepend(RCommsBufChain &)
RCommsBufChain::RCommsBufChain()
RCommsBufChain::RCommsBufChain(RCommsBuf *)
RCommsBufChain::Read(TDes8 &,TInt)const
RCommsBufChain::Split(TInt,RCommsBufChain &)
RCommsBufChain::Write(const TDesC8 &,TInt)
Inherited Attributes
RCommsBufChain::iNext

Constructor & Destructor Documentation

RMBufChain()

RMBufChain()[inline]

Constructor

RMBufChain(RCommsBuf *)

RMBufChain(RCommsBuf *aBuf)[inline]

Constructor

Parameters

RCommsBuf * aBuf

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)

IMPORT_C TIntAlloc(TIntaLen = 0)

Allocate sufficient mbufs to hold specfied amount of data

Parameters

TInt aLen = 0A length of the cell

Alloc(TInt, TInt)

IMPORT_C TIntAlloc(TIntaLen,
TIntaMinMBufSize
)

Parameters

TInt aLen
TInt aMinMBufSize

Alloc(TInt, TInt, TInt)

IMPORT_C TIntAlloc(TIntaLen,
TIntaMinMBufSize,
TIntaMaxMBufSize
)

Parameters

TInt aLen
TInt aMinMBufSize
TInt aMaxMBufSize

Alloc(TInt, RMBufAllocator &)

IMPORT_C TIntAlloc(TIntaLen,
RMBufAllocator &aRMBufAllocator
)

Parameters

TInt aLen
RMBufAllocator & aRMBufAllocator

Alloc(TInt, TInt, RMBufAllocator &)

IMPORT_C TIntAlloc(TIntaLen,
TIntaMinMBufSize,
RMBufAllocator &aRMBufAllocator
)

Parameters

TInt aLen
TInt aMinMBufSize
RMBufAllocator & aRMBufAllocator

Alloc(TInt, TInt, TInt, RMBufAllocator &)

IMPORT_C TIntAlloc(TIntaLen,
TIntaMinMBufSize,
TIntaMaxMBufSize,
RMBufAllocator &aRMBufAllocator
)

Parameters

TInt aLen
TInt aMinMBufSize
TInt aMaxMBufSize
RMBufAllocator & aRMBufAllocator

Alloc(TInt, const RMBufChain &)

TInt Alloc(TIntaLen,
const RMBufChain &aMBufChain
)[private]

Allocate sufficient mbufs to hold specfied amount of data

Parameters

TInt aLenA length of the cell
const RMBufChain & aMBufChain

Alloc(TInt, const RMBufChain &, RMBufAllocator &)

TInt Alloc(TIntaLen,
const RMBufChain &aMBufChain,
RMBufAllocator &aRMBufAllocator
)[private]

Parameters

TInt aLen
const RMBufChain & aMBufChain
RMBufAllocator & aRMBufAllocator

AllocL(TInt)

IMPORT_C voidAllocL(TIntaLen = 0)

Parameters

TInt aLen = 0

AllocL(TInt, RMBufAllocator &)

IMPORT_C voidAllocL(TIntaLen,
RMBufAllocator &aRMBufAllocator
)

Parameters

TInt aLen
RMBufAllocator & aRMBufAllocator

Append(RMBufChain &)

IMPORT_C voidAppend(RMBufChain &aChain)

Parameters

RMBufChain & aChain

Append(TInt)

IMPORT_C TIntAppend(TIntaLen)
Append space to the end of a MBuf chain
  • refer RMBufChain::AllocL notes regarding the deliberate decision not to provide an overloaded min/max mbuf size variant

Parameters

TInt aLenthe length (how many byte to be appended to the end)

Append(TInt, RMBufAllocator &)

IMPORT_C TIntAppend(TIntaLen,
RMBufAllocator &aRMBufAllocator
)

Parameters

TInt aLen
RMBufAllocator & aRMBufAllocator

AppendL(TInt)

IMPORT_C voidAppendL(TIntaLen)

Append space to the end of a MBuf chain

Parameters

TInt aLenthe length (how many byte to be appended to the end)

Assign(RMBufQ &)

IMPORT_C voidAssign(RMBufQ &aQueue)

Take ownership of Mbuf from a queue Previously allocated data (e.g. by a call to RMBufChain::AllocL) in the chain must be emptied (e.g. by calling RMBufChain::Free) before the assignment RMBufChain::IsEmpty() RMBufChain::Free()

Parameters

RMBufQ & aQueuethe queue

Assign(RMBufChain &)

IMPORT_C voidAssign(RMBufChain &aChain)

Parameters

RMBufChain & aChain

Copy(RMBufChain &)

TInt Copy(RMBufChain &newChain)const [inline]

Parameters

RMBufChain & newChain

Copy(RMBufChain &, TInt)

TInt Copy(RMBufChain &newChain,
TIntaOffset
)const [inline]

Parameters

RMBufChain & newChain
TInt aOffset

Copy(RMBufChain &, TInt, TInt)

TInt Copy(RMBufChain &newChain,
TIntaOffset,
TIntaLen
)const [inline]

Parameters

RMBufChain & newChain
TInt aOffset
TInt aLen

Copy(RMBufChain &, TInt, TInt, TInt)

IMPORT_C TIntCopy(RMBufChain &newChain,
TIntaOffset,
TIntaLen,
TIntaHdrReserve
)const
Copy data into a new chain starting at a given offset into this chain.
  • refer RMBufChain::AllocL notes regarding the deliberate decision not to provide an overloaded min/max mbuf size variant

Parameters

RMBufChain & newChainA new chain, where the data is copied to
TInt aOffsetA offset,
TInt aLenthe length of the data to be copied
TInt aHdrReserveAmount of space (bytes) to offset the start of data from the start of the first buffer, so allowing subsequent prepending without further allocation (typically used for protocol headers)

CopyIn(const TDesC8 &, TInt)

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

Parameters

const TDesC8 & aDes
TInt aOffset = 0

CopyL(RMBufChain &, TInt, TInt)

IMPORT_C voidCopyL(RMBufChain &newChain,
TIntaOffset = 0,
TIntaLen =  KMBufAll
)const

Copy data into a new chain starting at a given offset into this chain. Allocate sufficient mbufs to hold specfied amount of data, optionally zeroing the buffers.

Parameters

RMBufChain & newChain
TInt aOffset = 0
TInt aLen =  KMBufAll A length of the cell

CopyOut(TDes8 &, TInt)

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

Copy data from an mbuf chain into linear buffer starting at specified offset.

Parameters

TDes8 & aDesthe buffer to copy in to
TInt aOffset = 0the offset

Create(const TDesC8 &, TInt)

IMPORT_C TIntCreate(const TDesC8 &aDes,
TIntaHdrLen = 0
)
Create an Mbuf chain from a descriptor optionally allowing room at front for a protocol header.
  • refer RMBufChain::AllocL notes regarding the deliberate decision not to provide an overloaded min/max mbuf size variant

Parameters

const TDesC8 & aDes
TInt aHdrLen = 0A header length

CreateL(const TDesC8 &, TInt)

IMPORT_C voidCreateL(const TDesC8 &aDes,
TIntaHdrLen = 0
)

Create an Mbuf chain from a descriptor optionally allowing room at front for a protocol header.

Parameters

const TDesC8 & aDes
TInt aHdrLen = 0A header length

FillZ(TInt)

IMPORT_C voidFillZ(TIntaLen =  KMBufAll )

Zero fill the first aLen bytes of an mbuf chain

Parameters

TInt aLen =  KMBufAll the length (how many byte to be appended to the end)

First()

RMBuf *First()[inline]

Rerurns the first in the chain

First()

const RMBuf *First()const [inline]

Returns the first in the chain

Free()

IMPORT_C voidFree()

Free an MBuf chain, returning it to the free Pool A pointer to the first mbuf of the next packet is returned.

Goto(TInt, RMBuf *&, TInt &, TInt &, RMBuf *&)

IMPORT_C TBoolGoto(TIntaOffset,
RMBuf *&resBuf,
TInt &resOffset,
TInt &resLength,
RMBuf *&resPrevBuf
)const

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

Parameters

TInt aOffsetThe offset
RMBuf *& resBufresult buffer
TInt & resOffsetresult offset
TInt & resLengthresult length
RMBuf *& resPrevBufresult previous Buf in the chain

Goto(TInt, RMBuf *&, TInt &, TInt &)

TBool Goto(TIntaOffset,
RMBuf *&resBuf,
TInt &resOffset,
TInt &resLength
)const [inline]

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

Parameters

TInt aOffsetThe offset
RMBuf *& resBufresult buffer
TInt & resOffsetresult offset
TInt & resLengthresult length

Init()

voidInit()[inline]

Initializes the members (iNext = NULL)

IsEmpty()

TBool IsEmpty()const [inline]

Check if empty, if empty returns true

Last()

IMPORT_C RMBuf *Last()const

Find the last MBuf in a chain

Length()

IMPORT_C TIntLength()const

Return the number of bytes of actual data contained in an MBuf chain

Link(RMBufChain &)

voidLink(RMBufChain &aChain)[inline]

Links a chain to the chain in the chain

Parameters

RMBufChain & aChainThe chain to be linked

Next()

RMBufChain &Next()[inline]

Returns next in the chain if there is next else returns the current

Next()

const RMBufChain &Next()const [inline]

Returns next in the chain if there is next else returns the current

NumBufs()

IMPORT_C TIntNumBufs()const

Count the number of buffers in a chain

Prepend(TInt)

IMPORT_C TIntPrepend(TIntaLen)
Prepend space onto the front of a chain
  • refer RMBufChain::AllocL notes regarding the deliberate decision not to provide an overloaded min/max mbuf size variant

Parameters

TInt aLenthe length of the space

Prepend(TInt, RMBufAllocator &)

IMPORT_C TIntPrepend(TIntaLen,
RMBufAllocator &aRMBufAllocator
)

Parameters

TInt aLen
RMBufAllocator & aRMBufAllocator

Prepend(RMBuf *)

IMPORT_C voidPrepend(RMBuf *aBuf)

Parameters

RMBuf * aBuf

Prepend(RMBufChain &)

IMPORT_C voidPrepend(RMBufChain &aChain)

Parameters

RMBufChain & aChain

PrependL(TInt)

IMPORT_C voidPrependL(TIntaLen)

Prepend space onto the front of a chain

Parameters

TInt aLenthe length of the space

ReAlloc(TInt)

IMPORT_C TIntReAlloc(TIntaLen)
Adjust the size of a chain, allocates a new memory for the chain
  • refer RMBufChain::AllocL notes regarding the deliberate decision not to provide an overloaded min/max mbuf size variant

Parameters

TInt aLenA new length

ReAllocL(TInt)

IMPORT_C voidReAllocL(TIntaLen)

Adjust the size of a chain, allocates a new memory for the chain

Parameters

TInt aLenA new length

Remove()

IMPORT_C RMBuf *Remove()

Removes and returns the first RCommsBuf. The ownership of the returned RCommsBuf is with the caller

Split(TInt, RMBufChain &)

IMPORT_C TIntSplit(TIntaOffset,
RMBufChain &newChain
)
Split a chain into two new chains Original chain gets the 1st half newChain gets the other half.
  • refer RMBufChain::AllocL notes regarding the deliberate decision not to provide an overloaded min/max mbuf size variant

Parameters

TInt aOffset
RMBufChain & newChainThe result chain

Split(TInt, RMBufChain &, RMBufAllocator &)

IMPORT_C TIntSplit(TIntaOffset,
RMBufChain &newChain,
RMBufAllocator &aRMBufAllocator
)

Parameters

TInt aOffset
RMBufChain & newChain
RMBufAllocator & aRMBufAllocator

SplitL(TInt, RMBufChain &)

IMPORT_C voidSplitL(TIntaOffset,
RMBufChain &newChain
)

Split a chain into two new chains Original chain gets the 1st half newChain gets the other half.

Parameters

TInt aOffsetThe offset
RMBufChain & newChainThe result chain

TrimEnd(TInt)

IMPORT_C voidTrimEnd(TIntaOffset)

Trim chain after offset

Parameters

TInt aOffsetThe offset

TrimStart(TInt)

IMPORT_C voidTrimStart(TIntnBytes)

Trim chain upto offset

Parameters

TInt nBytes

Unlink()

voidUnlink()[inline]

Unlink the nfirst in the chain

operator=(RMBuf *)

RMBufChain &operator=(RMBuf *aChain)[inline]

operator =

Parameters

RMBuf * aChain