1#ifndef RECORD_BUFFER_INCLUDED
2#define RECORD_BUFFER_INCLUDED
This class represents a buffer that can be used for multi-row reads.
Definition: record_buffer.h:47
ha_rows m_count
The number of records currently stored in the buffer.
Definition: record_buffer.h:53
void clear()
Clear the buffer.
Definition: record_buffer.h:134
ha_rows m_max_records
The maximum number of records that can be stored in the buffer.
Definition: record_buffer.h:49
static constexpr size_t buffer_size(ha_rows records, size_t record_size)
This function calculates how big the uchar buffer provided to Record_buffer's constructor must be,...
Definition: record_buffer.h:81
uchar * record(ha_rows pos) const
Get the buffer that holds the record on position pos.
Definition: record_buffer.h:108
size_t record_size() const
Get the amount of space allocated for each record in the buffer.
Definition: record_buffer.h:95
void set_out_of_range(bool val)
Set whether the end of the range was reached while filling the buffer.
Definition: record_buffer.h:148
size_t m_record_size
The number of bytes available for each record.
Definition: record_buffer.h:51
ha_rows max_records() const
Get the number of records that can be stored in the buffer.
Definition: record_buffer.h:89
void reset()
Reset the buffer.
Definition: record_buffer.h:139
ha_rows records() const
Get the number of records currently stored in the buffer.
Definition: record_buffer.h:101
bool m_out_of_range
Tells if end-of-range was found while filling the buffer.
Definition: record_buffer.h:57
bool is_out_of_range() const
Check if the end of the range was reached while filling the buffer.
Definition: record_buffer.h:155
uchar * add_record()
Add a new record at the end of the buffer.
Definition: record_buffer.h:117
uchar * m_buffer
The uchar buffer that holds the records.
Definition: record_buffer.h:55
void remove_last()
Remove the record that was last added to the buffer.
Definition: record_buffer.h:125
Record_buffer(ha_rows records, size_t record_size, uchar *buffer)
Create a new record buffer with the specified size.
Definition: record_buffer.h:69
This file includes constants used by all storage engines.
my_off_t ha_rows
Definition: my_base.h:1140
unsigned char uchar
Definition: my_inttypes.h:52
mutable_buffer buffer(void *p, size_t n) noexcept
Definition: buffer.h:420