MySQL 8.0.39
Source Code Documentation
binary_log::codecs::Codec Class Referenceabstract

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

#include <base.h>

Inheritance diagram for binary_log::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 binary_log::codecs::Codec::~Codec ( )
virtualdefault

Member Function Documentation

◆ decode()

virtual std::pair< std::size_t, bool > binary_log::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 binary_log::codecs::binary::Transaction_payload, binary_log::codecs::binary::Heartbeat, and binary_log::codecs::binary::Base_codec.

◆ encode()

virtual std::pair< std::size_t, bool > binary_log::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 binary_log::codecs::binary::Transaction_payload, binary_log::codecs::binary::Heartbeat, and binary_log::codecs::binary::Base_codec.


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