![]() |
MySQL 8.0.33
Source Code Documentation
|
The base compressor abstract class. More...
#include <compressor.h>
Public Member Functions | |
virtual void | set_compression_level (unsigned int compression_level)=0 |
Sets the compression level for this compressor. More... | |
virtual std::tuple< std::size_t, bool > | compress (const unsigned char *data, size_t length)=0 |
This member function SHALL compress the data provided with the given length. More... | |
![]() | |
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 | |
![]() | |
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... | |
The base compressor abstract class.
It establishes the interface for compressors.
|
pure virtual |
This member function SHALL compress 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.
data | the data to compress |
length | the length of the data. |
Implemented in binary_log::transaction::compression::None_comp, and binary_log::transaction::compression::Zstd_comp.
|
pure virtual |
Sets the compression level for this compressor.
It is only effective if done before opening the compressor. After opening the compressor setting the compression level, it is only effective when the compressor is closed and opened again.
compression_level | the compression level for this compressor. |
Implemented in binary_log::transaction::compression::None_comp, and binary_log::transaction::compression::Zstd_comp.