MySQL 8.4.0
Source Code Documentation
mysql::binlog::event::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 mysql::binlog::event::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 ()=default
 
 Base_codec (Base_codec &&) noexcept=default
 
Base_codecoperator= (Base_codec &&) noexcept=default
 
 Base_codec (const Base_codec &) noexcept=default
 
Base_codecoperator= (const Base_codec &)=default
 
 ~Base_codec () override=default
 
- Public Member Functions inherited from mysql::binlog::event::codecs::Codec
virtual ~Codec ()=default
 

Protected Member Functions

Event_readerreader ()
 

Protected Attributes

Event_readerm_reader = nullptr
 

Detailed Description

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

Constructor & Destructor Documentation

◆ Base_codec() [1/3]

mysql::binlog::event::codecs::binary::Base_codec::Base_codec ( )
default

◆ Base_codec() [2/3]

mysql::binlog::event::codecs::binary::Base_codec::Base_codec ( Base_codec &&  )
defaultnoexcept

◆ Base_codec() [3/3]

mysql::binlog::event::codecs::binary::Base_codec::Base_codec ( const Base_codec )
defaultnoexcept

◆ ~Base_codec()

mysql::binlog::event::codecs::binary::Base_codec::~Base_codec ( )
overridedefault

Member Function Documentation

◆ decode()

std::pair< std::size_t, bool > mysql::binlog::event::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 mysql::binlog::event::codecs::Codec.

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

◆ encode()

std::pair< std::size_t, bool > mysql::binlog::event::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 mysql::binlog::event::codecs::Codec.

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

◆ operator=() [1/2]

Base_codec & mysql::binlog::event::codecs::binary::Base_codec::operator= ( Base_codec &&  )
defaultnoexcept

◆ operator=() [2/2]

Base_codec & mysql::binlog::event::codecs::binary::Base_codec::operator= ( const Base_codec )
default

◆ reader()

Event_reader & mysql::binlog::event::codecs::binary::Base_codec::reader ( )
inlineprotected

Member Data Documentation

◆ m_reader

Event_reader* mysql::binlog::event::codecs::binary::Base_codec::m_reader = nullptr
protected

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