In-process transport

See the Python documentation for an overview of the in-process transport.

class spead2::inproc_queue

Queue for packets being passed within the process.

While the data members are public, this is only to allow the send and receive code (and unit tests) to access the data. Users are advised to treat the data members as opaque.

Public Functions

void add_packet(packet &&pkt)

Add a packet directly to the queue.

void stop()

Indicate end-of-stream to receivers.

It is an error to add any more packets after this.

Sending

class spead2::send::inproc_stream : public spead2::send::stream

Public Functions

inproc_stream(io_service_ref io_service, const std::vector<std::shared_ptr<inproc_queue>> &queues, const stream_config &config = stream_config())

Constructor.

inproc_stream(io_service_ref io_service, std::shared_ptr<inproc_queue> queue, const stream_config &config = stream_config())

Backwards-compatibility constructor (taking only a single queue)

const std::shared_ptr<inproc_queue> &get_queue() const

Get the underlying storage queue (backwards compatibility).

Throws

runtime_error – if there are multiple storage queues.

Receiving

class spead2::recv::inproc_reader : public spead2::recv::reader

Stream reader that receives packets from an inproc_queue.

Public Functions

inproc_reader(stream &owner, std::shared_ptr<inproc_queue> queue)

Constructor.