StreamZip

The StreamZip class provides a payload compression engine for Rogue Frames. This module will receive Frames from an external master, compress the Frame payload and then pass the compressed frame to a downstream Slave.

This compression module uses the Bzip2 library.

Python binding

This C++ class is also exported into Python as rogue.utilities.StreamZip.

Python API page: - StreamZip

StreamZip objects in C++ are referenced by the following shared pointer typedef:

typedef std::shared_ptr<rogue::utilities::StreamZip> rogue::utilities::StreamZipPtr
[header]

The class description is shown below:

class StreamZip : public rogue::interfaces::stream::Slave, public rogue::interfaces::stream::Master
[header]

Stream module that compresses frame payloads using bzip2.

StreamZip consumes frames on its slave side, compresses the payload bytes, and forwards a new frame downstream from its master side. Frame metadata (channel, flags, error state) is preserved.

Output frame allocation is requested via reqFrame(). The implementation starts with an output frame sized to the input payload and grows it if needed.

Threading model:

  • StreamZip does not create an internal worker thread.

  • Compression runs synchronously in the caller thread that invokes acceptFrame().

  • A lock is taken on the input frame while payload buffers are read, so the frame contents are stable during compression.

Public Functions

StreamZip()
[header] [impl]

Constructs a stream compressor.

Creator with width and variable taps.

This constructor is a low-level C++ allocation path. Prefer create() when shared ownership or Python exposure is required.

~StreamZip()
[header] [impl]

Destroys stream compressor.

Deconstructor.

virtual void acceptFrame(std::shared_ptr<rogue::interfaces::stream::Frame> frame)
[header] [impl]

Accepts a frame, compresses its payload, and forwards the result.

Accept a frame from master.

Parameters:

frame – Input frame to compress.

virtual std::shared_ptr<rogue::interfaces::stream::Frame> acceptReq(uint32_t size, bool zeroCopyEn)
[header] [impl]

Forwards frame-allocation requests upstream.

Accept a new frame request. Forward request.

Parameters:
  • size – Requested payload size in bytes.

  • zeroCopyEntrue to request zero-copy buffer handling.

Returns:

Allocated frame from upstream master path.

Public Static Functions

static std::shared_ptr<rogue::utilities::StreamZip> create()
[header] [impl]

Creates a stream compressor instance.

Class creation.

This static factory is the preferred construction path when the object is shared across Rogue graph connections or exposed to Python. It returns std::shared_ptr ownership compatible with Rogue pointer typedefs.

Company : SLAC National Accelerator Laboratory

Description : Stream modules to compress a data stream

This file is part of the rogue software platform. It is subject to the license terms in the LICENSE.txt file found in the top-level directory of this distribution and at: https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html. No part of the rogue software platform, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the LICENSE.txt file.

Returns:

Shared pointer to the created compressor.

static void setup_python()
[header] [impl]

Registers Python bindings for this class.