TPacketPoker Class Reference
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().
- Post-condition
- A Generic implementation assert: after construct, iTail == 0 iff iCurrent == 0 (all scanned), or in other words: as long as there are bytes after current point, iTail will be non-zero (and More() returns ETrue). All methods maintain this invariant or leave, if impossible.
Some other utility methods, not directly related to scanning, are also included.
- Since
- v7.0
Constructor & Destructor Documentation
TPacketPoker(RMBufChain &)
Member Functions Documentation
AdjustL(TInt)
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.
-
leave
- KErrEof, if request cannot be satisfied.
Parameters
TInt aSize | The requested length, |
AtBegin()
TBool
| AtBegin | ( | ) | const [inline] |
Tests whether the current point is at the beginning of an RMBuf.
IsExtensionHeader(TInt)
IMPORT_C TBool | IsExtensionHeader | ( | TInt | aProtocolId | ) | [static] |
Tests whether a protocol is a known IPv6 extension header using the standard format.
Parameters
TInt aProtocolId | Protocol ID to test. |
More()
TBool
| More | ( | ) | const [inline] |
Tests whether there is more data to scan.
OverL(TInt)
IMPORT_C void | OverL | ( | TInt | aSize | ) | [private] |
Skip over bytes.
-
leave
- KErrEof, if skipped past end of chain.
Parameters
TInt aSize | The number of bytes to skip |
Ptr()
Raw pointer to the current point (can be invalid, if iTail = 0).
Note:
Internal "unsafe" method
ReferenceAndSkipL(TInt)
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.
-
leave
- KErrEof if the request cannot be satisfied.
Parameters
TInt aSize | Specified minimum number of bytes to be read through the returned pointer, and the number of bytes to move forward |
ReferenceL(TInt)
Gets a pointer to the current point, such that at least the specified minimum number of bytes can be read.
-
leave
- KErrEof if the request cannot be satisfied.
Parameters
TInt aSize = 1 | Specified minimum number of bytes to be read through the returned pointer. |
Remainder()
TInt
| Remainder | ( | ) | const [inline] |
Gets the length of the contiguous space after the current point.
SkipL(TInt)
void | SkipL | ( | TInt | aSize | ) | [inline] |
Moves the current point forward a specified number of bytes.
-
leave
- KErrEof if the request cannot be satisfied.
Parameters
TInt aSize | Number of bytes to move forward |
Member Data Documentation
RMBuf * iCurrent
The RMBuf of the current point.
TInt
iOffset
The offset of the current point in the RMBuf.
TInt
iTail
Remaining bytes starting from the current point in the RMBuf.
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.