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 unsigned long numBytesAvail ()
 Returns how many bytes are available in the buffer.
virtual unsigned long read (unsigned char *outData, unsigned long inBytesToRead, bool inAllowShortRead=false)
 Read bytes from the internal buffer. Returns how many actually read.
virtual void reset ()
 Resets the buffer.
virtual unsigned long spaceLeft ()
 Returns how much space is left in the buffer.
virtual unsigned long write (const unsigned char *inData, unsigned long inBytesToWrite)
 Write bytes into the internal buffer. Returns how many written.
virtual ~CircularBuffer (void)

Protected Member Functions

void bufASSERT (bool inBool)

Protected Attributes

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

Private Member Functions

 CircularBuffer (const CircularBuffer &other)
CircularBufferoperator= (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 173 of file CircularBuffer.cpp.

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

Referenced by HTTPStreamingFileSource::DataProcessLoop(), HTTPStreamingFileSource::isEOF(), read(), and HTTPStreamingFileSource::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,
bool  inAllowShortRead = false
[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().

Referenced by HTTPStreamingFileSource::read().

Here is the call graph for this function:

void CircularBuffer::reset  )  [virtual]
 

Resets the buffer.

Implements IFIFOBuffer.

Definition at line 195 of file CircularBuffer.cpp.

References mReadPtr, and mWritePtr.

Referenced by HTTPStreamingFileSource::open().

unsigned long CircularBuffer::spaceLeft  )  [virtual]
 

Returns how much space is left in the buffer.

Implements IFIFOBuffer.

Definition at line 152 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 106 of file CircularBuffer.cpp.

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

Referenced by HTTPStreamingFileSource::DataProcessLoop(), and HTTPStreamingFileSource::unChunk().

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 Fri Feb 17 00:00:02 2006 for oggdsf by  doxygen 1.3.9