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.
StreamUnZip objects in C++ are referenced by the following shared pointer typedef:
-
typedef std::shared_ptr<rogue::utilities::StreamUnZip> rogue::utilities::StreamUnZipPtr
The class description is shown below:
-
class StreamUnZip : public rogue::interfaces::stream::Slave, public rogue::interfaces::stream::Master
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()
Constructs a stream decompressor.
This constructor is a low-level C++ allocation path. Prefer
create()when shared ownership or Python exposure is required.
-
~StreamUnZip()
Destroys stream decompressor.
Accepts a compressed frame, decompresses payload, and forwards it.
- Parameters:
frame – Input compressed frame.
-
virtual std::shared_ptr<rogue::interfaces::stream::Frame> acceptReq(uint32_t size, bool zeroCopyEn)
Forwards frame-allocation requests upstream.
- 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()
Creates a stream decompressor instance.
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.- Returns:
Shared pointer to the created decompressor.
-
static void setup_python()
Registers Python bindings for this class.