Deskflow 1.22.0.197
Keyboard and mouse sharing utility
|
FIFO of bytes. More...
#include <StreamBuffer.h>
Public Member Functions | |
StreamBuffer ()=default | |
~StreamBuffer ()=default | |
manipulators | |
const void * | peek (uint32_t n) |
Read data without removing from buffer. | |
void | pop (uint32_t n) |
Discard data. | |
void | write (const void *data, uint32_t n) |
Write data to buffer. |
accessors | |
uint32_t | getSize () const |
Get size of buffer. |
FIFO of bytes.
This class maintains a FIFO (first-in, last-out) buffer of bytes.
|
default |
|
default |
uint32_t StreamBuffer::getSize | ( | ) | const |
Get size of buffer.
Returns the number of bytes in the buffer.
const void * StreamBuffer::peek | ( | uint32_t | n | ) |
Read data without removing from buffer.
Return a pointer to memory with the next n
bytes in the buffer (which must be <= getSize()). The caller must not modify the returned memory nor delete it.
void StreamBuffer::pop | ( | uint32_t | n | ) |
Discard data.
Discards the next n
bytes. If n
>= getSize() then the buffer is cleared.
void StreamBuffer::write | ( | const void * | data, |
uint32_t | n ) |
Write data to buffer.
Appends n
bytes from data
to the buffer.