MySQL 8.0.40
Source Code Documentation
binary_log::codecs::binary::Base_codec Class Referenceabstract

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

#include <binary.h>

Inheritance diagram for binary_log::codecs::binary::Base_codec:
[legend]

Public Member Functions

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

Protected Member Functions

Event_readerreader ()
 

Protected Attributes

Event_readerm_reader
 

Detailed Description

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

Constructor & Destructor Documentation

◆ ~Base_codec()

binary_log::codecs::binary::Base_codec::~Base_codec ( )
overridedefault

Member Function Documentation

◆ decode()

std::pair< std::size_t, bool > binary_log::codecs::binary::Base_codec::decode ( const unsigned char *  from,
std::size_t  size,
Binary_log_event to 
) const
overridepure 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.

Implements binary_log::codecs::Codec.

Implemented in binary_log::codecs::binary::Transaction_payload, and binary_log::codecs::binary::Heartbeat.

◆ encode()

std::pair< std::size_t, bool > binary_log::codecs::binary::Base_codec::encode ( const Binary_log_event from,
unsigned char *  to,
std::size_t  size 
) const
overridepure 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.

Implements binary_log::codecs::Codec.

Implemented in binary_log::codecs::binary::Transaction_payload, and binary_log::codecs::binary::Heartbeat.

◆ reader()

Event_reader & binary_log::codecs::binary::Base_codec::reader ( )
inlineprotected

Member Data Documentation

◆ m_reader

Event_reader* binary_log::codecs::binary::Base_codec::m_reader
protected

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