CCirBuffer Class Reference

#include <e32base.h>

class CCirBuffer : public CCirBuf< TUint8 >

Inherits from

Detailed Description

Circular buffer of unsigned 8-bit integers.

The integer values range from 0 to 255.

Constructor & Destructor Documentation

CCirBuffer ( )

IMPORT_CCCirBuffer()

Default C++ constructor.

~CCirBuffer ( )

IMPORT_C~CCirBuffer()

Destructor

Member Function Documentation

Get ( )

IMPORT_C TIntGet()

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.

Put ( TInt )

IMPORT_C TIntPut(TIntaVal)

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()

ParameterDescription
aValThe 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.