MySQL  8.0.22
Source Code Documentation
binary_log::transaction::compression::Zstd_dec Class Reference

This class implements a ZSTD decompressor. More...

#include <zstd.h>

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

Public Member Functions

 Zstd_dec ()
 
 ~Zstd_dec () override
 
type compression_type_code () override
 Shall return the compression type code. More...
 
bool open () override
 Shall open the decompressor. More...
 
std::tuple< std::size_t, booldecompress (const unsigned char *data, size_t length) override
 This member function shall decompress the buffer provided and put the decompressed payload into the output buffer. More...
 
bool close () override
 This member function shall close the decompressor. More...
 
- Public Member Functions inherited from binary_log::transaction::compression::Base_compressor_decompressor
 Base_compressor_decompressor ()
 
virtual ~Base_compressor_decompressor ()
 
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...
 

Protected Attributes

ZSTD_DStream * m_ctx {nullptr}
 
- 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...
 

Private Member Functions

Zstd_decoperator= (const Zstd_dec &rhs)=delete
 
 Zstd_dec (const Zstd_dec &)=delete
 

Detailed Description

This class implements a ZSTD decompressor.

Constructor & Destructor Documentation

◆ Zstd_dec() [1/2]

binary_log::transaction::compression::Zstd_dec::Zstd_dec ( const Zstd_dec )
privatedelete

◆ Zstd_dec() [2/2]

binary_log::transaction::compression::Zstd_dec::Zstd_dec ( )

◆ ~Zstd_dec()

binary_log::transaction::compression::Zstd_dec::~Zstd_dec ( )
override

Member Function Documentation

◆ close()

bool binary_log::transaction::compression::Zstd_dec::close ( )
overridevirtual

This member function shall close the decompressor.

It must be called after this decompressor is not needed anymore. It shall free the resources it has used for the decompression activities.

Returns
false on success, true otherwise.

Implements binary_log::transaction::compression::Base_compressor_decompressor.

◆ compression_type_code()

type binary_log::transaction::compression::Zstd_dec::compression_type_code ( )
overridevirtual

Shall return the compression type code.

Returns
the compression type code.

Implements binary_log::transaction::compression::Base_compressor_decompressor.

◆ decompress()

std::tuple< std::size_t, bool > binary_log::transaction::compression::Zstd_dec::decompress ( const unsigned char *  data,
size_t  length 
)
overridevirtual

This member function shall decompress the buffer provided and put the decompressed payload into the output buffer.

Parameters
dataa pointer to the buffer holding the data to decompress
lengththe size of the data to decompress.
Returns
false on success, true otherwise.

Implements binary_log::transaction::compression::Decompressor.

◆ open()

bool binary_log::transaction::compression::Zstd_dec::open ( )
overridevirtual

Shall open the decompressor.

This member function must be called before any decompression operation takes place over the buffer supplied.

Returns
false on success, true otherwise.

Implements binary_log::transaction::compression::Base_compressor_decompressor.

◆ operator=()

Zstd_dec& binary_log::transaction::compression::Zstd_dec::operator= ( const Zstd_dec rhs)
privatedelete

Member Data Documentation

◆ m_ctx

ZSTD_DStream* binary_log::transaction::compression::Zstd_dec::m_ctx {nullptr}
protected

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