Class jac::InputStreamCommunicator
ClassList > jac > InputStreamCommunicator
Communicator interface that can be used to receive stream data.
#include <communicator.h>
Inherited by the following classes: jac::RouterInputStreamCommunicator
Public Functions
Type | Name |
---|---|
InputStreamCommunicator () = default |
|
InputStreamCommunicator (const InputStreamCommunicator &) = delete |
|
virtual size_t | available () = 0 Get the number of bytes available to read. |
virtual void | cancelRead () = 0 Cancel any blocking read. |
virtual void | clear () = 0 Clear the buffer. |
virtual void | filter (std::set< int > links) = 0 Set filter to only receive data from the given data links. Empty links for any. |
virtual int | get () = 0 Get a single byte from the stream. |
InputStreamCommunicator & | operator= (const InputStreamCommunicator &) = delete |
virtual size_t | read (std::span< uint8_t > data) = 0 Read data from the stream. |
virtual | ~InputStreamCommunicator () = default |
Public Functions Documentation
function InputStreamCommunicator [1/2]
function InputStreamCommunicator [2/2]
function available
Get the number of bytes available to read.
Returns:
The number
function cancelRead
Cancel any blocking read.
function clear
Clear the buffer.
function filter
Set filter to only receive data from the given data links. Empty links for any.
Parameters:
links
the data link ids
function get
Get a single byte from the stream.
Note:
This method blocks until data is available.
Returns:
the byte or -1 if no data is available
function operator=
InputStreamCommunicator & jac::InputStreamCommunicator::operator= (
const InputStreamCommunicator &
) = delete
function read
Read data from the stream.
Note:
This method blocks until data is available.
Parameters:
data
the buffer to read into
Returns:
The number of bytes read
function ~InputStreamCommunicator
The documentation for this class was generated from the following file src/jac/link/communicator.h