#include <AERingBuffer.h>
This buffer can be used by one read and one write thread at any one time without the risk of data corruption. If you intend to call the Reset() method, please use Locks. All other operations are thread-safe.
◆ AERingBuffer() [1/2]
AERingBuffer::AERingBuffer |
( |
| ) |
|
|
inline |
◆ AERingBuffer() [2/2]
AERingBuffer::AERingBuffer |
( |
unsigned int |
size, |
|
|
unsigned int |
planes = 1 |
|
) |
| |
|
inline |
◆ ~AERingBuffer()
AERingBuffer::~AERingBuffer |
( |
| ) |
|
|
inline |
◆ Create()
bool AERingBuffer::Create |
( |
int |
size, |
|
|
unsigned int |
planes = 1 |
|
) |
| |
|
inline |
Allocates space for buffer, and sets it's contents to 0.
- Returns
- true on success, false otherwise
◆ Dump()
void AERingBuffer::Dump |
( |
| ) |
|
|
inline |
◆ GetMaxSize()
unsigned int AERingBuffer::GetMaxSize |
( |
| ) |
|
|
inline |
◆ GetReadSize()
unsigned int AERingBuffer::GetReadSize |
( |
| ) |
|
|
inline |
Returns available space for reading from buffer. Attempt to read more bytes than available results in AE_RING_BUFFER_EMPTY.
◆ GetWriteSize()
unsigned int AERingBuffer::GetWriteSize |
( |
| ) |
|
|
inline |
Returns available space for writing to buffer. Attempt to write more bytes than available results in AE_RING_BUFFER_FULL.
◆ NumPlanes()
unsigned int AERingBuffer::NumPlanes |
( |
| ) |
const |
|
inline |
Returns the number of planes
◆ Read()
int AERingBuffer::Read |
( |
unsigned char * |
dest, |
|
|
unsigned int |
size, |
|
|
unsigned int |
plane = 0 |
|
) |
| |
|
inline |
Reads data from buffer. Attempt to read more bytes than available results in RING_BUFFER_NOTAVAILABLE. Reading from empty buffer returns AE_RING_BUFFER_EMPTY
- Returns
- AE_RING_BUFFER_OK on success, otherwise an error code
◆ Reset()
void AERingBuffer::Reset |
( |
| ) |
|
|
inline |
Fills the buffer with zeros and resets the pointers. This method is not thread-safe, so before using this method please acquire a Lock()
◆ Write()
int AERingBuffer::Write |
( |
unsigned char * |
src, |
|
|
unsigned int |
size, |
|
|
unsigned int |
plane = 0 |
|
) |
| |
|
inline |
Writes data to buffer. Attempt to write more bytes than available results in AE_RING_BUFFER_FULL.
- Returns
- AE_RING_BUFFER_OK on success, otherwise an error code
The documentation for this class was generated from the following file: