Logo Search packages:      
Sourcecode: qarecord version File versions  Download package

RingBuffer Class Reference

#include <ringbuffer.h>

List of all members.


Detailed Description

Thread-safe ring buffer - one thread produces and another consumes. A third thread reads maximum

Definition at line 19 of file ringbuffer.h.


Public Member Functions

unsigned char * beginRead (long &curPos, long &size, bool waitIfEmpty)
unsigned char * beginWrite (long &curPos, long &size)
void discardBuffer ()
void endRead (long curPos)
void endWrite (long curPos)
unsigned long getFillRate ()
unsigned long getFillRateMax ()
long readMax (int channelIndex)
void reset ()
 RingBuffer (long size, int channelCount, bool enable32bit)

Private Member Functions

void updateMax (long startpos, long endpos)

Private Attributes

int channels
QAtomicInt fillRate
unsigned long fillRateMax
int frameCounter
QVector< QAtomicInt > max
unsigned long readOfs
unsigned char * ringBuf
unsigned long ringBufSize
int sampleSize
QWaitCondition waitForData
QMutex waitForDataMutex
unsigned long writeOfs

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index