组合类型 | 公有成员 | 保护属性

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.h31行定义。

继承图,类CCache< T >
Inheritance graph
[图例]

所有成员的列表。

组合类型

struct  TEntry

公有成员

 CCache (int64_t cache_size, int64_t obj_size, int64_t num_entries)
virtual ~CCache ()
bool is_cached (int64_t number)
T * lock_entry (int64_t number)
void unlock_entry (int64_t number)
T * set_entry (int64_t number)
virtual const char * get_name () const

保护属性

bool cache_is_full
int64_t entry_size
int64_t nr_cache_lines
TEntry * lookup_table
TEntry ** cache_table
T * cache_block

构造及析构函数文档

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.h55行定义。

virtual ~CCache (  )  [virtual]

在文件Cache.h99行定义。


成员函数文档

virtual const char* get_name (  )  const [virtual]
返回:
object name

实现了CSGObject

在文件Cache.h232行定义。

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.h111行定义。

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.h121行定义。

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.h150行定义。

void unlock_entry ( int64_t  number  ) 

unlock a cache entry

参数:
number number of object to unlock

在文件Cache.h137行定义。


成员数据文档

T* cache_block [protected]

cache block

在文件Cache.h246行定义。

bool cache_is_full [protected]

if cache is full

在文件Cache.h236行定义。

TEntry** cache_table [protected]

cache table containing cached objects

在文件Cache.h244行定义。

int64_t entry_size [protected]

size of one entry

在文件Cache.h238行定义。

TEntry* lookup_table [protected]

lookup table

在文件Cache.h242行定义。

int64_t nr_cache_lines [protected]

number of cache lines

在文件Cache.h240行定义。


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

SHOGUN Machine Learning Toolbox - Documentation