MySQL 8.4.2
Source Code Documentation
mysql::binlog::event::codecs::Codec Class Referenceabstract

This is the abstract and base class for binary log codecs. More...

#include <base.h>

Inheritance diagram for mysql::binlog::event::codecs::Codec:
[legend]

Public Member Functions

virtual std::pair< std::size_t, bool > decode (const unsigned char *from, std::size_t size, Binary_log_event &to) const =0
 Member function that shall decode the contents of the given buffer into a binary log event. More...
 
virtual std::pair< std::size_t, bool > encode (const Binary_log_event &from, unsigned char *to, std::size_t size) const =0
 Member function that shall encode the contents of the given binary log event into an in memory buffer. More...
 
virtual ~Codec ()=default
 

Detailed Description

This is the abstract and base class for binary log codecs.

It defines the codec API. Implementations of this class must be stateless.

Constructor & Destructor Documentation

◆ ~Codec()

virtual mysql::binlog::event::codecs::Codec::~Codec ( )
virtualdefault

Member Function Documentation

◆ decode()

virtual std::pair< std::size_t, bool > mysql::binlog::event::codecs::Codec::decode ( const unsigned char *  from,
std::size_t  size,
Binary_log_event to 
) const
pure virtual

Member function that shall decode the contents of the given buffer into a binary log event.

Parameters
fromthe buffer containing the encoded event.
sizethe length of the data in the buffer.
tothe binary log event to populate.
Returns
a pair containing the amount of bytes decoded from the buffer and a boolean stating whether there was an error or not. False if no error, true otherwise.

Implemented in mysql::binlog::event::codecs::binary::Transaction_payload, mysql::binlog::event::codecs::binary::Heartbeat, and mysql::binlog::event::codecs::binary::Base_codec.

◆ encode()

virtual std::pair< std::size_t, bool > mysql::binlog::event::codecs::Codec::encode ( const Binary_log_event from,
unsigned char *  to,
std::size_t  size 
) const
pure virtual

Member function that shall encode the contents of the given binary log event into an in memory buffer.

Parameters
fromthe binary log event to encode.
tothe buffer where the encoded event should be saved into.
sizethe size of the buffer.
Returns
a pair containing the amount of bytes encoded and whether there was an error or not. False if no error, true otherwise.

Implemented in mysql::binlog::event::codecs::binary::Transaction_payload, mysql::binlog::event::codecs::binary::Heartbeat, and mysql::binlog::event::codecs::binary::Base_codec.


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