CCache< T >模板类参考
详细描述
template<class T>
class shogun::CCache< T >
Template class Cache implements a simple cache.
When the cache is full -- elements that are least used are freed from the cache. Thus for the cache to be effective one should not visit loop over objects, i.e. visit elements in order 0...num_elements (with num_elements >> the maximal number of entries in cache)
在文件Cache.h第31行定义。
所有成员的列表。
构造及析构函数文档
CCache |
( |
int64_t |
cache_size, |
|
|
int64_t |
obj_size, |
|
|
int64_t |
num_entries | |
|
) |
| | |
constructor
create a cache in which num_entries objects can be cached whose lookup table of sizeof(int64_t)*num_entries must fit into memory
- 参数:
-
| cache_size | cache size in Megabytes |
| obj_size | object size |
| num_entries | number of cached objects |
在文件Cache.h第55行定义。
成员函数文档
virtual const char* get_name |
( |
|
) |
const [virtual] |
bool is_cached |
( |
int64_t |
number |
) |
|
checks if an object is cached
- 参数:
-
| number | number of object to check for |
- 返回:
- if an object is cached
在文件Cache.h第111行定义。
T* lock_entry |
( |
int64_t |
number |
) |
|
lock and get a cache entry
- 参数:
-
| number | number of object to lock and get |
- 返回:
- cache entry or NULL when not cached
在文件Cache.h第121行定义。
T* set_entry |
( |
int64_t |
number |
) |
|
returns the address of a free cache entry to where the data of size obj_size has to be written
- 参数:
-
| number | number of object to unlock |
- 返回:
- address of a free cache entry
在文件Cache.h第150行定义。
void unlock_entry |
( |
int64_t |
number |
) |
|
unlock a cache entry
- 参数:
-
| number | number of object to unlock |
在文件Cache.h第137行定义。
成员数据文档
cache table containing cached objects
在文件Cache.h第244行定义。
该类的文档由以下文件生成: