qb  2.0.0.0
C++17 Actor Framework
qb Issue Watch Star Fork Follow @isndev
Loading...
Searching...
No Matches
qb::compression::compress_provider Class Referenceabstract

Abstract interface for compression algorithm providers. More...

#include <compression.h>

Public Member Functions

virtual const std::string & algorithm () const =0
 Get the name of the compression algorithm.
virtual std::size_t compress (const uint8_t *input, std::size_t input_size, uint8_t *output, std::size_t output_size, operation_hint hint, std::size_t &input_bytes_processed, bool &done)=0
 Compress a block of data.
virtual void reset ()=0
 Reset the compressor to its initial state.
virtual ~compress_provider ()=default
 Virtual destructor.

Detailed Description

Abstract interface for compression algorithm providers.

This class defines the interface that all compression algorithm implementations must implement. It provides methods for compression operations and algorithm identification.

Member Function Documentation

◆ algorithm()

virtual const std::string & qb::compression::compress_provider::algorithm ( ) const
pure virtual

Get the name of the compression algorithm.

Returns
Reference to a string containing the algorithm name

◆ compress()

virtual std::size_t qb::compression::compress_provider::compress ( const uint8_t * input,
std::size_t input_size,
uint8_t * output,
std::size_t output_size,
operation_hint hint,
std::size_t & input_bytes_processed,
bool & done )
pure virtual

Compress a block of data.

Parameters
inputPointer to the input data to compress
input_sizeSize of the input data in bytes
outputPointer to the output buffer where compressed data will be written
output_sizeSize of the output buffer in bytes
hintHint about whether this is the last block or more blocks will follow
input_bytes_processed[out] Number of input bytes actually processed
done[out] Flag indicating whether compression is complete
Returns
Number of bytes written to the output buffer

◆ reset()

virtual void qb::compression::compress_provider::reset ( )
pure virtual

Reset the compressor to its initial state.

This method should reset any internal state of the compressor, allowing it to be reused for a new compression stream.