SHOGUN v0.9.0
|
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)
组合类型 | |
struct | TEntry |
公有成员 | |
CCache (void) | |
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 | ||
) |
virtual const char* get_name | ( | void | ) | const [virtual] |
bool is_cached | ( | int64_t | number | ) |
T* lock_entry | ( | int64_t | number | ) |
T* set_entry | ( | int64_t | number | ) |
void unlock_entry | ( | int64_t | number | ) |
T* cache_block [protected] |
bool cache_is_full [protected] |
TEntry** cache_table [protected] |
int64_t entry_size [protected] |
TEntry* lookup_table [protected] |
int64_t nr_cache_lines [protected] |