CCirBuf Class Reference

#include <e32base.h>

Link against: eposprvtyp.lib

class CCirBuf : public CCirBufBase

Inherits from

Detailed Description

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

Constructor & Destructor Documentation

CCirBuf ( )

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
E32USER-CBase 72, if the length of the template class is zero.

Member Function Documentation

Add ( const T * )

TInt 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.

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

See also: CCirBufBase::SetLengthL

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

Returns: 1 if the object is successfully added. 0 if the object cannot be added because the circular buffer is full.

Add ( const T *, TInt )

TInt Add(const T *aPtr,
TIntaCount
)[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.

panic
E32USER-CBase 74, if a call to CCirBufBase::SetLengthL() has not been made before calling this function.
panic
E32USER-CBase 75, if aCount is not a positive value.

See also: CCirBufBase::SetLengthL

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

Returns: The number of objects successfully added to the buffer. This value may be less than the number requested and can range from 0 to aCount.

Remove ( T * )

TInt 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.

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

Returns: 1 if an object is successfully removed. 0 if an object cannot be removed because the circular buffer is empty.

Remove ( T *, TInt )

TInt Remove(T *aPtr,
TIntaCount
)[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.

panic
E32USER-CBase 76, if aCount is not a positive value.
ParameterDescription
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.

Returns: The number of objects successfully removed from the buffer. This value may be less than the number requested, and can range from 0 to aCount.