StreamUnZip
The StreamUnZip class provides a payload decompression engine for Rogue Frames. This module will receive compressed Frames from an external master, de-compress the Frame payload and then pass the compressed frame to a downstream Slave.
This de-compression module uses the Bzip2 library.
Python binding
This C++ class is also exported into Python as rogue.utilities.StreamUnZip.
Python API page: - StreamUnZip
StreamUnZip objects in C++ are referenced by the following shared pointer typedef:
-
typedef std::shared_ptr<rogue::utilities::StreamUnZip> rogue::utilities::StreamUnZipPtr
[header]
The class description is shown below:
-
class StreamUnZip : public rogue::interfaces::stream::Slave, public rogue::interfaces::stream::Master
[header] Stream module that decompresses bzip2-compressed frame payloads.
StreamUnZipconsumes compressed frames on its slave side, inflates 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 compressed payload and grows it if the decompressed data requires additional space.Threading model:
StreamUnZipdoes not create an internal worker thread.Decompression runs synchronously in the caller thread that invokes
acceptFrame().A lock is taken on the input frame while payload buffers are read, so the compressed frame contents are stable during decompression.
Public Functions
-
StreamUnZip()
[header] [impl] Constructs a stream decompressor.
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.
Accepts a compressed frame, decompresses payload, and forwards it.
Accept a frame from master.
- Parameters:
frame – Input compressed frame.
-
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.
zeroCopyEn –
trueto request zero-copy buffer handling.
- Returns:
Allocated frame from upstream master path.
Public Static Functions
-
static std::shared_ptr<rogue::utilities::StreamUnZip> create()
[header] [impl] Creates a stream decompressor 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_ptrownership compatible with Rogue pointer typedefs.Company : SLAC National Accelerator Laboratory
Description : Stream modules to decompress 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 decompressor.