Skip to content

Class jac::RouterInputStreamCommunicator

ClassList > jac > RouterInputStreamCommunicator

Inherits the following classes: jac::InputStreamCommunicator, jac::Consumer

Public Functions

Type Name
RouterInputStreamCommunicator (std::set< int > links)
virtual size_t available () override
Get the number of bytes available to read.
virtual void cancelRead () override
Cancel any blocking read.
virtual void clear () override
Clear the buffer.
virtual void filter (std::set< int > links) override
Set filter to only receive data from the given data links. Empty links for any.
virtual int get () override
Get a single byte from the stream.
virtual void processPacket (int linkId, std::span< const uint8_t > data) override
virtual size_t read (std::span< uint8_t > data) override
Read data from the stream.

Public Functions inherited from jac::InputStreamCommunicator

See jac::InputStreamCommunicator

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 inherited from jac::Consumer

See jac::Consumer

Type Name
Consumer () = default
Consumer (const Consumer &) = delete
Consumer (Consumer &&) = delete
Consumer & operator= (const Consumer &) = delete
Consumer & operator= (Consumer &&) = delete
virtual void processPacket (int linkId, std::span< const uint8_t > data) = 0
virtual ~Consumer () = default

Public Functions Documentation

function RouterInputStreamCommunicator

inline jac::RouterInputStreamCommunicator::RouterInputStreamCommunicator (
    std::set< int > links
) 

function available

Get the number of bytes available to read.

inline virtual size_t jac::RouterInputStreamCommunicator::available () override

Returns:

The number

Implements jac::InputStreamCommunicator::available

function cancelRead

inline virtual void jac::RouterInputStreamCommunicator::cancelRead () override

Implements jac::InputStreamCommunicator::cancelRead

function clear

inline virtual void jac::RouterInputStreamCommunicator::clear () override

Implements jac::InputStreamCommunicator::clear

function filter

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

inline virtual void jac::RouterInputStreamCommunicator::filter (
    std::set< int > links
) override

Parameters:

  • links the data link ids

Implements jac::InputStreamCommunicator::filter

function get

Get a single byte from the stream.

inline virtual int jac::RouterInputStreamCommunicator::get () override

Note:

This method blocks until data is available.

Returns:

the byte or -1 if no data is available

Implements jac::InputStreamCommunicator::get

function processPacket

inline virtual void jac::RouterInputStreamCommunicator::processPacket (
    int linkId,
    std::span< const uint8_t > data
) override

Implements jac::Consumer::processPacket

function read

Read data from the stream.

inline virtual size_t jac::RouterInputStreamCommunicator::read (
    std::span< uint8_t > data
) override

Note:

This method blocks until data is available.

Parameters:

  • data the buffer to read into

Returns:

The number of bytes read

Implements jac::InputStreamCommunicator::read


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