MiniOB 1
MiniOB is one mini database, helping developers to learn how database works.
载入中...
搜索中...
未找到
Public 成员函数 | Protected 属性 | 所有成员列表
common::MemPool< T > 模板类 参考abstract
类 common::MemPool< T > 继承关系图:
common::MemPoolSimple< Frame > common::MemPoolSimple< T >

Public 成员函数

 MemPool (const char *tag)
 
virtual int init (bool dynamic=true, int pool_num=DEFAULT_POOL_NUM, int item_num_per_pool=DEFAULT_ITEM_NUM_PER_POOL)=0
 
virtual void cleanup ()=0
 
virtual int extend ()=0
 
virtual T * alloc ()=0
 
virtual void free (T *item)=0
 
virtual string to_string ()=0
 
const string get_name () const
 
bool is_dynamic () const
 
int get_size () const
 

Protected 属性

pthread_mutex_t mutex
 
int size
 
bool dynamic
 
string name
 

成员函数说明

◆ alloc()

template<class T >
virtual T * common::MemPool< T >::alloc ( )
pure virtual

Alloc one frame from memory Pool

返回

common::MemPoolSimple< T > , 以及 common::MemPoolSimple< Frame > 内被实现.

◆ cleanup()

template<class T >
virtual void common::MemPool< T >::cleanup ( )
pure virtual

Do cleanup job for memory pool

common::MemPoolSimple< T > , 以及 common::MemPoolSimple< Frame > 内被实现.

◆ extend()

template<class T >
virtual int common::MemPool< T >::extend ( )
pure virtual

If dynamic has been set, extend current memory pool,

common::MemPoolSimple< T > , 以及 common::MemPoolSimple< Frame > 内被实现.

◆ free()

template<class T >
virtual void common::MemPool< T >::free ( T *  item)
pure virtual

Free one item, the resouce will return to memory Pool

参数
item

common::MemPoolSimple< Frame > , 以及 common::MemPoolSimple< T > 内被实现.

◆ init()

template<class T >
virtual int common::MemPool< T >::init ( bool  dynamic = true,
int  pool_num = DEFAULT_POOL_NUM,
int  item_num_per_pool = DEFAULT_ITEM_NUM_PER_POOL 
)
pure virtual

init memory pool, the major job is to alloc memory for memory pool

参数
pool_num,memorypool's number
item_num_per_pool,howmany items per pool.
返回

common::MemPoolSimple< T > , 以及 common::MemPoolSimple< Frame > 内被实现.

◆ to_string()

template<class T >
virtual string common::MemPool< T >::to_string ( )
pure virtual

Print the MemPool status

返回

common::MemPoolSimple< T > , 以及 common::MemPoolSimple< Frame > 内被实现.


该类的文档由以下文件生成: