24#ifndef LIBBINLOGEVENTS_COMPRESSION_COMPRESSOR_H_INCLUDED
25#define LIBBINLOGEVENTS_COMPRESSION_COMPRESSOR_H_INCLUDED
85 std::numeric_limits<Size_t>::max();
124 template <
class Input_
char_t>
125 void feed(
const Input_char_t *input_data,
Size_t input_size) {
Abstract base class for compressors.
Definition: compressor.h:78
void feed(const Input_char_t *input_data, Size_t input_size)
Submit data to be compressed.
Definition: compressor.h:125
virtual Grow_constraint_t do_get_grow_constraint_hint() const
Implement get_grow_constraint_hint.
Definition: compressor.cpp:75
Grow_constraint_t get_grow_constraint_hint() const
Return a Grow_constraint that may be used with the Managed_buffer_sequence storing the output,...
Definition: compressor.cpp:71
void set_pledged_input_size(Size_t size)
Declare that the input size will be exactly as given.
Definition: compressor.cpp:79
bool m_empty
True when user has not provided any input since the last reset.
Definition: compressor.h:259
virtual Compress_status do_finish(Managed_buffer_sequence_t &out)=0
Implement finish.
Size_t m_pledged_input_size
The number of bytes.
Definition: compressor.h:262
Compressor(Compressor &&other)=delete
virtual type do_get_type_code() const =0
implement get_type_code.
Managed_buffer_sequence_t::Size_t Size_t
Definition: compressor.h:82
virtual void do_set_pledged_input_size(Size_t size)
Implement set_pledged_input_size.
Definition: compressor.cpp:89
void reset()
Reset the frame.
Definition: compressor.cpp:30
mysqlns::buffer::Grow_constraint Grow_constraint_t
Definition: compressor.h:83
Compress_status compress(Managed_buffer_sequence_t &out)
Consume all input previously given in the feed function.
Definition: compressor.cpp:47
virtual Compress_status do_compress(Managed_buffer_sequence_t &out)=0
Implement compress.
Compress_status finish(Managed_buffer_sequence_t &out)
Consume all input, produce all output, and end the frame.
Definition: compressor.cpp:56
virtual ~Compressor()=default
mysqlns::buffer::Managed_buffer_sequence<> Managed_buffer_sequence_t
Definition: compressor.h:80
bool m_pending_input
True when user has provided input that has not yet been consumed.
Definition: compressor.h:256
Compressor & operator=(Compressor &&other)=delete
static constexpr Size_t pledged_input_size_unset
Definition: compressor.h:84
virtual void do_feed(const Char_t *input_data, Size_t input_size)=0
Implement feed.
type get_type_code() const
Definition: compressor.cpp:28
Compressor(const Compressor &other)=delete
Compressor & operator=(const Compressor &other)=delete
void feed_char_t(const Char_t *input_data, Size_t input_size)
Worker function for feed, requiring the correct Char_t type.
Definition: compressor.cpp:38
Size_t get_pledged_input_size() const
Return the size previously provided to set_pledged_input_size, or pledged_input_size_unset if no pled...
Definition: compressor.cpp:85
virtual void do_reset()=0
Implement reset.
Managed_buffer_sequence_t::Char_t Char_t
Definition: compressor.h:81
Description of a heuristic to determine how much memory to allocate.
Definition: grow_constraint.h:67
Owned, non-contiguous, growable memory buffer.
Definition: managed_buffer_sequence.h:114
typename Buffer_sequence_view_t::Char_t Char_t
Definition: rw_buffer_sequence.h:109
typename Buffer_sequence_view_t::Size_t Size_t
Definition: rw_buffer_sequence.h:110
Container class that provides a sequence of buffers to the caller.
type
Definition: base.h:33
Grow_status
Error statuses for classes that use Grow_calculator.
Definition: grow_status.h:37
#define NODISCARD
The function attribute [[NODISCARD]] is a replacement for [[nodiscard]] to workaround a gcc bug.
Definition: nodiscard.h:47