#include <GaudiKernel/AllocatorPool.h>
Collaboration diagram for GaudiUtils::AllocatorPool:
Public Member Functions | |
AllocatorPool (unsigned int n=0) | |
Create a pool of elements of size n. | |
~AllocatorPool () | |
Destructor. Return storage to the free store. | |
AllocatorPool (const AllocatorPool &right) | |
Copy constructor. | |
void * | Alloc () |
Allocate one element. | |
void | Free (void *b) |
Return an element back to the pool. | |
unsigned int | Size () const |
Return storage size. | |
void | Reset () |
Return storage to the free store. | |
Private Member Functions | |
AllocatorPool & | operator= (const AllocatorPool &right) |
Private equality operator. | |
void | Grow () |
Make pool larger. | |
Private Attributes | |
const unsigned int | esize |
const unsigned int | csize |
PoolChunk * | chunks |
PoolLink * | head |
int | nchunks |
Classes | |
class | PoolChunk |
struct | PoolLink |
Class is imported from Geant4 project
Definition at line 63 of file AllocatorPool.h.
GaudiUtils::AllocatorPool::AllocatorPool | ( | unsigned int | n = 0 |
) | [explicit] |
Create a pool of elements of size n.
GaudiUtils::AllocatorPool::~AllocatorPool | ( | ) |
Destructor. Return storage to the free store.
GaudiUtils::AllocatorPool::AllocatorPool | ( | const AllocatorPool & | right | ) |
Copy constructor.
void * GaudiUtils::AllocatorPool::Alloc | ( | ) | [inline] |
void GaudiUtils::AllocatorPool::Free | ( | void * | b | ) | [inline] |
Return an element back to the pool.
Definition at line 138 of file AllocatorPool.h.
00139 { 00140 PoolLink* p = static_cast<PoolLink*>(b); 00141 p->next = head; // put b back as first element 00142 head = p; 00143 }
unsigned int GaudiUtils::AllocatorPool::Size | ( | ) | const [inline] |
void GaudiUtils::AllocatorPool::Reset | ( | ) |
Return storage to the free store.
AllocatorPool& GaudiUtils::AllocatorPool::operator= | ( | const AllocatorPool & | right | ) | [private] |
Private equality operator.
void GaudiUtils::AllocatorPool::Grow | ( | ) | [private] |
Make pool larger.
const unsigned int GaudiUtils::AllocatorPool::esize [private] |
Definition at line 109 of file AllocatorPool.h.
const unsigned int GaudiUtils::AllocatorPool::csize [private] |
Definition at line 110 of file AllocatorPool.h.
PoolChunk* GaudiUtils::AllocatorPool::chunks [private] |
Definition at line 111 of file AllocatorPool.h.
PoolLink* GaudiUtils::AllocatorPool::head [private] |
Definition at line 112 of file AllocatorPool.h.
int GaudiUtils::AllocatorPool::nchunks [private] |
Definition at line 113 of file AllocatorPool.h.