Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Location: e32base.h
Link against: euser.lib

Class CCirBuffer

class CCirBuffer : public CCirBuf<TUint8>;

Support

Supported from 5.0

Description

Circular buffer of unsigned integers.

The integer values range from -128 to +127.

Derivation

CBaseBase class for all classes to be instantiated on the heap
CCirBufA circular buffer containing objects of a type defined by the template parameter
CCirBufBaseBase class for circular buffers
CCirBufferCircular buffer of unsigned integers

Defined in CCirBuffer:
CCirBuffer(), Get(), Put()

Inherited from CBase:
operator new()

Inherited from CCirBuf:
Add(), Remove()

Inherited from CCirBufBase:
Count(), Length(), Reset(), SetLengthL()


Construction and destruction


CCirBuffer()

CCirBuffer();

Description

Default C++ constructor.

[Top]


Adding a signed integer to the circular buffer


Put()

TInt Put(TInt aVal);

Description

Adds a signed integer value in the range -128 to +127 to the circular buffer.

Parameters

TInt aVal

The signed integer value to be added.

Return value

TInt

KErrNone if the unsigned integer is successfully added. KErrGeneral if the unsigned integer cannnot be added because the circular buffer is full.

[Top]


Removing a signed integer from the circular buffer


Get()

TInt Get();

Description

Removes an unsigned integer value from the circular buffer and return its value. The returned TUint8 is promoted to TInt to allow for negative error codes, e.g. KErrGeneral.

Return value

TInt

The unsigned integer value removed from the circular buffer. KErrGeneral if the circular buffer is empty.