Class jac::InputStream
ClassList > jac > InputStream
Interface for a binary input stream.
#include <stream.h>
Inherited by the following classes: jac::Duplex
Public Functions
Type | Name |
---|---|
virtual int | get () = 0 Get a single byte from the stream. |
virtual void | onData (std::function< void(void)>) = 0 Register a callback to be called when data is available. |
virtual size_t | read (std::span< uint8_t > data) = 0 Read data from the stream. |
virtual | ~InputStream () = default |
Public Functions Documentation
function get
Get a single byte from the stream.
Note:
This method should not block.
Returns:
The byte or -1 if no data is available
function onData
Register a callback to be called when data is available.
Note:
The callback will not be called in parallel.
Parameters:
onData
the callback
function read
Read data from the stream.
Note:
This method should not block.
Parameters:
data
the buffer to read into
Returns:
The number of bytes read
function ~InputStream
The documentation for this class was generated from the following file src/jac/link/stream.h