RMBufChain Class Reference

class RMBufChain : public RCommsBufChain

Inherits from

Public Member Functions
RMBufChain ()
RMBufChain ( RCommsBuf *)
IMPORT_C TInt Align ( TInt )
IMPORT_C TInt Alloc ( TInt )
IMPORT_C TInt Alloc ( TInt , TInt )
IMPORT_C TInt Alloc ( TInt , TInt , TInt )
IMPORT_C TInt Alloc ( TInt , RMBufAllocator &)
IMPORT_C TInt Alloc ( TInt , TInt , RMBufAllocator &)
IMPORT_C TInt Alloc ( TInt , TInt , TInt , RMBufAllocator &)
IMPORT_C void AllocL ( TInt )
IMPORT_C void AllocL ( TInt , RMBufAllocator &)
IMPORT_C void Append ( RMBufChain &)
IMPORT_C TInt Append ( TInt )
IMPORT_C TInt Append ( TInt , RMBufAllocator &)
IMPORT_C void AppendL ( TInt )
IMPORT_C void Assign ( RMBufQ &)
IMPORT_C void Assign ( RMBufChain &)
TInt Copy ( RMBufChain &)
TInt Copy ( RMBufChain &, TInt )
TInt Copy ( RMBufChain &, TInt , TInt )
IMPORT_C TInt Copy ( RMBufChain &, TInt , TInt , TInt )
IMPORT_C void CopyIn (const TDesC8 &, TInt )
IMPORT_C void CopyL ( RMBufChain &, TInt , TInt )
IMPORT_C void CopyOut ( TDes8 &, TInt )
IMPORT_C TInt Create (const TDesC8 &, TInt )
IMPORT_C void CreateL (const TDesC8 &, TInt )
IMPORT_C void FillZ ( TInt )
RMBuf * First ()
const RMBuf * First ()
IMPORT_C void Free ()
IMPORT_C TBool Goto ( TInt , RMBuf *&, TInt &, TInt &, RMBuf *&)
TBool Goto ( TInt , RMBuf *&, TInt &, TInt &)
void Init ()
TBool IsEmpty ()
IMPORT_C RMBuf * Last ()
IMPORT_C TInt Length ()
void Link ( RMBufChain &)
RMBufChain & Next ()
const RMBufChain & Next ()
IMPORT_C TInt NumBufs ()
IMPORT_C TInt Prepend ( TInt )
IMPORT_C TInt Prepend ( TInt , RMBufAllocator &)
IMPORT_C void Prepend ( RMBuf *)
IMPORT_C void Prepend ( RMBufChain &)
IMPORT_C void PrependL ( TInt )
IMPORT_C TInt ReAlloc ( TInt )
IMPORT_C void ReAllocL ( TInt )
IMPORT_C RMBuf * Remove ()
IMPORT_C TInt Split ( TInt , RMBufChain &)
IMPORT_C TInt Split ( TInt , RMBufChain &, RMBufAllocator &)
IMPORT_C void SplitL ( TInt , RMBufChain &)
IMPORT_C void TrimEnd ( TInt )
IMPORT_C void TrimStart ( TInt )
void Unlink ()
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 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)

IMPORT_C TInt Alloc ( TInt aLen = 0 )

Allocate sufficient mbufs to hold specfied amount of data

Parameters

TInt aLen = 0 A length of the cell

Alloc(TInt, TInt)

IMPORT_C TInt Alloc ( TInt aLen,
TInt aMinMBufSize
)

Parameters

TInt aLen
TInt aMinMBufSize

Alloc(TInt, TInt, TInt)

IMPORT_C TInt Alloc ( TInt aLen,
TInt aMinMBufSize,
TInt aMaxMBufSize
)

Parameters

TInt aLen
TInt aMinMBufSize
TInt aMaxMBufSize

Alloc(TInt, RMBufAllocator &)

IMPORT_C TInt Alloc ( TInt aLen,
RMBufAllocator & aRMBufAllocator
)

Parameters

TInt aLen
RMBufAllocator & aRMBufAllocator

Alloc(TInt, TInt, RMBufAllocator &)

IMPORT_C TInt Alloc ( TInt aLen,
TInt aMinMBufSize,
RMBufAllocator & aRMBufAllocator
)

Parameters

TInt aLen
TInt aMinMBufSize
RMBufAllocator & aRMBufAllocator

Alloc(TInt, TInt, TInt, RMBufAllocator &)

IMPORT_C TInt Alloc ( TInt aLen,
TInt aMinMBufSize,
TInt aMaxMBufSize,
RMBufAllocator & aRMBufAllocator
)

Parameters

TInt aLen
TInt aMinMBufSize
TInt aMaxMBufSize
RMBufAllocator & aRMBufAllocator

Alloc(TInt, const RMBufChain &)

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

Allocate sufficient mbufs to hold specfied amount of data

Parameters

TInt aLen A length of the cell
const RMBufChain & aMBufChain

Alloc(TInt, const RMBufChain &, RMBufAllocator &)

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

Parameters

TInt aLen
const RMBufChain & aMBufChain
RMBufAllocator & aRMBufAllocator

AllocL(TInt)

IMPORT_C void AllocL ( TInt aLen = 0 )

Parameters

TInt aLen = 0

AllocL(TInt, RMBufAllocator &)

IMPORT_C void AllocL ( TInt aLen,
RMBufAllocator & aRMBufAllocator
)

Parameters

TInt aLen
RMBufAllocator & aRMBufAllocator

Append(RMBufChain &)

IMPORT_C void Append ( RMBufChain & aChain )

Parameters

RMBufChain & aChain

Append(TInt)

IMPORT_C TInt Append ( TInt aLen )
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 aLen the length (how many byte to be appended to the end)

Append(TInt, RMBufAllocator &)

IMPORT_C TInt Append ( TInt aLen,
RMBufAllocator & aRMBufAllocator
)

Parameters

TInt aLen
RMBufAllocator & aRMBufAllocator

AppendL(TInt)

IMPORT_C void AppendL ( TInt aLen )

Append space to the end of a MBuf chain

Parameters

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

Assign(RMBufQ &)

IMPORT_C void Assign ( 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 & aQueue the queue

Assign(RMBufChain &)

IMPORT_C void Assign ( RMBufChain & aChain )

Parameters

RMBufChain & aChain

Copy(RMBufChain &)

TInt Copy ( RMBufChain & newChain ) const [inline]

Parameters

RMBufChain & newChain

Copy(RMBufChain &, TInt)

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

Parameters

RMBufChain & newChain
TInt aOffset

Copy(RMBufChain &, TInt, TInt)

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

Parameters

RMBufChain & newChain
TInt aOffset
TInt aLen

Copy(RMBufChain &, TInt, TInt, TInt)

IMPORT_C TInt Copy ( RMBufChain & newChain,
TInt aOffset,
TInt aLen,
TInt aHdrReserve
) 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 & newChain A new chain, where the data is copied to
TInt aOffset A offset,
TInt aLen the length of the data to be copied
TInt aHdrReserve Amount 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 void CopyIn ( const TDesC8 & aDes,
TInt aOffset = 0
)

Parameters

const TDesC8 & aDes
TInt aOffset = 0

CopyL(RMBufChain &, TInt, TInt)

IMPORT_C void CopyL ( RMBufChain & newChain,
TInt aOffset = 0,
TInt aLen =  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 void CopyOut ( TDes8 & aDes,
TInt aOffset = 0
) const

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

Parameters

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

Create(const TDesC8 &, TInt)

IMPORT_C TInt Create ( const TDesC8 & aDes,
TInt aHdrLen = 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 = 0 A header length

CreateL(const TDesC8 &, TInt)

IMPORT_C void CreateL ( const TDesC8 & aDes,
TInt aHdrLen = 0
)

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

Parameters

const TDesC8 & aDes
TInt aHdrLen = 0 A header length

FillZ(TInt)

IMPORT_C void FillZ ( TInt aLen =  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 void Free ( )

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 TBool Goto ( TInt aOffset,
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 aOffset The offset
RMBuf *& resBuf result buffer
TInt & resOffset result offset
TInt & resLength result length
RMBuf *& resPrevBuf result previous Buf in the chain

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

TBool Goto ( TInt aOffset,
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 aOffset The offset
RMBuf *& resBuf result buffer
TInt & resOffset result offset
TInt & resLength result length

Init()

void Init ( ) [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 TInt Length ( ) const

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

Link(RMBufChain &)

void Link ( RMBufChain & aChain ) [inline]

Links a chain to the chain in the chain

Parameters

RMBufChain & aChain The 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 TInt NumBufs ( ) const

Count the number of buffers in a chain

Prepend(TInt)

IMPORT_C TInt Prepend ( TInt aLen )
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 aLen the length of the space

Prepend(TInt, RMBufAllocator &)

IMPORT_C TInt Prepend ( TInt aLen,
RMBufAllocator & aRMBufAllocator
)

Parameters

TInt aLen
RMBufAllocator & aRMBufAllocator

Prepend(RMBuf *)

IMPORT_C void Prepend ( RMBuf * aBuf )

Parameters

RMBuf * aBuf

Prepend(RMBufChain &)

IMPORT_C void Prepend ( RMBufChain & aChain )

Parameters

RMBufChain & aChain

PrependL(TInt)

IMPORT_C void PrependL ( TInt aLen )

Prepend space onto the front of a chain

Parameters

TInt aLen the length of the space

ReAlloc(TInt)

IMPORT_C TInt ReAlloc ( TInt aLen )
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 aLen A new length

ReAllocL(TInt)

IMPORT_C void ReAllocL ( TInt aLen )

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

Parameters

TInt aLen A 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 TInt Split ( TInt aOffset,
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 & newChain The result chain

Split(TInt, RMBufChain &, RMBufAllocator &)

IMPORT_C TInt Split ( TInt aOffset,
RMBufChain & newChain,
RMBufAllocator & aRMBufAllocator
)

Parameters

TInt aOffset
RMBufChain & newChain
RMBufAllocator & aRMBufAllocator

SplitL(TInt, RMBufChain &)

IMPORT_C void SplitL ( TInt aOffset,
RMBufChain & newChain
)

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

Parameters

TInt aOffset The offset
RMBufChain & newChain The result chain

TrimEnd(TInt)

IMPORT_C void TrimEnd ( TInt aOffset )

Trim chain after offset

Parameters

TInt aOffset The offset

TrimStart(TInt)

IMPORT_C void TrimStart ( TInt nBytes )

Trim chain upto offset

Parameters

TInt nBytes

Unlink()

void Unlink ( ) [inline]

Unlink the nfirst in the chain

operator=(RMBuf *)

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

operator =

Parameters

RMBuf * aChain