Classes | Public Types | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
Json::BatchAllocator< AllocatedType, objectPerAllocation > Class Template Reference
Collaboration diagram for Json::BatchAllocator< AllocatedType, objectPerAllocation >:
[legend]

Classes

struct  BatchInfo
 

Public Types

typedef AllocatedType Type
 

Public Member Functions

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

Private Member Functions

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

Static Private Member Functions

static BatchInfo * allocateBatch (unsigned int objectsPerPage)
 

Private Attributes

BatchInfo * batches_
 
BatchInfo * currentBatch_
 
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 1113 of file jsoncpp.cpp.

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 1141 of file jsoncpp.cpp.

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 1169 of file jsoncpp.cpp.


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