MySQL 8.0.40
Source Code Documentation
dyn_buf_t< SIZE >::block_t Class Reference

#include <dyn0buf.h>

Public Member Functions

 block_t ()
 
 ~block_t ()=default
 
ulint used () const
 Gets the number of used bytes in a block. More...
 
bytestart ()
 Gets pointer to the start of data. More...
 
bytebegin ()
 
byteend ()
 
const bytebegin () const
 
const byteend () const
 

Private Member Functions

template<typename Type >
Type push (uint32_t size)
 
void close (const byte *ptr)
 Grow the stack. More...
 
void init ()
 Initialise the block. More...
 

Private Attributes

ulint m_buf_end
 If opened then this is the buffer end offset, else 0. More...
 
ulint m_magic_n
 Magic number (DYN_BLOCK_MAGIC_N) More...
 
byte m_data [MAX_DATA_SIZE]
 Storage. More...
 
block_node_t m_node
 Doubly linked list node. More...
 
uint32_t m_used
 number of data bytes used in this block; DYN_BLOCK_FULL_FLAG is set when the block becomes full More...
 

Static Private Attributes

static constexpr auto MAX_DATA_SIZE = SIZE
 SIZE - sizeof(m_node) + sizeof(m_used) More...
 

Friends

class dyn_buf_t
 

Constructor & Destructor Documentation

◆ block_t()

template<size_t SIZE = DYN_ARRAY_DATA_SIZE>
dyn_buf_t< SIZE >::block_t::block_t ( )
inline

◆ ~block_t()

template<size_t SIZE = DYN_ARRAY_DATA_SIZE>
dyn_buf_t< SIZE >::block_t::~block_t ( )
default

Member Function Documentation

◆ begin() [1/2]

template<size_t SIZE = DYN_ARRAY_DATA_SIZE>
byte * dyn_buf_t< SIZE >::block_t::begin ( void  )
inline
Returns
start of data - non const version

◆ begin() [2/2]

template<size_t SIZE = DYN_ARRAY_DATA_SIZE>
const byte * dyn_buf_t< SIZE >::block_t::begin ( void  ) const
inline
Returns
start of data - const version

◆ close()

template<size_t SIZE = DYN_ARRAY_DATA_SIZE>
void dyn_buf_t< SIZE >::block_t::close ( const byte ptr)
inlineprivate

Grow the stack.

◆ end() [1/2]

template<size_t SIZE = DYN_ARRAY_DATA_SIZE>
byte * dyn_buf_t< SIZE >::block_t::end ( void  )
inline
Returns
end of used data - non const version

◆ end() [2/2]

template<size_t SIZE = DYN_ARRAY_DATA_SIZE>
const byte * dyn_buf_t< SIZE >::block_t::end ( void  ) const
inline
Returns
end of used data - const version

◆ init()

template<size_t SIZE = DYN_ARRAY_DATA_SIZE>
void dyn_buf_t< SIZE >::block_t::init ( void  )
inlineprivate

Initialise the block.

◆ push()

template<size_t SIZE = DYN_ARRAY_DATA_SIZE>
template<typename Type >
Type dyn_buf_t< SIZE >::block_t::push ( uint32_t  size)
inlineprivate
Returns
pointer to start of reserved space

◆ start()

template<size_t SIZE = DYN_ARRAY_DATA_SIZE>
byte * dyn_buf_t< SIZE >::block_t::start ( )
inline

Gets pointer to the start of data.

Returns
pointer to data

◆ used()

template<size_t SIZE = DYN_ARRAY_DATA_SIZE>
ulint dyn_buf_t< SIZE >::block_t::used ( ) const
inline

Gets the number of used bytes in a block.

Returns
number of bytes used

Friends And Related Function Documentation

◆ dyn_buf_t

template<size_t SIZE = DYN_ARRAY_DATA_SIZE>
friend class dyn_buf_t
friend

Member Data Documentation

◆ m_buf_end

template<size_t SIZE = DYN_ARRAY_DATA_SIZE>
ulint dyn_buf_t< SIZE >::block_t::m_buf_end
private

If opened then this is the buffer end offset, else 0.

◆ m_data

template<size_t SIZE = DYN_ARRAY_DATA_SIZE>
byte dyn_buf_t< SIZE >::block_t::m_data[MAX_DATA_SIZE]
private

Storage.

◆ m_magic_n

template<size_t SIZE = DYN_ARRAY_DATA_SIZE>
ulint dyn_buf_t< SIZE >::block_t::m_magic_n
private

Magic number (DYN_BLOCK_MAGIC_N)

◆ m_node

template<size_t SIZE = DYN_ARRAY_DATA_SIZE>
block_node_t dyn_buf_t< SIZE >::block_t::m_node
private

Doubly linked list node.

◆ m_used

template<size_t SIZE = DYN_ARRAY_DATA_SIZE>
uint32_t dyn_buf_t< SIZE >::block_t::m_used
private

number of data bytes used in this block; DYN_BLOCK_FULL_FLAG is set when the block becomes full

◆ MAX_DATA_SIZE

template<size_t SIZE = DYN_ARRAY_DATA_SIZE>
constexpr auto dyn_buf_t< SIZE >::block_t::MAX_DATA_SIZE = SIZE
staticconstexprprivate

SIZE - sizeof(m_node) + sizeof(m_used)


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