CircularBuffer Class Reference

#include <CircularBuffer.h>

Inheritance diagram for CircularBuffer:

Inheritance graph
[legend]
Collaboration diagram for CircularBuffer:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 CircularBuffer (unsigned long inBufferSize)
 Constructor taking in the size in bytes of the internal buffer.
virtual ~CircularBuffer (void)
virtual unsigned long read (unsigned char *outData, unsigned long inBytesToRead)
 Read bytes from the internal buffer. Returns how many actually read.
virtual unsigned long write (const unsigned char *inData, unsigned long inBytesToWrite)
 Write bytes into the internal buffer. Returns how many written.
virtual unsigned long numBytesAvail ()
 Returns how many bytes are available in the buffer.
virtual unsigned long spaceLeft ()
 Returns how much space is left in the buffer.
virtual void reset ()
 Resets the buffer.

Protected Member Functions

void bufASSERT (bool inBool)

Protected Attributes

unsigned long mBufferSize
unsigned long mReadPtr
unsigned long mWritePtr
unsigned char * mBuffer

Private Member Functions

CircularBufferoperator= (const CircularBuffer &other)
 CircularBuffer (const CircularBuffer &other)

Constructor & Destructor Documentation

CircularBuffer::CircularBuffer unsigned long  inBufferSize  ) 
 

Constructor taking in the size in bytes of the internal buffer.

Definition at line 36 of file CircularBuffer.cpp.

References mBuffer.

CircularBuffer::~CircularBuffer void   )  [virtual]
 

Definition at line 46 of file CircularBuffer.cpp.

CircularBuffer::CircularBuffer const CircularBuffer other  )  [private]
 


Member Function Documentation

void CircularBuffer::bufASSERT bool  inBool  )  [inline, protected]
 

Definition at line 154 of file CircularBuffer.h.

Referenced by numBytesAvail(), read(), spaceLeft(), and write().

unsigned long CircularBuffer::numBytesAvail  )  [virtual]
 

Returns how many bytes are available in the buffer.

Implements IFIFOBuffer.

Definition at line 162 of file CircularBuffer.cpp.

References bufASSERT(), mBufferSize, mReadPtr, and mWritePtr.

Referenced by read().

Here is the call graph for this function:

CircularBuffer& CircularBuffer::operator= const CircularBuffer other  )  [private]
 

unsigned long CircularBuffer::read unsigned char *  outData,
unsigned long  inBytesToRead
[virtual]
 

Read bytes from the internal buffer. Returns how many actually read.

Implements IFIFOBuffer.

Definition at line 51 of file CircularBuffer.cpp.

References bufASSERT(), mBuffer, mBufferSize, mReadPtr, numBytesAvail(), and spaceLeft().

Here is the call graph for this function:

void CircularBuffer::reset  )  [virtual]
 

Resets the buffer.

Implements IFIFOBuffer.

Definition at line 184 of file CircularBuffer.cpp.

References mReadPtr, and mWritePtr.

unsigned long CircularBuffer::spaceLeft  )  [virtual]
 

Returns how much space is left in the buffer.

Implements IFIFOBuffer.

Definition at line 141 of file CircularBuffer.cpp.

References bufASSERT(), mBufferSize, mReadPtr, and mWritePtr.

Referenced by read(), and write().

Here is the call graph for this function:

unsigned long CircularBuffer::write const unsigned char *  inData,
unsigned long  inBytesToWrite
[virtual]
 

Write bytes into the internal buffer. Returns how many written.

Implements IFIFOBuffer.

Definition at line 95 of file CircularBuffer.cpp.

References bufASSERT(), mBuffer, mBufferSize, mWritePtr, and spaceLeft().

Here is the call graph for this function:


Member Data Documentation

unsigned char* CircularBuffer::mBuffer [protected]
 

Definition at line 155 of file CircularBuffer.h.

Referenced by CircularBuffer(), read(), and write().

unsigned long CircularBuffer::mBufferSize [protected]
 

Definition at line 150 of file CircularBuffer.h.

Referenced by numBytesAvail(), read(), spaceLeft(), and write().

unsigned long CircularBuffer::mReadPtr [protected]
 

Definition at line 151 of file CircularBuffer.h.

Referenced by numBytesAvail(), read(), reset(), and spaceLeft().

unsigned long CircularBuffer::mWritePtr [protected]
 

Definition at line 152 of file CircularBuffer.h.

Referenced by numBytesAvail(), reset(), spaceLeft(), and write().


The documentation for this class was generated from the following files:
Generated on Tue Feb 15 15:02:27 2005 for oggdsf by  doxygen 1.3.9