Classes | Public Types | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes
Json::BatchAllocator< AllocatedType, objectPerAllocation > Class Template Reference

#include <json_batchallocator.h>

List of all members.

Classes

struct  BatchInfo

Public Types

typedef AllocatedType Type

Public Member Functions

AllocatedType * allocate ()
 BatchAllocator (unsigned int objectsPerPage=255)
void release (AllocatedType *object)
 ~BatchAllocator ()

Private Member Functions

 BatchAllocator (const BatchAllocator &)
void operator= (const BatchAllocator &)

Static Private Member Functions

static BatchInfoallocateBatch (unsigned int objectsPerPage)

Private Attributes

BatchInfobatches_
BatchInfocurrentBatch_
AllocatedType * freeHead_
 Head of a single linked list within the allocated space of freeed object.
unsigned int objectsPerPage_

Detailed Description

template<typename AllocatedType, const unsigned int objectPerAllocation>
class Json::BatchAllocator< AllocatedType, objectPerAllocation >

Definition at line 25 of file json_batchallocator.h.


Member Typedef Documentation

template<typename AllocatedType , const unsigned int objectPerAllocation>
typedef AllocatedType Json::BatchAllocator< AllocatedType, objectPerAllocation >::Type

Definition at line 28 of file json_batchallocator.h.


Constructor & Destructor Documentation

template<typename AllocatedType , const unsigned int objectPerAllocation>
Json::BatchAllocator< AllocatedType, objectPerAllocation >::BatchAllocator ( unsigned int  objectsPerPage = 255) [inline]

Definition at line 30 of file json_batchallocator.h.

template<typename AllocatedType , const unsigned int objectPerAllocation>
Json::BatchAllocator< AllocatedType, objectPerAllocation >::~BatchAllocator ( ) [inline]

Definition at line 41 of file json_batchallocator.h.

template<typename AllocatedType , const unsigned int objectPerAllocation>
Json::BatchAllocator< AllocatedType, objectPerAllocation >::BatchAllocator ( const BatchAllocator< AllocatedType, objectPerAllocation > &  ) [private]

Member Function Documentation

template<typename AllocatedType , const unsigned int objectPerAllocation>
AllocatedType* Json::BatchAllocator< AllocatedType, objectPerAllocation >::allocate ( ) [inline]

allocate space for an array of objectPerAllocation object.

Warning:
it is the responsability of the caller to call objects constructors.

Definition at line 53 of file json_batchallocator.h.

template<typename AllocatedType , const unsigned int objectPerAllocation>
static BatchInfo* Json::BatchAllocator< AllocatedType, objectPerAllocation >::allocateBatch ( unsigned int  objectsPerPage) [inline, static, private]

Definition at line 101 of file json_batchallocator.h.

template<typename AllocatedType , const unsigned int objectPerAllocation>
void Json::BatchAllocator< AllocatedType, objectPerAllocation >::operator= ( const BatchAllocator< AllocatedType, objectPerAllocation > &  ) [private]
template<typename AllocatedType , const unsigned int objectPerAllocation>
void Json::BatchAllocator< AllocatedType, objectPerAllocation >::release ( AllocatedType *  object) [inline]

Release the object.

Warning:
it is the responsability of the caller to actually destruct the object.

Definition at line 81 of file json_batchallocator.h.


Member Data Documentation

template<typename AllocatedType , const unsigned int objectPerAllocation>
BatchInfo* Json::BatchAllocator< AllocatedType, objectPerAllocation >::batches_ [private]

Definition at line 112 of file json_batchallocator.h.

template<typename AllocatedType , const unsigned int objectPerAllocation>
BatchInfo* Json::BatchAllocator< AllocatedType, objectPerAllocation >::currentBatch_ [private]

Definition at line 113 of file json_batchallocator.h.

template<typename AllocatedType , const unsigned int objectPerAllocation>
AllocatedType* Json::BatchAllocator< AllocatedType, objectPerAllocation >::freeHead_ [private]

Head of a single linked list within the allocated space of freeed object.

Definition at line 115 of file json_batchallocator.h.

template<typename AllocatedType , const unsigned int objectPerAllocation>
unsigned int Json::BatchAllocator< AllocatedType, objectPerAllocation >::objectsPerPage_ [private]

Definition at line 116 of file json_batchallocator.h.


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


bwi_tools
Author(s): Piyush Khandelwal
autogenerated on Thu Jun 6 2019 17:57:26