The tcDspCircularIndex class maintains a circular index and manages the read and write pointers. More...
#include <DspCircularIndex.h>
Classes | |
class | tcCircularRead |
Public Member Functions | |
tcDspCircularIndex (void) | |
~tcDspCircularIndex (void) | |
void | SetLCKHandle (LCK_Handle aHandle) |
Provide a LCK_Handle for synchronization. | |
void | SetSize (int aSize) |
Set the maximum value of the index or size of the circular buffer. | |
int | GetSize (void) |
Get the maximum value or number of elements. | |
int | GetCount (void) |
Return the current number of entries in the queue. | |
bool | IsEmpty (void) |
Are there any entries to read? Return true if yes. | |
void | Freeze (void) |
Freeze the buffer so no more writes can happen. | |
void | Thaw (void) |
Thaw the buffer, i.e. let more writes happen. | |
void | Reset (void) |
Reset (and empty) the buffer. | |
void | Empty (void) |
Just empty the buffer. | |
int | GetWrite (void) |
Get the next index to write to (returns tcDspCircularIndex::mnEndOfBuffer if full). | |
void | IncrementWrite (void) |
Bump the write index to the next entry. | |
Static Public Attributes | |
static const int | mnEndOfBuffer = -1 |
end of buffer indicator | |
Friends | |
class | tcCircularRead |
The tcDspCircularIndex class maintains a circular index and manages the read and write pointers.
The circular buffer associated with the index can contain any kind of object.
There is always one empty entry in the buffer. The write index points to the next entry to be written. The read pointer points to the first valid entry to read. If the read pointer is the same as the write pointer, then the buffer is empty.
tcDspCircularIndex::tcDspCircularIndex | ( | void | ) |
MityDSP::tcDspCircularIndex::~tcDspCircularIndex | ( | void | ) | [inline] |
void MityDSP::tcDspCircularIndex::SetLCKHandle | ( | LCK_Handle | aHandle | ) | [inline] |
Provide a LCK_Handle for synchronization.
void tcDspCircularIndex::SetSize | ( | int | aSize | ) |
Set the maximum value of the index or size of the circular buffer.
int tcDspCircularIndex::GetSize | ( | void | ) |
Get the maximum value or number of elements.
int tcDspCircularIndex::GetCount | ( | void | ) |
Return the current number of entries in the queue.
bool tcDspCircularIndex::IsEmpty | ( | void | ) |
Are there any entries to read? Return true if yes.
void tcDspCircularIndex::Freeze | ( | void | ) |
Freeze the buffer so no more writes can happen.
void tcDspCircularIndex::Thaw | ( | void | ) |
Thaw the buffer, i.e. let more writes happen.
void tcDspCircularIndex::Reset | ( | void | ) |
Reset (and empty) the buffer.
void tcDspCircularIndex::Empty | ( | void | ) |
Just empty the buffer.
int tcDspCircularIndex::GetWrite | ( | void | ) |
Get the next index to write to (returns tcDspCircularIndex::mnEndOfBuffer if full).
void tcDspCircularIndex::IncrementWrite | ( | void | ) |
Bump the write index to the next entry.
friend class tcCircularRead [friend] |
const int MityDSP::tcDspCircularIndex::mnEndOfBuffer = -1 [static] |
end of buffer indicator