CppELib 1.7.0
Loading...
Searching...
No Matches
TestDoubleOSWrapper::TestDoubleFixedMemoryPool Class Reference

#include <TestDoubleFixedMemoryPoolFactory.h>

Public Member Functions

 TestDoubleFixedMemoryPool ()
 
void setCreateArgs (std::size_t blockSize, std::size_t memoryPoolSize, void *memoryPoolAddress)
 
virtual ~TestDoubleFixedMemoryPool ()
 
virtual void * allocate ()
 Allocate a block from this FixedMemoryPool.
 
virtual void deallocate (void *p)
 Release the allocated block.
 
virtual std::size_t getBlockSize () const
 Get the block size.
 
- Public Member Functions inherited from OSWrapper::FixedMemoryPool
virtual Error allocateMemory (void **memory)
 Block the current thread until a memory block is allocated from this FixedMemoryPool.
 
virtual Error tryAllocateMemory (void **memory)
 Try to allocate a memory block from this FixedMemoryPool without blocking.
 
virtual Error timedAllocateMemory (void **memory, Timeout tmout)
 Block the current thread until a memory block is allocated from this FixedMemoryPool but only within the limited time.
 
virtual std::size_t getNumberOfAvailableBlocks () const
 Get the remaining number of available blocks in this FixedMemoryPool.
 
virtual std::size_t getMaxNumberOfBlocks () const
 Get the max number of blocks in this FixedMemoryPool.
 

Protected Attributes

std::size_t m_blockSize
 
std::size_t m_memoryPoolSize
 
void * m_memoryPoolAddress
 

Additional Inherited Members

- Static Public Member Functions inherited from OSWrapper::FixedMemoryPool
static FixedMemoryPoolcreate (std::size_t blockSize, std::size_t memoryPoolSize, void *memoryPoolAddress=0)
 Create a FixedMemoryPool object.
 
static void destroy (FixedMemoryPool *p)
 Destroy a FixedMemoryPool object.
 
static std::size_t getRequiredMemorySize (std::size_t blockSize, std::size_t numBlocks)
 Get the required total memory size for allocation of (blockSize * numBlocks)
 
- Protected Member Functions inherited from OSWrapper::FixedMemoryPool
virtual ~FixedMemoryPool ()
 

Constructor & Destructor Documentation

◆ TestDoubleFixedMemoryPool()

TestDoubleOSWrapper::TestDoubleFixedMemoryPool::TestDoubleFixedMemoryPool ( )
inline

◆ ~TestDoubleFixedMemoryPool()

virtual TestDoubleOSWrapper::TestDoubleFixedMemoryPool::~TestDoubleFixedMemoryPool ( )
inlinevirtual

Member Function Documentation

◆ allocate()

virtual void * TestDoubleOSWrapper::TestDoubleFixedMemoryPool::allocate ( )
inlinevirtual

Allocate a block from this FixedMemoryPool.

Returns
If free blocks exist in the memory pool then returns a pointer of allocated block, else returns null pointer

Implements OSWrapper::FixedMemoryPool.

◆ deallocate()

virtual void TestDoubleOSWrapper::TestDoubleFixedMemoryPool::deallocate ( void *  p)
inlinevirtual

Release the allocated block.

Parameters
pPointer of allocated block
Note
If p is null pointer, do nothing.

Implements OSWrapper::FixedMemoryPool.

◆ getBlockSize()

virtual std::size_t TestDoubleOSWrapper::TestDoubleFixedMemoryPool::getBlockSize ( ) const
inlinevirtual

Get the block size.

Returns
Number of bytes of one fixed-size memory block

Implements OSWrapper::FixedMemoryPool.

◆ setCreateArgs()

void TestDoubleOSWrapper::TestDoubleFixedMemoryPool::setCreateArgs ( std::size_t  blockSize,
std::size_t  memoryPoolSize,
void *  memoryPoolAddress 
)
inline

Member Data Documentation

◆ m_blockSize

std::size_t TestDoubleOSWrapper::TestDoubleFixedMemoryPool::m_blockSize
protected

◆ m_memoryPoolAddress

void* TestDoubleOSWrapper::TestDoubleFixedMemoryPool::m_memoryPoolAddress
protected

◆ m_memoryPoolSize

std::size_t TestDoubleOSWrapper::TestDoubleFixedMemoryPool::m_memoryPoolSize
protected

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