My Project
Public Member Functions
Filesort_buffer Class Reference

#include <filesort_utils.h>

List of all members.

Public Member Functions

void sort_buffer (const Sort_param *param, uint count)
uchar * get_record_buffer (uint idx)
 Initializes a record pointer.
void init_record_pointers ()
 Initializes all the record pointers.
size_t sort_buffer_size () const
 Returns total size: pointer array + record buffers.
uchar ** alloc_sort_buffer (uint num_records, uint record_length)
 Allocates the buffer, but does *not* initialize pointers.
void free_sort_buffer ()
 Frees the buffer.
uchar ** get_sort_keys ()
 Getter, for calling routines which still use the uchar** interface.
Filesort_bufferoperator= (const Filesort_buffer &rhs)

Detailed Description

A wrapper class around the buffer used by filesort(). The buffer is a contiguous chunk of memory, where the first part is <num_records> pointers to the actual data.

We wrap the buffer in order to be able to do lazy initialization of the pointers: the buffer is often much larger than what we actually need.

The buffer must be kept available for multiple executions of the same sort operation, so we have explicit allocate and free functions, rather than doing alloc/free in CTOR/DTOR.


Member Function Documentation

Filesort_buffer& Filesort_buffer::operator= ( const Filesort_buffer rhs) [inline]

We need an assignment operator, see filesort(). This happens to have the same semantics as the one that would be generated by the compiler. We still implement it here, to show shallow assignment explicitly: we have two objects sharing the same array.

void Filesort_buffer::sort_buffer ( const Sort_param param,
uint  count 
)

Sort me...


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines