FirteX-高性能全文索引和检索平台

API Documentation


首页 | 名字空间列表 | 类继承关系 | 组合类型列表 | $(BL\录(B | 文件列表 | 名字空间成员 | 组合类型成员 | 文件成员

firtex::utility::CMemCache< T >模板类参考

#include <MemCache.h>

所有成员的列表。

公有成员

 CMemCache (size_t cachesize)
 CMemCache (T *cache, size_t cachesize)
 CMemCache ()
 ~CMemCache ()
T * getMem (size_t chunksize)
T * getMoreMem (size_t newsize, T *location, size_t oldsize)
void freeMem (T *location, size_t memsize)
void flushMem ()
const T * getBegin ()
const T * getEnd ()
const size_t getSize ()
bool isEmpty ()
CMemCache< T > * grow (size_t growSize)
bool isGrowed ()

template<typename T>
class firtex::utility::CMemCache< T >


构造及析构函数文档

template<typename T>
firtex::utility::CMemCache< T >::CMemCache size_t  cachesize  ) 
 

参数:
cachesize 缓冲大小 cachesize = byte cache size /sizeof(T)

template<typename T>
firtex::utility::CMemCache< T >::CMemCache T *  cache,
size_t  cachesize
 

参数:
cache 外部给定的缓冲区首地址
cachesize 缓冲大小,以T大小为单位,即cachesize = byte cache size /sizeof(T)

template<typename T>
firtex::utility::CMemCache< T >::CMemCache  ) 
 

template<typename T>
firtex::utility::CMemCache< T >::~CMemCache  ) 
 


成员函数文档

template<typename T>
void firtex::utility::CMemCache< T >::flushMem  ) 
 

清空缓冲,以供重新使用

template<typename T>
void firtex::utility::CMemCache< T >::freeMem T *  location,
size_t  memsize
 

释放内存,并不会真正调用delete删除内存

参数:
location 待释放内存指针
memsize 释放内存大小,以T大小为单位2的指数

template<typename T>
const T * firtex::utility::CMemCache< T >::getBegin  ) 
 

缓存开始地址

template<typename T>
const T * firtex::utility::CMemCache< T >::getEnd  ) 
 

闲缓存开始地址

template<typename T>
T * firtex::utility::CMemCache< T >::getMem size_t  chunksize  ) 
 

参数:
chunksize 需要获取的内存大小,以T大小为单位2的指数,例如,chunksize=10则申请(2^10)*sizeof(T)个字节
返回:
内存指针

template<typename T>
T * firtex::utility::CMemCache< T >::getMoreMem size_t  newsize,
T *  location,
size_t  oldsize
 

相当于realloc函数,释放以前的内存申请更大的内存

参数:
newsize 新内存大小,以T大小为单位2的指数,必须大于oldsize
location 旧内存指针
oldsize 旧内存大小,以字节为单位2的指数
返回:
如果内存不足则返回NULL,否则返回大小为newsize(以T大小为单位2的指数对齐)的新内存地址,旧内存内容将拷贝到新内存中

template<typename T>
const size_t firtex::utility::CMemCache< T >::getSize  )  [inline]
 

缓存大小

template<typename T>
CMemCache< T > * firtex::utility::CMemCache< T >::grow size_t  growSize  ) 
 

增长内存缓冲

template<typename T>
bool firtex::utility::CMemCache< T >::isEmpty  )  [inline]
 

判断缓存是否空

template<typename T>
bool firtex::utility::CMemCache< T >::isGrowed  )  [inline]
 

判断是否增长过内存缓冲


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

http://www.firtex.org http://www.sourceforge.net/projects/firtex