Original Symbian headers
Selected EUSER, Window Server, networking, graphics and device declarations
Loading...
Searching...
No Matches
CCirBuf< T > Class Template Reference

A circular buffer containing objects of a type defined by the template parameter. More...

#include <e32base.h>

Inheritance diagram for CCirBuf< T >:
CCirBufBase CBase

Public Member Functions

 CCirBuf ()
 Default C++ constructor.
 
TInt Add (const T *aPtr)
 Adds a single object to the circular buffer.
 
TInt Add (const T *aPtr, TInt aCount)
 Adds multiple objects to the circular buffer.
 
TInt Remove (T *aPtr)
 Removes a single object from the circular buffer.
 
TInt Remove (T *aPtr, TInt aCount)
 Removes multiple objects from the circular buffer.
 
- Public Member Functions inherited from CCirBufBase
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.
 

Additional Inherited Members

- Static Public Member Functions inherited from CBase
static IMPORT_C void Delete (CBase *aPtr)
 Deletes the specified object.
 
- Protected Member Functions inherited from CCirBufBase
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 inherited from CCirBufBase
TInt iCount
 
TInt iSize
 
TInt iLength
 
TUint8 * iPtr
 
TUint8 * iPtrE
 
TUint8 * iHead
 
TUint8 * iTail
 

Detailed Description

template<class T>
class CCirBuf< T >

A circular buffer containing objects of a type defined by the template parameter.

API status
Published to all clients. Released API.

Definition at line 1578 of file e32base.h.

Constructor & Destructor Documentation

◆ CCirBuf()

template<class T >
CCirBuf< T >::CCirBuf ( )
inline

Default C++ constructor.

The size of each object in the buffer is fixed and is the length of the class passed as the template parameter.

Panic condition: E32USER-CBase 72, if the length of the template class is zero.

(generated from Symbian Developer Library)

Member Function Documentation

◆ Add() [1/2]

template<class T >
TInt CCirBuf< T >::Add ( const T *  aPtr)
inline

Adds a single object to the circular buffer.

The object is of type class T and is only added if there is space available.

Parameters
aPtrA pointer to the object of type class T to be added to the circular buffer.

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

(generated from Symbian Developer Library)

◆ Add() [2/2]

template<class T >
TInt CCirBuf< T >::Add ( const T *  aPtr,
TInt  aCount 
)
inline

Adds multiple objects to the circular buffer.

The function attempts to add aCount objects of type class T. The objects are only added if there is space available.

Parameters
aPtrA pointer to a set of contiguous objects of type class T to be added to the circular buffer.
aCountThe number of objects to be added to the circular buffer.

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)

◆ Remove() [1/2]

template<class T >
TInt CCirBuf< T >::Remove ( T *  aPtr)
inline

Removes a single object from the circular buffer.

An object can only be removed if there are objects in the buffer.

A binary copy of the object is made to aPtr.

Parameters
aPtrA pointer to an object of type class T supplied by the caller.

(generated from Symbian Developer Library)

◆ Remove() [2/2]

template<class T >
TInt CCirBuf< T >::Remove ( T *  aPtr,
TInt  aCount 
)
inline

Removes multiple objects from the circular buffer.

The function attempts to remove aCount objects of type class T. Objects can only be removed if there are objects in the buffer

A binary copy of the objects is made to aPtr.

Parameters
aPtrA pointer to contiguous memory able to hold aCount class T objects, supplied by the caller.
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)


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