MySQL 8.0.40
Source Code Documentation
|
#include <managed_buffer.h>
Public Member Functions | |
Preallocated_managed_buffer (const Memory_resource_t &memory_resource=Memory_resource_t()) | |
Public Member Functions inherited from mysqlns::buffer::Managed_buffer< unsigned char > | |
Managed_buffer (const Memory_resource_t &memory_resource=Memory_resource_t()) | |
Construct a new object without a default buffer. More... | |
Managed_buffer (Size_t default_capacity, const Memory_resource_t &memory_resource=Memory_resource_t()) | |
Construct a new object that owns a default buffer. More... | |
Managed_buffer (Buffer_view_t default_buffer, const Memory_resource_t &memory_resource=Memory_resource_t()) | |
Construct a new object that uses the given default buffer. More... | |
Managed_buffer (Managed_buffer &other)=delete | |
Managed_buffer (Managed_buffer &&other) noexcept=default | |
Managed_buffer & | operator= (Managed_buffer &other)=delete |
Managed_buffer & | operator= (Managed_buffer &&other) noexcept=default |
~Managed_buffer () override | |
Grow_status | reserve_total_size (Size_t requested_size) |
Reserve space so that the total buffer size is at least the given number. More... | |
Grow_status | reserve_write_size (Size_t requested_write_size) |
Reserve space so that the write size is at least the given number. More... | |
void | reset () |
Reset the buffer. More... | |
void | set_grow_calculator (const Grow_calculator_t &grow_calculator) |
Set the grow calculator. More... | |
const Grow_calculator_t & | get_grow_calculator () const |
Return a const reference to the grow calculator. More... | |
Size_t | get_default_capacity () |
Return the size of the default buffer. More... | |
Public Member Functions inherited from mysqlns::buffer::Rw_buffer< unsigned char > | |
Rw_buffer ()=default | |
Rw_buffer (Buffer_view_t buffer) | |
Create a new Rw_buffer from the specified size and buffer. More... | |
Rw_buffer (Rw_buffer &)=delete | |
Deleted copy constructor. More... | |
Rw_buffer (Rw_buffer &&) noexcept=default | |
Default move constructor. More... | |
Rw_buffer & | operator= (Rw_buffer &)=delete |
Deleted copy assignment operator. More... | |
Rw_buffer & | operator= (Rw_buffer &&) noexcept=default |
Default move assignment operator. More... | |
virtual | ~Rw_buffer ()=default |
Default delete operator. More... | |
const Buffer_view_t & | read_part () const |
Return the read part. More... | |
Buffer_view_t & | read_part () |
Return the read part. More... | |
const Buffer_view_t & | write_part () const |
Return the write part. More... | |
Buffer_view_t & | write_part () |
Return the write part. More... | |
Size_t | capacity () const |
Return the total size of the read part and the write part. More... | |
void | set_position (Size_t new_position) |
Set the position to a fixed number. More... | |
void | increase_position (Size_t increment) |
Increase the position right, relative to the currrent position. More... | |
void | move_position (Difference_t delta) |
Move the position left or right, relative to the current position. More... | |
Private Attributes | |
Char_t | m_preallocated_buffer [preallocated_size==0 ? 1 :preallocated_size] |
Preallocated buffer. More... | |
Additional Inherited Members | |
Public Types inherited from mysqlns::buffer::Managed_buffer< unsigned char > | |
using | Char_t = unsigned char |
using | Buffer_view_t = Buffer_view< Char_t > |
using | Rw_buffer_t = Rw_buffer< Char_t > |
using | Memory_resource_t = mysqlns::resource::Memory_resource |
using | Char_allocator_t = mysqlns::resource::Allocator< Char_t > |
using | Grow_calculator_t = Grow_calculator |
using | Const_iterator_t = const Char_t * |
using | Iterator_t = Char_t * |
using | Size_t = std::size_t |
Public Types inherited from mysqlns::buffer::Rw_buffer< unsigned char > | |
using | Char_t = unsigned char |
using | Size_t = std::size_t |
using | Difference_t = std::ptrdiff_t |
using | Iterator_t = Char_t * |
using | Const_iterator_t = const Char_t * |
using | Buffer_view_t = mysqlns::buffer::Buffer_view< Char_t > |
Protected Attributes inherited from mysqlns::buffer::Rw_buffer< unsigned char > | |
Buffer_view_t | m_read_part |
Buffer_view_t | m_write_part |
This class pre-allocates a fixed-size initial buffer, which is beneficial in use patterns where managed buffers are allocated on the stack and are usually only given small amount of data.
|
inlineexplicit |
|
private |
Preallocated buffer.