Developer World
Spresense SDK Library v1.4.2-3df2e9d
MemHandleBase Class Reference

Memory Handler Base Class for Memory Handler Base Class. This class`s methods can called only from MemHandle.(Cannot call this class directory.) More...

#include <MemHandleBase.h>

Inheritance diagram for MemHandleBase:
Collaboration diagram for MemHandleBase:

Public Member Functions

 MemHandleBase (PoolId id, size_t size_for_check)
 
 MemHandleBase (uint8_t id, size_t size_for_check)
 
 MemHandleBase (const MemHandleBase &mh)
 
MemHandleBaseoperator= (const MemHandleBase &mh)
 
err_t allocSeg (PoolId id, size_t size_for_check)
 
err_t allocSeg (uint8_t id, size_t size_for_check)
 
void freeSeg ()
 
bool isAvail () const
 
bool isNull () const
 
bool isSame (const MemHandleBase &mh)
 
PoolId getPoolId () const
 
NumSeg getSegNo () const
 
uint8_t getFlags () const
 
PoolAddr getAddr () const
 
PoolSize getSize () const
 
SegRefCnt getRefCnt () const
 

Friends

class MemPool
 

Detailed Description

Memory Handler Base Class for Memory Handler Base Class. This class`s methods can called only from MemHandle.(Cannot call this class directory.)

Member Function Documentation

◆ allocSeg()

err_t allocSeg ( PoolId  id,
size_t  size_for_check 
)

The allocator from a pool area for MemHandle.

Parameters
[in]idThe pool id that MemHandle be allocated.
[in]size_for_checkThe size the user wants.(for only size check.)
Returns
ERR_OK : success
ERR_DATA_SIZE : error, size is over segment size
ERR_MEM_EMPTY : error, there are no segments available

◆ freeSeg()

void freeSeg ( )
inline

The free from a pool area for MemHandle.

Returns
void (If this handler did not allocate, this method do nothing.)

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