29#ifndef MYSQL_BINLOG_EVENT_COMPRESSION_BUFFER_RW_BUFFER_H
30#define MYSQL_BINLOG_EVENT_COMPRESSION_BUFFER_RW_BUFFER_H
59template <
class Char_tp =
unsigned char>
126 new_position = std::min(new_position,
capacity);
147 assert(increment <= this->
capacity() - read_size);
148 auto new_position = read_size + increment;
166 assert(new_position >= 0);
Class that groups a pointer+size as one object, without managing the memory for it.
Size_t size() const
Return the number of bytes.
Definition: buffer_view.h:112
Non-owning read/write memory buffer manager with a fixed size.
Definition: rw_buffer.h:60
const Char_t * Const_iterator_t
Definition: rw_buffer.h:66
const Buffer_view_t & read_part() const
Return the read part.
Definition: rw_buffer.h:96
void increase_position(Size_t increment)
Increase the position right, relative to the currrent position.
Definition: rw_buffer.h:145
Char_tp Char_t
Definition: rw_buffer.h:62
Buffer_view_t & write_part()
Return the write part.
Definition: rw_buffer.h:105
const Buffer_view_t & write_part() const
Return the write part.
Definition: rw_buffer.h:102
std::ptrdiff_t Difference_t
Definition: rw_buffer.h:64
void move_position(Difference_t delta)
Move the position left or right, relative to the current position.
Definition: rw_buffer.h:164
Rw_buffer(Rw_buffer &)=delete
Deleted copy constructor.
Rw_buffer(Rw_buffer &&) noexcept=default
Default move constructor.
Buffer_view_t & read_part()
Return the read part.
Definition: rw_buffer.h:99
mysql::binlog::event::compression::buffer::Buffer_view< Char_t > Buffer_view_t
Definition: rw_buffer.h:68
std::size_t Size_t
Definition: rw_buffer.h:63
Rw_buffer(Buffer_view_t buffer)
Create a new Rw_buffer from the specified size and buffer.
Definition: rw_buffer.h:76
Buffer_view_t m_write_part
Definition: rw_buffer.h:173
Buffer_view_t m_read_part
Definition: rw_buffer.h:172
void set_position(Size_t new_position)
Set the position to a fixed number.
Definition: rw_buffer.h:123
Size_t capacity() const
Return the total size of the read part and the write part.
Definition: rw_buffer.h:108
Char_t * Iterator_t
Definition: rw_buffer.h:65
Definition: buffer_sequence_view.h:51
const char * begin(const char *const c)
Definition: base64.h:44
size_t size(const char *const c)
Definition: base64.h:46
mutable_buffer buffer(void *p, size_t n) noexcept
Definition: buffer.h:418