Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

CRingBufferReader Class Reference

#include <RingBuffer.h>

Inheritance diagram for CRingBufferReader:

CAudioRingBufferReader List of all members.

Signals

Public Member Functions


Constructor & Destructor Documentation

CRingBufferReader::CRingBufferReader CRingBuffer ring  ) 
 

Contructor.

Constructs a CRingBuffer reader, and adds it to the pool of readers. Initially, our 'buffer' will be empty; we will only see data that is written to the ringbuffer after we are attached.

CRingBufferReader::~CRingBufferReader  ) 
 

Destructor.

The destructor will automatically detach this object from the ringbuffer.


Member Function Documentation

void CRingBufferReader::BufferFlushed  )  [signal]
 

void CRingBufferReader::DataArrived int  bytes  )  [signal]
 

bool CRingBufferReader::event QEvent *  e  )  [virtual]
 

unsigned int CRingBufferReader::GetHighWaterMark  )  const
 

Reimplemented in CAudioRingBufferReader.

unsigned int CRingBufferReader::GetLowWaterMark  )  const
 

Reimplemented in CAudioRingBufferReader.

int CRingBufferReader::ReadFromBufferHead void *  data,
unsigned int  len,
bool  clear = false,
unsigned long  time = ULONG_MAX
 

Get data from head of buffer.

Parameters:
data Pointer where to store data
len Number of requested bytes
time In case buffer is empty, wait for data a maximum of time milliseconds
clear If TRUE, will reset our lengthpointer (pretend we read all)
Returns:
Number of bytes put in data pointer; may be less than len
This functions allows you to peek at the data at the head of the buffer. It will not update the lengthpointer, unless you set clear to TRUE; then it will reset our reader-buffer (this does not affect other readers).

int CRingBufferReader::ReadFromBufferTail void *  data,
unsigned int  len
 

Get data from tail of buffer.

Parameters:
data Pointer where to store data
len Number of requested bytes
Returns:
Number of bytes put in data pointer; may be less than len
This function reads data from the tail of the buffer. It updates our tailpointer (CRingBuffer will check the tailpointers during a write, to see how much data is still in use).

void CRingBufferReader::SetHighWaterMark unsigned  int  ) 
 

void CRingBufferReader::SetLowWaterMark unsigned int  mark  ) 
 

Set reader low water mark.

Parameters:
mark The new water mark; -1 disables the mark.
A 'low water mark' is used in a buffer to indicate a minimum fill before action is/should be taken; it is often used in combination with a high water mark. It prevents things like the 'silly buffer syndrome' or nefarious polling on the buffer.

Basicly, the low and high water marks specify the preferred minimum and maximum fill of the buffer; you expect the buffer to have at least low mark, but not more than high mark bytes of data in it; however, the buffer may still drain completely or fill up. But usually action is taken when the low or high water mark is crossed.

int CRingBufferReader::SpaceUsed  )  const
 


The documentation for this class was generated from the following files:
Generated on Wed Dec 13 23:38:47 2006 for CamStream by doxygen 1.3.7