Skip to content

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]

jac::InputStreamCommunicator::InputStreamCommunicator () = default

function InputStreamCommunicator [2/2]

jac::InputStreamCommunicator::InputStreamCommunicator (
    const InputStreamCommunicator &
) = delete

function available

Get the number of bytes available to read.

virtual size_t jac::InputStreamCommunicator::available () = 0

Returns:

The number

function cancelRead

virtual void jac::InputStreamCommunicator::cancelRead () = 0

function clear

virtual void jac::InputStreamCommunicator::clear () = 0

function filter

Set filter to only receive data from the given data links. Empty links for any.

virtual void jac::InputStreamCommunicator::filter (
    std::set< int > links
) = 0

Parameters:

  • links the data link ids

function get

Get a single byte from the stream.

virtual int jac::InputStreamCommunicator::get () = 0

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.

virtual size_t jac::InputStreamCommunicator::read (
    std::span< uint8_t > data
) = 0

Note:

This method blocks until data is available.

Parameters:

  • data the buffer to read into

Returns:

The number of bytes read

function ~InputStreamCommunicator

virtual jac::InputStreamCommunicator::~InputStreamCommunicator () = default

The documentation for this class was generated from the following file src/jac/link/communicator.h