Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

ark::SimplePool Class Reference

#include <MemoryAllocators.h>

Inheritance diagram for ark::SimplePool:

ark::Allocator List of all members.

Public Member Functions

 SimplePool ()
 SimplePool (unsigned buffSz, unsigned numBuffs)
virtual ~SimplePool ()
void initialize (unsigned buffSz, unsigned numBuffs)
void uninitialize ()
bool isInitialized () const
unsigned char * alloc (unsigned)
bool dealloc (unsigned char *, unsigned)
unsigned maxBufferSize () const
bool isThreadSafe () const
void setEmergencyGate (MemoryGate<> *eg)

Private Types

typedef std::vector< unsigned
char * > 
BufferStack

Private Attributes

BufferStack _buffStack
unsigned _buffSize
MemoryGate_emergencyGate

Classes

struct  BadDealloc

Detailed Description

SimplePool An extremely simple buffer recycling class, returns and accepts one size of buffer.


Member Typedef Documentation

typedef std::vector<unsigned char*> ark::SimplePool::BufferStack [private]
 


Constructor & Destructor Documentation

SimplePool::SimplePool  ) 
 

SimplePool::SimplePool unsigned  buffSz,
unsigned  numBuffs
 

SimplePool::~SimplePool  )  [virtual]
 


Member Function Documentation

unsigned char * SimplePool::alloc unsigned   )  [virtual]
 

Implements ark::Allocator.

bool SimplePool::dealloc unsigned char *  ,
unsigned 
[virtual]
 

Implements ark::Allocator.

void SimplePool::initialize unsigned  buffSz,
unsigned  numBuffs
 

bool SimplePool::isInitialized  )  const
 

bool ark::SimplePool::isThreadSafe  )  const [inline, virtual]
 

Implements ark::Allocator.

unsigned SimplePool::maxBufferSize  )  const [virtual]
 

Implements ark::Allocator.

void ark::SimplePool::setEmergencyGate MemoryGate<> *  eg  )  [inline]
 

setEmergencyGate The allocator can have a gate to attempt deallocation requests which it cannot handle. By default no emergency gate is installed.

Note:
This is provided for flexibility, but I recommend using MemoryGate with a Pool binding policy, because you can have more control over the order of deallocation handlers.
Parameters:
eg The emergency gate to install, use NULL to remove an emergency gate

void SimplePool::uninitialize  ) 
 


Member Data Documentation

unsigned ark::SimplePool::_buffSize [private]
 

BufferStack ark::SimplePool::_buffStack [private]
 

MemoryGate* ark::SimplePool::_emergencyGate [private]
 


The documentation for this class was generated from the following files:
Generated on Tue Sep 6 14:54:40 2005 for Arkonnekt Sound by  doxygen 1.4.4