|
||
class CCirBufBase : public CBase;
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.
CBase
-
Base class for all classes to be instantiated on the heap.
CCirBufBase
-
Base class for circular buffers.
Defined in CCirBufBase
:
CCirBufBase(TInt)
Constructor taking the size of an object within the buffer.Count()const
Gets the current number of objects in this circular buffer.DoAdd(const TUint8 *)
Implementation function for CCirBuf::Add(const T *)
DoAdd(const TUint8 *,TInt)
Implementation function for CCirBuf::Add(const T *,TInt)
DoRemove(TUint8 *)
Implementation function for CCirBuf::Remove(T *)
DoRemove(TUint8 *,TInt)
Implementation function for CCirBuf::Remove(T *,TInt)
Length()const
Gets the maximum capacity of this circular buffer.Reset()
Empties the buffer. SetLengthL(TInt)
Sets the maximum capacity of this circular buffer, and resets all of the buffer ...iCount
iHead
iLength
iPtr
iPtrE
iSize
iTail
~CCirBufBase()
Destructor.Inherited from CBase
:
Delete(CBase *)
Deletes the specified object.Extension_(TUint,TAny *&,TAny *)
Extension function operator new(TUint)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TAny *)
Initialises the object to binary zeroes.operator new(TUint,TLeave)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TLeave,TUint)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TUint)
Allocates the object from the heap and then initialises its contents to binary z...protected: IMPORT_C CCirBufBase(TInt aSize);
Constructor taking the size of an object within the buffer.
|
|
inline TInt Count() const;
Gets the current number of objects in this circular buffer.
|
inline TInt Length() const;
Gets the maximum capacity of this circular buffer.
The capacity is the maximum number of elements that the buffer can hold.
Use CCirBufBase::SetLengthL(TInt)
to change the capacity of the circular buffer.
|
CCirBufBase::SetLengthL(TInt)
Sets the maximum capacity of this circular buffer, and resets all of the buffer ...IMPORT_C void 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.
|
|
protected: IMPORT_C TInt DoAdd(const TUint8 *aPtr);
Implementation function for CCirBuf::Add(const T *)
Adds a single object to the circular buffer, but only if there is space available.
|
|
|
CCirBuf::Add(const T *)
Adds a single object to the circular buffer.CCirBufBase::SetLengthL(TInt)
Sets the maximum capacity of this circular buffer, and resets all of the buffer ...protected: IMPORT_C TInt DoAdd(const TUint8 *aPtr, TInt aCount);
Implementation function for CCirBuf::Add(const T *,TInt)
Adds multiple objects to the circular buffer, but only if there is space available.
|
|
|
CCirBuf::Add(const T *)
Adds a single object to the circular buffer.CCirBufBase::SetLengthL(TInt)
Sets the maximum capacity of this circular buffer, and resets all of the buffer ...protected: IMPORT_C TInt DoRemove(TUint8 *aPtr);
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(T *)
Removes a single object from the circular buffer.protected: IMPORT_C TInt DoRemove(TUint8 *aPtr, TInt aCount);
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.
|
|
|
CCirBuf::Remove(T *)
Removes a single object from the circular buffer.protected: TUint8 * iTail;