Deskflow 1.22.0.197
Keyboard and mouse sharing utility
Loading...
Searching...
No Matches
StreamBuffer Class Reference

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.

Detailed Description

FIFO of bytes.

This class maintains a FIFO (first-in, last-out) buffer of bytes.

Constructor & Destructor Documentation

◆ StreamBuffer()

StreamBuffer::StreamBuffer ( )
default

◆ ~StreamBuffer()

StreamBuffer::~StreamBuffer ( )
default

Member Function Documentation

◆ getSize()

uint32_t StreamBuffer::getSize ( ) const

Get size of buffer.

Returns the number of bytes in the buffer.

◆ peek()

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.

◆ pop()

void StreamBuffer::pop ( uint32_t n)

Discard data.

Discards the next n bytes. If n >= getSize() then the buffer is cleared.

◆ write()

void StreamBuffer::write ( const void * data,
uint32_t n )

Write data to buffer.

Appends n bytes from data to the buffer.


The documentation for this class was generated from the following files: