|
bool | isDataAvailableForReading () const noexcept |
|
bool | isEmpty () const noexcept |
|
uint32_t | getAvailableDataSize () const noexcept |
|
void | clearData () noexcept |
|
bool | readBool () noexcept |
|
uint8_t | readByte () noexcept |
|
int16_t | readShort () noexcept |
|
uint16_t | readUShort () noexcept |
|
int32_t | readInt () noexcept |
|
uint32_t | readUInt () noexcept |
|
int64_t | readLong () noexcept |
|
uint64_t | readULong () noexcept |
|
float | readFloat () noexcept |
|
double | readDouble () noexcept |
|
bool | readCustomData (void *const data, const uint32_t size) noexcept |
|
template<typename T > |
bool | readCustomType (T &type) noexcept |
|
bool | writeBool (const bool value) noexcept |
|
bool | writeByte (const uint8_t value) noexcept |
|
bool | writeShort (const int16_t value) noexcept |
|
bool | writeUShort (const uint16_t value) noexcept |
|
bool | writeInt (const int32_t value) noexcept |
|
bool | writeUInt (const uint32_t value) noexcept |
|
bool | writeLong (const int64_t value) noexcept |
|
bool | writeULong (const uint64_t value) noexcept |
|
bool | writeFloat (const float value) noexcept |
|
bool | writeDouble (const double value) noexcept |
|
bool | writeCustomData (const void *const data, const uint32_t size) noexcept |
|
template<typename T > |
bool | writeCustomType (const T &type) noexcept |
|
bool | commitWrite () noexcept |
|
void | setRingBuffer (BufferStruct *const ringBuf, const bool clearRingBufferData) noexcept |
|
template<class BufferStruct>
class RingBufferControl< BufferStruct >
DPF built-in RingBuffer class. RingBufferControl takes one buffer struct to take control over, and operates over it.
This is meant for single-writer, single-reader type of control. Writing and reading is wait and lock-free.
Typically usage involves:
myHeapBuffer.createBuffer(8192);
myHeapBuffer.writeUInt(size);
if (myHeapBuffer.isDataAvailableForReading())
{
uint32_t size;
if (myHeapBuffer.readUInt(size) &&
readCustomData(&anotherData, size))
{
}
}
- See also
- HeapBuffer
template<class BufferStruct >
bool RingBufferControl< BufferStruct >::readCustomData |
( |
void *const |
data, |
|
|
const uint32_t |
size |
|
) |
| |
|
inlinenoexcept |
Read an arbitrary amount of data, specified by size. data pointer must be non-null, and size > 0.
Returns true if reading succeeds. In case of failure, data pointer is automatically cleared by size bytes.