MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
NdbBulkAllocator Class Reference

#include <NdbQueryOperationImpl.hpp>

Public Member Functions

 NdbBulkAllocator (size_t objSize)
int init (Uint32 maxObjs)
void reset ()
void * allocObjMem (Uint32 noOfObjs)

Detailed Description

This class simplifies the task of allocating memory for many instances of the same type at once and then constructing them later.

Definition at line 42 of file NdbQueryOperationImpl.hpp.

Constructor & Destructor Documentation

NdbBulkAllocator::NdbBulkAllocator ( size_t  objSize)
explicit
Parameters
[in]objSizeSize (in bytes) of each object.

Definition at line 626 of file NdbQueryOperation.cpp.

Member Function Documentation

void * NdbBulkAllocator::allocObjMem ( Uint32  noOfObjs)

Get an area large enough to hold 'noOfObjs' objects.

Returns
The memory area.

Definition at line 659 of file NdbQueryOperation.cpp.

Here is the caller graph for this function:

int NdbBulkAllocator::init ( Uint32  maxObjs)

Allocate memory for a number of objects from the heap.

Parameters
[in]maxObjsThe maximal number of objects this instance should accomodate.
Returns
0 or possible error code.

Definition at line 633 of file NdbQueryOperation.cpp.

Here is the caller graph for this function:

void NdbBulkAllocator::reset ( void  )

Release allocated memory to heap and reset *this to initial state.

Definition at line 647 of file NdbQueryOperation.cpp.


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