Go to the documentation of this file.
38 #ifndef __RINGBUFFER_H__
39 #define __RINGBUFFER_H__
41 #include <QWaitCondition>
43 #include <QMutexLocker>
130 void underrunReset();
132 void overflowReset();
134 void debugDump()
const;
138 const int mTotalSize;
147 QWaitCondition mBufferIsNotFull;
148 QWaitCondition mBufferIsNotEmpty;
149 std::atomic<uint32_t> mUnderruns;
150 std::atomic<uint32_t> mOverflows;
uint32_t overflows
Definition: RingBuffer.h:107
Definition: RingBuffer.h:105
virtual void setUnderrunReadSlot(int8_t *ptrToReadSlot)
Sets the memory in the Read Slot when uderrun occurs. By default, this sets it to 0....
Definition: RingBuffer.cpp:206
void readSlotBlocking(int8_t *ptrToReadSlot)
Read a slot from the RingBuffer into ptrToReadSlot. This method will block until there's space in the...
Definition: RingBuffer.cpp:127
qint8 int8_t
Typedef for unsigned long long int. This type is guaranteed to be 64-bit.
Definition: jacktrip_types.h:78
virtual bool getStats(IOStat *stat, bool reset)
Definition: RingBuffer.cpp:257
uint32_t underruns
Definition: RingBuffer.h:106
virtual void setMemoryInReadSlotWithLastReadSlot(int8_t *ptrToReadSlot)
Uses the last read slot to set the memory in the Read Slot.
Definition: RingBuffer.cpp:213
void insertSlotBlocking(const int8_t *ptrToSlot)
Insert a slot into the RingBuffer from ptrToSlot. This method will block until there's space in the b...
Definition: RingBuffer.cpp:105
quint32 uint32_t
Typedef for unsigned int. This type is guaranteed to be 32-bit.
Definition: jacktrip_types.h:73
void readSlotNonBlocking(int8_t *ptrToReadSlot)
Same as readSlotBlocking but non-blocking (asynchronous)
Definition: RingBuffer.cpp:177
RingBuffer(int SlotSize, int NumSlots)
The class constructor.
Definition: RingBuffer.cpp:50
virtual ~RingBuffer()
The class destructor.
Definition: RingBuffer.cpp:95
void insertSlotNonBlocking(const int8_t *ptrToSlot)
Same as insertSlotBlocking but non-blocking (asynchronous)
Definition: RingBuffer.cpp:151
Provides a ring-buffer (or circular-buffer) that can be written to and read from asynchronously (bloc...
Definition: RingBuffer.h:60