Original Symbian headers
Selected EUSER, Window Server, networking, graphics and device declarations
Loading...
Searching...
No Matches
CCirBufBase Class Reference

Base class for circular buffers. More...

#include <e32base.h>

Inheritance diagram for CCirBufBase:
CBase CCirBuf< TUint8 > CCirBuf< T > CCirBuffer

Public Member Functions

IMPORT_C ~CCirBufBase ()
 Destructor.
 
TInt Count () const
 Gets the current number of objects in this circular buffer.
 
TInt Length () const
 Gets the maximum capacity of this circular buffer.
 
IMPORT_C void SetLengthL (TInt aLength)
 Sets the maximum capacity of this circular buffer, and resets all of the buffer pointers.
 
IMPORT_C void Reset ()
 Empties the buffer.
 
- Public Member Functions inherited from CBase
 CBase ()
 Default constructor.
 
virtual IMPORT_C ~CBase ()
 Virtual destructor.
 
TAny * operator new (TUint aSize, TAny *aBase) __NO_THROW
 Initialises the object to binary zeroes.
 
TAny * operator new (TUint aSize) __NO_THROW
 Allocates the object from the heap and then initialises its contents to binary zeroes.
 
TAny * operator new (TUint aSize, TLeave)
 Allocates the object from the heap and then initialises its contents to binary zeroes.
 
TAny * operator new (TUint aSize, TUint aExtraSize) __NO_THROW
 Allocates the object from the heap and then initialises its contents to binary zeroes.
 
TAny * operator new (TUint aSize, TLeave, TUint aExtraSize)
 Allocates the object from the heap and then initialises its contents to binary zeroes.
 

Protected Member Functions

IMPORT_C CCirBufBase (TInt aSize)
 Constructor taking the size of an object within the buffer.
 
IMPORT_C TInt DoAdd (const TUint8 *aPtr)
 Implementation function for CCirBuf::Add(const T*)
 
IMPORT_C TInt DoAdd (const TUint8 *aPtr, TInt aCount)
 Implementation function for CCirBuf::Add(const T*,TInt)
 
IMPORT_C TInt DoRemove (TUint8 *aPtr)
 Implementation function for CCirBuf::Remove(T*)
 
IMPORT_C TInt DoRemove (TUint8 *aPtr, TInt aCount)
 Implementation function for CCirBuf::Remove(T*,TInt)
 
- Protected Member Functions inherited from CBase
virtual IMPORT_C TInt Extension_ (TUint aExtensionId, TAny *&a0, TAny *a1)
 Extension function.
 

Protected Attributes

TInt iCount
 
TInt iSize
 
TInt iLength
 
TUint8 * iPtr
 
TUint8 * iPtrE
 
TUint8 * iHead
 
TUint8 * iTail
 

Additional Inherited Members

- Static Public Member Functions inherited from CBase
static IMPORT_C void Delete (CBase *aPtr)
 Deletes the specified object.
 

Detailed Description

Base class for circular buffers.

The class is part of the implementation of circular buffers and is never instantiated.

The class provides member functions that form part of the interface.

API status
Published to all clients. Released API.

Definition at line 1537 of file e32base.h.

Constructor & Destructor Documentation

◆ ~CCirBufBase()

IMPORT_C CCirBufBase::~CCirBufBase ( )

Destructor.

This frees the memory allocated to the buffer.

(generated from Symbian Developer Library)

◆ CCirBufBase()

IMPORT_C CCirBufBase::CCirBufBase ( TInt  aSize)
protected

Constructor taking the size of an object within the buffer.

Parameters
aSizeThe size of an object in the buffer.

Panic condition: E32USER-CBase 72, if aSize is zero or negative.

(generated from Symbian Developer Library)

Member Function Documentation

◆ Count()

TInt CCirBufBase::Count ( ) const
inline

Gets the current number of objects in this circular buffer.

(generated from Symbian Developer Library)

◆ DoAdd() [1/2]

IMPORT_C TInt CCirBufBase::DoAdd ( const TUint8 *  aPtr)
protected

Implementation function for CCirBuf::Add(const T*)

Adds a single object to the circular buffer, but only if there is space available.

Parameters
aPtrA pointer to the object to be added.

Panic condition: E32USER-CBase 74, if a call to CCirBufBase::SetLengthL() has not been made before calling this function.

(generated from Symbian Developer Library)

◆ DoAdd() [2/2]

IMPORT_C TInt CCirBufBase::DoAdd ( const TUint8 *  aPtr,
TInt  aCount 
)
protected

Implementation function for CCirBuf::Add(const T*,TInt)

Adds multiple objects to the circular buffer, but only if there is space available.

Parameters
aPtrA pointer to a set of contiguous objects to be added.
aCountThe number of objects to be added.

Panic condition: E32USER-CBase 74, if a call to CCirBufBase::SetLengthL() has not been made before calling this function.

Panic condition: E32USER-CBase 75, if aCount is not a positive value.

(generated from Symbian Developer Library)

◆ DoRemove() [1/2]

IMPORT_C TInt CCirBufBase::DoRemove ( TUint8 *  aPtr)
protected

Implementation function for CCirBuf::Remove(T*)

Removes a single object from the circular buffer, but only if there are objects in the buffer.

A binary copy of the object is made to aPtr.

CCirBuf::Remove

Parameters
aPtrA pointer to a location supplied by the caller.

(generated from Symbian Developer Library)

◆ DoRemove() [2/2]

IMPORT_C TInt CCirBufBase::DoRemove ( TUint8 *  aPtr,
TInt  aCount 
)
protected

Implementation function for CCirBuf::Remove(T*,TInt)

Attempts to remove aCount objects from the circular buffer, but only if there are objects in the buffer.

A binary copy of the objects is made to aPtr.

Parameters
aPtrA pointer to a location supplied by the caller capable of holding aCount objects.
aCountThe number of objects to be removed from the circular buffer.

Panic condition: E32USER-CBase 76, if aCount is not a positive value.

(generated from Symbian Developer Library)

◆ Length()

TInt CCirBufBase::Length ( ) const
inline

Gets the maximum capacity of this circular buffer.

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

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

CCirBufBase::SetLengthL

(generated from Symbian Developer Library)

◆ Reset()

IMPORT_C void CCirBufBase::Reset ( )

Empties the buffer.

(generated from Symbian Developer Library)

◆ SetLengthL()

IMPORT_C void CCirBufBase::SetLengthL ( TInt  aLength)

Sets the maximum capacity of this circular buffer, and resets all of the buffer pointers.

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, then any existing buffer is freed and any information in it is lost.

Notes:

  1. This function must be called before attempting to add any objects to the buffer.
  2. The function can leave if there is insufficient memory available to allocate the buffer.
Parameters
aLengthThe maximum capacity of the circular buffer.

Panic condition: E32USER-CBase 73, if aLength is zero or negative.

(generated from Symbian Developer Library)

Member Data Documentation

◆ iCount

TInt CCirBufBase::iCount
protected

Definition at line 1565 of file e32base.h.

◆ iHead

TUint8* CCirBufBase::iHead
protected

Definition at line 1570 of file e32base.h.

◆ iLength

TInt CCirBufBase::iLength
protected

Definition at line 1567 of file e32base.h.

◆ iPtr

TUint8* CCirBufBase::iPtr
protected

Definition at line 1568 of file e32base.h.

◆ iPtrE

TUint8* CCirBufBase::iPtrE
protected

Definition at line 1569 of file e32base.h.

◆ iSize

TInt CCirBufBase::iSize
protected

Definition at line 1566 of file e32base.h.

◆ iTail

TUint8* CCirBufBase::iTail
protected

Definition at line 1571 of file e32base.h.


The documentation for this class was generated from the following files: