#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
 
MemPoolMeter const & getMeter () const
 
int getStats (MemPoolStats *stats)
 
void zeroBlocks (bool doIt)
 

Private Member Functions

MemAllocatorgetAllocator () const
 

Private Attributes

const char * label
 
size_t size
 
MemAllocatortheAllocator
 
bool doZero
 

Detailed Description

Support late binding of pool type for allocator agnostic classes

Definition at line 51 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 54 of file AllocatorProxy.h.

References alloc(), freeOne(), and inUseCount().

Member Function Documentation

◆ alloc()

void * Mem::AllocatorProxy::alloc ( )

Definition at line 14 of file AllocatorProxy.cc.

References MemAllocator::alloc(), and getAllocator().

Referenced by AllocatorProxy().

◆ freeOne()

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

Definition at line 20 of file AllocatorProxy.cc.

References MemAllocator::freeOne(), and getAllocator().

Referenced by AllocatorProxy().

◆ getAllocator()

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

◆ getMeter()

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

Definition at line 54 of file AllocatorProxy.cc.

References getAllocator(), and MemAllocator::getMeter().

Referenced by objectType().

◆ getStats()

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

Definition at line 60 of file AllocatorProxy.cc.

References getAllocator(), and MemAllocator::getStats().

Referenced by objectType().

◆ inUseCount()

int Mem::AllocatorProxy::inUseCount ( ) const

Definition at line 39 of file AllocatorProxy.cc.

References MemAllocator::inUseCount(), and theAllocator.

Referenced by AllocatorProxy(), and MemObject::inUseCount().

◆ objectSize()

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

Definition at line 68 of file AllocatorProxy.h.

References size.

◆ objectType()

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

Definition at line 69 of file AllocatorProxy.h.

References getAllocator(), getMeter(), getStats(), label, Ping::stats, and zeroBlocks().

Referenced by getAllocator().

◆ zeroBlocks()

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

Definition at line 48 of file AllocatorProxy.cc.

References getAllocator(), and MemAllocator::zeroBlocks().

Referenced by objectType().

Member Data Documentation

◆ doZero

bool Mem::AllocatorProxy::doZero
private

Definition at line 87 of file AllocatorProxy.h.

Referenced by getAllocator().

◆ label

const char* Mem::AllocatorProxy::label
private

Definition at line 84 of file AllocatorProxy.h.

Referenced by objectType().

◆ size

size_t Mem::AllocatorProxy::size
private

Definition at line 85 of file AllocatorProxy.h.

Referenced by getAllocator(), and objectSize().

◆ theAllocator

MemAllocator* Mem::AllocatorProxy::theAllocator
mutableprivate

Definition at line 86 of file AllocatorProxy.h.

Referenced by getAllocator(), and inUseCount().


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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors