Skip to content

Class jac::InputPacketCommunicator

ClassList > jac > InputPacketCommunicator

Communicator interface that can be used to receive packets.

  • #include <communicator.h>

Inherited by the following classes: jac::RouterInputPacketCommunicator

Public Functions

Type Name
InputPacketCommunicator () = default
InputPacketCommunicator (const InputPacketCommunicator &) = delete
virtual size_t available () = 0
Get the number of packets available to read.
virtual void cancelRead () = 0
Cancel any blocking read.
virtual void clear () = 0
Clear the buffer.
virtual std::optional< std::pair< int, std::vector< uint8_t > > > get () = 0
Get the next packet.
InputPacketCommunicator & operator= (const InputPacketCommunicator &) = delete
virtual ~InputPacketCommunicator () = default

Public Functions Documentation

function InputPacketCommunicator [1/2]

jac::InputPacketCommunicator::InputPacketCommunicator () = default

function InputPacketCommunicator [2/2]

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

function available

Get the number of packets available to read.

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

Returns:

The number

function cancelRead

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

function clear

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

function get

Get the next packet.

virtual std::optional< std::pair< int, std::vector< uint8_t > > > jac::InputPacketCommunicator::get () = 0

Note:

This method blocks until a packet is available.

Returns:

The packet

function operator=

InputPacketCommunicator & jac::InputPacketCommunicator::operator= (
    const InputPacketCommunicator &
) = delete

function ~InputPacketCommunicator

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

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