class Compressor

Defined at line 31 of file ../../src/storage/volume_image/utils/compressor.h

This interface represents a compressor state machine.

Prepare -> Compress -+-+-> Finalize -+-+-> End

^ ^ | |

| |+-+-+| |

|-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-|

In order to compress independent uncompressed data blocks, the user

must go through |Finalize| -> |Prepare| state transition, allowing for new,

independent data to be compressed.

In order to decompress the output of a compressor, the symbols generated

by the compressor must be fed in sequential order to the decompressor.

This class is thread-unsafe, since there might be buffered data from previous calls.

Public Methods

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

Returns |fpromise::ok| on success. Setting |handler| for consuming symbols emitted during

compression.

On failure, returns a string decribing the error condition.

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

Returns |fpromise::ok| on success.

On failure, returns a string decribing the error condition.

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

Returns |fpromise::ok| on success. At this point all remaining symbols for the compressed

representation will be emitted.

On failure, returns a string describing the error condition.

void ~Compressor ()

Defined at line 39 of file ../../src/storage/volume_image/utils/compressor.h