25 template <
class Type>
class BFifo {
BUInt32 BUInt
Definition: BTypes.h:33
char data[8]
Definition: BoapMc1.h:2
Error return class. This class is used to return the error status from a function....
Definition: BError.h:31
A template first in first out data buffer to store any object types.
Definition: BFifo.h:25
Type read()
Read one item.
Type * odata
FIFO memory buffer.
Definition: BFifo.h:61
Type * writeData(BUInt &num)
Returns a pointer to the data and how many can be written in a chunk.
BError resize(BUInt size)
Resize FIFO, clears it as well.
BUInt writeAvailableChunk()
How many items that can be written in a chunk.
BUInt size()
Returns fifo size.
void writeDone(BUInt num)
Indicates when write is complete.
BError rebase()
Rebases fifo so read pointer is at zero moving memory as needed.
Type readPos(BUInt pos)
Read item at given offset from current read position.
BError read(Type *data, BUInt num)
Read a set of items.
void writeBackup(BUInt num)
Backup, remove num items at end of fifo. Careful, make sure read is not already happening.
BError write(const Type *data, BUInt num)
Write a set of items. Can only write a maximum of writeAvailableChunk() to save going beyond end of F...
void writePos(BUInt pos, const Type &v)
Write item at given offset from current read position.
Type * readData(BUInt &num)
Returns a pointer to the data and how many can be read in a chunk.
BUInt osize
The size of the FIFO.
Definition: BFifo.h:60
volatile BUInt oreadPos
The read pointer.
Definition: BFifo.h:63
BUInt readAvailableChunk()
How many items are available to read in a chunk.
volatile BUInt owritePos
The write pointer.
Definition: BFifo.h:62
Type & operator[](int pos)
Direct access to read samples in buffer.
BUInt writeAvailable()
How many items that can be written.
Type * writeData()
Returns a pointer to the data.
BUInt readAvailable()
How many items are available to read.
BError write(const Type v)
Write a single item.
Type * readData()
Returns a pointer to the data.