class Lz4Compressor

Defined at line 22 of file ../../src/storage/volume_image/utils/lz4_compressor.h

This class provides an implementation of |Compressor| backed by LZ4 Compression algorithm.

This class is move construcable only.

Public Methods

void Lz4Compressor (const Preferences & preferences)

Defined at line 32 of file ../../src/storage/volume_image/utils/lz4_compressor.h

void Lz4Compressor (const Lz4Compressor & )

Defined at line 33 of file ../../src/storage/volume_image/utils/lz4_compressor.h

void Lz4Compressor (Lz4Compressor && )

Defined at line 34 of file ../../src/storage/volume_image/utils/lz4_compressor.h

Lz4Compressor & operator= (const Lz4Compressor & )

Defined at line 35 of file ../../src/storage/volume_image/utils/lz4_compressor.h

Lz4Compressor & operator= (Lz4Compressor && )

Defined at line 36 of file ../../src/storage/volume_image/utils/lz4_compressor.h

fpromise::result<Lz4Compressor, std::string> Create (const CompressionOptions & options)

Returns a |Lz4Compressor| on success.

On failure, returns a string describing the error.

Defined at line 62 of file ../../src/storage/volume_image/utils/lz4_compressor.cc

void Lz4Compressor ()

Defined at line 51 of file ../../src/storage/volume_image/utils/lz4_compressor.cc

void ~Lz4Compressor ()

Defined at line 55 of file ../../src/storage/volume_image/utils/lz4_compressor.cc

const Preferences & GetPreferences ()

Returns the set of preferences used for the underlying LZ4 compression.

Defined at line 63 of file ../../src/storage/volume_image/utils/lz4_compressor.h

fpromise::result<void, std::string> Prepare (Handler handler)

Returns |fpromise::ok| on success, allocating the necessary structures for repeated |Compress|

calls, and returning a buffer containing the header for the compressed data.

On failure, returns a string decribing the error condition.

Defined at line 72 of file ../../src/storage/volume_image/utils/lz4_compressor.cc

fpromise::result<void, std::string> Compress (std::span<const uint8_t> uncompressed_data)

Returns |fpromise::ok| on success, returning a buffer with the compressed data of

|uncompressed_data|. The returned buffer, is only valid until the next call to |Compress|,

since contents may be overwritten.

If the returned buffer is empty, data has been buffered, and symbols will be

emitted as next call to |Compress|, or when |Finalize| is called.

On failure, returns a string describing the error condition.

Defined at line 107 of file ../../src/storage/volume_image/utils/lz4_compressor.cc

fpromise::result<void, std::string> Finalize ()

Returns |fpromise::ok| on success, returning a buffer containing the symbols of any buffered

data not emitted on last |Compress| call, and set of symbols marking the end of the

compression. This call will free any allocated resources.

On failure, returns a string describing the error condition.

Defined at line 131 of file ../../src/storage/volume_image/utils/lz4_compressor.cc