class TPacketPoker |
Provides a utility for linear scanning of a chain of RMBuf objects (an RMBufChain ).
An object of this type maintains a current point in the RMBufChain . This point can only move forward, and a leave occurs if the point advances beyond the end of the chain.
Any pointers and aligns arranged before the current point, remain valid: for example, you can save a reference and advance the pointer, and the reference remains usable.
If instead you need to go to a single specified offset, then use RMBufChain::Goto() or RMBufPacketPeek::Access() .
Public Member Functions | |
---|---|
TPacketPoker ( RMBufChain &) | |
TBool | AtBegin () |
IMPORT_C TBool | IsExtensionHeader ( TInt ) |
TBool | More () |
TUint8 * | Ptr () |
TUint8 * | ReferenceAndSkipL ( TInt ) |
TUint8 * | ReferenceL ( TInt ) |
TInt | Remainder () |
void | SkipL ( TInt ) |
Private Member Functions | |
---|---|
IMPORT_C TUint8 * | AdjustL ( TInt ) |
IMPORT_C void | OverL ( TInt ) |
Private Attributes | |
---|---|
RMBuf * | iCurrent |
TInt | iOffset |
TInt | iTail |
IMPORT_C | TPacketPoker | ( | RMBufChain & | aChain | ) |
Constructor.
RMBufChain & aChain | The RMBuf chain to be poked. |
IMPORT_C TUint8 * | AdjustL | ( | TInt | aSize | ) | [private] |
Arrange contiguous run of bytes.
Arragen content of RMBuf chain so that starting from the current offset, a number of bytes is accessible in contiguous memory.
TInt aSize | The requested length, |
TBool | AtBegin | ( | ) | const [inline] |
Tests whether the current point is at the beginning of an RMBuf .
IMPORT_C TBool | IsExtensionHeader | ( | TInt | aProtocolId | ) | [static] |
Tests whether a protocol is a known IPv6 extension header using the standard format.
TInt aProtocolId | Protocol ID to test. |
IMPORT_C void | OverL | ( | TInt | aSize | ) | [private] |
Skip over bytes.
TInt aSize | The number of bytes to skip |
TUint8 * | Ptr | ( | ) | const [inline] |
Raw pointer to the current point (can be invalid, if iTail = 0).
Internal "unsafe" method
TUint8 * | ReferenceAndSkipL | ( | TInt | aSize | ) | [inline] |
Gets a pointer to the current point, such that at least the specified minimum number of bytes can be read, and moves the point the specified number of bytes forward.
TInt aSize | Specified minimum number of bytes to be read through the returned pointer, and the number of bytes to move forward |
TUint8 * | ReferenceL | ( | TInt | aSize = 1 | ) | [inline] |
Gets a pointer to the current point, such that at least the specified minimum number of bytes can be read.
TInt aSize = 1 | Specified minimum number of bytes to be read through the returned pointer. |
TInt | Remainder | ( | ) | const [inline] |
Gets the length of the contiguous space after the current point.
void | SkipL | ( | TInt | aSize | ) | [inline] |
Moves the current point forward a specified number of bytes.
TInt aSize | Number of bytes to move forward |
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.