CppELib 1.7.0
Loading...
Searching...
No Matches
OSWrapper::VariableMemoryPool Class Referenceabstract

Abstract class that has functions of common RTOS's variable-size memory pool. More...

#include <VariableMemoryPool.h>

Public Member Functions

virtual void * allocate (std::size_t size)=0
 Allocate a memory from this VariableMemoryPool.
 
virtual void deallocate (void *p)=0
 Release the allocated memory.
 

Static Public Member Functions

static VariableMemoryPoolcreate (std::size_t memoryPoolSize, void *memoryPoolAddress=0)
 Create a VariableMemoryPool object.
 
static void destroy (VariableMemoryPool *p)
 Destroy a VariableMemoryPool object.
 

Protected Member Functions

virtual ~VariableMemoryPool ()
 

Detailed Description

Abstract class that has functions of common RTOS's variable-size memory pool.

Constructor & Destructor Documentation

◆ ~VariableMemoryPool()

virtual OSWrapper::VariableMemoryPool::~VariableMemoryPool ( )
inlineprotectedvirtual

Member Function Documentation

◆ allocate()

virtual void * OSWrapper::VariableMemoryPool::allocate ( std::size_t  size)
pure virtual

Allocate a memory from this VariableMemoryPool.

Parameters
sizeNumber of bytes of allocation
Returns
If required free areas exist in the memory pool then returns a pointer of allocated memory, else returns null pointer

Implemented in StdCppOSWrapper::StdCppVariableMemoryPool, and TestDoubleOSWrapper::TestDoubleVariableMemoryPool.

◆ create()

VariableMemoryPool * OSWrapper::VariableMemoryPool::create ( std::size_t  memoryPoolSize,
void *  memoryPoolAddress = 0 
)
static

Create a VariableMemoryPool object.

Parameters
memoryPoolSizeNumber of bytes of memory pool
memoryPoolAddressMemory pool address
Returns
If this method succeeds then returns a pointer of VariableMemoryPool object, else returns null pointer
Note
If memoryPoolAddress is null pointer, using memory pool area that RTOS prepared.

◆ deallocate()

virtual void OSWrapper::VariableMemoryPool::deallocate ( void *  p)
pure virtual

Release the allocated memory.

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

Implemented in StdCppOSWrapper::StdCppVariableMemoryPool, and TestDoubleOSWrapper::TestDoubleVariableMemoryPool.

◆ destroy()

void OSWrapper::VariableMemoryPool::destroy ( VariableMemoryPool p)
static

Destroy a VariableMemoryPool object.

Parameters
pPointer of VariableMemoryPool object created by VariableMemoryPool::create()
Note
If p is null pointer, do nothing.

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