MySQL  8.0.22
Source Code Documentation
binary_log::transaction::compression::Decompressor Class Referenceabstract

The base decompressor abstract class. More...

#include <base.h>

Inheritance diagram for binary_log::transaction::compression::Decompressor:
binary_log::transaction::compression::Base_compressor_decompressor binary_log::transaction::compression::None_dec binary_log::transaction::compression::Zstd_dec

Public Member Functions

virtual std::tuple< std::size_t, booldecompress (const unsigned char *data, size_t length)=0
 This member function SHALL decompress the data provided with the given length. More...
- Public Member Functions inherited from binary_log::transaction::compression::Base_compressor_decompressor
 Base_compressor_decompressor ()
virtual ~Base_compressor_decompressor ()
virtual type compression_type_code ()=0
 The compression algorithm type. More...
virtual bool open ()=0
 This member function SHALL open the compressor or decompressor. More...
virtual bool close ()=0
 This member function SHALL close the compressor/decompressor. More...
virtual size_t size ()
 This member function returns the size of the compressed/decompressed data. More...
virtual std::size_t capacity ()
 This member function returns the capacity of the buffer. More...
virtual bool set_buffer (unsigned char *buffer, std::size_t capacity)
 This member function SHALL set the buffer into which the compressor or decompressor shall write the data after it processes the stream. More...
virtual std::tuple< unsigned char *, std::size_t, std::size_t > get_buffer ()
 This member function SHALL return the buffer, the size of its data and its capacity. More...
virtual bool reserve (std::size_t bytes)
 This member function expands the buffer by a number of bytes. More...

Additional Inherited Members

- Protected Attributes inherited from binary_log::transaction::compression::Base_compressor_decompressor
unsigned char * m_buffer {nullptr}
 The pointer to the buffer holding the data to compress/decompress. More...
std::size_t m_buffer_capacity {0}
 The buffer capacity. More...
unsigned char * m_buffer_cursor {nullptr}
 A cursor over the buffer. More...

Detailed Description

The base decompressor abstract class.

It establishes the interface for decompressors.

Member Function Documentation

◆ decompress()

virtual std::tuple<std::size_t, bool> binary_log::transaction::compression::Decompressor::decompress ( const unsigned char *  data,
size_t  length 
pure virtual

This member function SHALL decompress the data provided with the given length.

Note that the buffer to store the compressed data must have already have been set through set_buffer.

If the output buffer is not large enough an error shall be returned. The contents of the output buffer may still have been modified in that case.

datathe data to compress
lengththe length of the data.
a tuple containing the bytes not decompressed and an error state. If all bytes were decompressed, then it is returned 0 in the first element and false in the second. If not all bytes were decompressed, it returns the number of remaining bytes not processed and false on the second element. If there was an error, then the second element returns true and the first elemement returns the number of bytes processed until the error happened.

Implemented in binary_log::transaction::compression::Zstd_dec, and binary_log::transaction::compression::None_dec.

The documentation for this class was generated from the following file: