Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

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



Location: e32base.h
Link against: euser.lib

Class CCirBufBase

CCirBufBase

Support

Supported from 5.0

Description

Base class for circular buffers. The class is part of the implementation of circular buffers and is never instantiated. It provides member functions which form part of the interface.

Derivation

CBaseBase class for all classes to be instantiated on the heap
CCirBufBaseBase class for circular buffers

Defined in CCirBufBase:
Count(), Length(), Reset(), SetLengthL(), ~CCirBufBase()

Inherited from CBase:
operator new()


Construction and destruction


~CCirBufBase()

~CCirBufBase();

Description

Destructor. This frees the memory allocated to the buffer.

[Top]


Maximum buffer capacity


SetLengthL()

void SetLengthL(TInt aLength);

Description

Sets the maximum capacity of this circular buffer. The capacity is the maximum number of elements that the buffer can hold.

The buffer itself is allocated as a result of a call to this function. If the function has previously been called, any existing buffer is freed and any information in it is lost.

Notes:

This function must be called before attempting to add any objects to the buffer.

Parameters

TInt aLength

The maximum capacity of the circular buffer.

Leave codes

 

The function can leave if there is insufficient memory available to allocate the buffer.


Length()

TInt Length() const;

Description

Gets the maximum capacity of this circular buffer. The capacity is the maximum number of elements that the buffer can hold.

Use CCirBufBase::SetLengthL() to change the capacity of the circular buffer.

Return value

TInt

The maximum capacity of this circular buffer.

[Top]


How many objects in the buffer


Count()

TInt Count() const;

Description

Gets the current number of objects in this circular buffer.

Return value

TInt

The number of objects in this circular buffer. This value can never be greater than the maximum capacity.

[Top]


Resetting the buffer


Reset()

void Reset();

Description

Empties the buffer.