#include <e32base.h>
| class CCirBuffer : public CCirBuf< TUint8 > |
| Public Member Functions | |
|---|---|
| CCirBuffer() | |
| ~CCirBuffer() | |
| IMPORT_C TInt | Get() |
| IMPORT_C TInt | Put(TInt) |
| Inherited Attributes | |
|---|---|
| CCirBufBase::iCount | |
| CCirBufBase::iHead | |
| CCirBufBase::iLength | |
| CCirBufBase::iPtr | |
| CCirBufBase::iPtrE | |
| CCirBufBase::iSize | |
| CCirBufBase::iTail | |
Circular buffer of unsigned 8-bit integers.
The integer values range from 0 to 255.
| IMPORT_C TInt | Get | ( | ) |
Removes an unsigned 8-bit integer value from the circular buffer and returns its value.
The returned TUint8 is promoted to a TInt to allow for negative error codes, e.g. KErrGeneral.
Returns: The unsigned 8-bit integer value removed from the circular buffer. KErrGeneral, if the circular buffer is empty.
Adds an unsigned 8-bit integer value in the range 0 to 255 to the circular buffer.
If the specified integer is outside the range 0 to 255, this method discards all but the lowest 8 bits and treats those as the unsigned integer to store. For example, specifying -2 (or 510, or -258, etc) will result in 254 being stored, and therefore in 254 being returned by the Get() method (and not the number passed to Put()).
See also: CCirBuffer::Get()
| Parameter | Description |
|---|---|
| aVal | The unsigned 8-bit integer value to be added. |
Returns: KErrNone, if the unsigned integer is successfully added. KErrGeneral, if the unsigned integer cannnot be added because the circular buffer is full.