#include <AllocatorProxy.h>

Collaboration diagram for Mem::AllocatorProxy:

Public Member Functions

 AllocatorProxy (char const *aLabel, size_t const &aSize, bool doZeroBlocks=true)
 
void * alloc ()
 Allocate one element from the pool. More...
 
void freeOne (void *)
 Free a element allocated by Mem::AllocatorProxy::alloc() More...
 
int inUseCount () const
 
size_t objectSize () const
 
char const * objectType () const
 
PoolMeter const & getMeter () const
 
size_t getStats (PoolStats &stats)
 
void zeroBlocks (bool doIt)
 
void relabel (const char *const aLabel)
 

Private Member Functions

AllocatorgetAllocator () const
 

Private Attributes

const char * label
 
size_t size
 
AllocatortheAllocator
 
bool doZero
 

Detailed Description

Support late binding of pool type for allocator agnostic classes

Definition at line 55 of file AllocatorProxy.h.

Constructor & Destructor Documentation

◆ AllocatorProxy()

Mem::AllocatorProxy::AllocatorProxy ( char const *  aLabel,
size_t const &  aSize,
bool  doZeroBlocks = true 
)
inline

Definition at line 58 of file AllocatorProxy.h.

Member Function Documentation

◆ alloc()

void * Mem::AllocatorProxy::alloc ( )

Definition at line 16 of file AllocatorProxy.cc.

References Mem::Allocator::alloc(), and getAllocator().

◆ freeOne()

void Mem::AllocatorProxy::freeOne ( void *  address)

Definition at line 22 of file AllocatorProxy.cc.

◆ getAllocator()

Mem::Allocator * Mem::AllocatorProxy::getAllocator ( ) const
private

Definition at line 31 of file AllocatorProxy.cc.

References MemPools::create(), MemPools::GetInstance(), size, and Mem::Allocator::zeroBlocks().

Referenced by alloc().

◆ getMeter()

Mem::PoolMeter const & Mem::AllocatorProxy::getMeter ( ) const

Definition at line 63 of file AllocatorProxy.cc.

◆ getStats()

size_t Mem::AllocatorProxy::getStats ( PoolStats stats)
Parameters
statsObject to be filled with statistical data about pool.
Return values
Numberof objects in use, ie. allocated.

Definition at line 69 of file AllocatorProxy.cc.

References Ping::stats.

◆ inUseCount()

int Mem::AllocatorProxy::inUseCount ( ) const

Definition at line 41 of file AllocatorProxy.cc.

◆ objectSize()

size_t Mem::AllocatorProxy::objectSize ( ) const
inline

Definition at line 72 of file AllocatorProxy.h.

References size.

◆ objectType()

char const * Mem::AllocatorProxy::objectType ( ) const
inline

Definition at line 73 of file AllocatorProxy.h.

References label.

◆ relabel()

void Mem::AllocatorProxy::relabel ( const char *const  aLabel)

change the allocator description if we were only able to provide an approximate description at object construction time

Definition at line 56 of file AllocatorProxy.cc.

◆ zeroBlocks()

void Mem::AllocatorProxy::zeroBlocks ( bool  doIt)

Definition at line 50 of file AllocatorProxy.cc.

Member Data Documentation

◆ doZero

bool Mem::AllocatorProxy::doZero
private

Definition at line 94 of file AllocatorProxy.h.

◆ label

const char* Mem::AllocatorProxy::label
private

Definition at line 91 of file AllocatorProxy.h.

Referenced by objectType().

◆ size

size_t Mem::AllocatorProxy::size
private

Definition at line 92 of file AllocatorProxy.h.

Referenced by objectSize().

◆ theAllocator

Allocator* Mem::AllocatorProxy::theAllocator
mutableprivate

Definition at line 93 of file AllocatorProxy.h.


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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors