CCache< T > Class Template Reference

Inheritance diagram for CCache< T >:

Inheritance graph
[legend]

List of all members.


Detailed Description

template<class T>
class CCache< T >

template class Cache

Definition at line 22 of file Cache.h.


Public Member Functions

 CCache (LONG cache_size, LONG obj_size, LONG num_entries)
 ~CCache ()
bool is_cached (LONG number)
T * lock_entry (LONG number)
void unlock_entry (LONG number)
T * set_entry (LONG number)

Public Attributes

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

Static Public Attributes

static CParallel parallel
static CIO io
static CVersion version

Classes

struct  TEntry

Constructor & Destructor Documentation

template<class T>
CCache< T >::CCache ( LONG  cache_size,
LONG  obj_size,
LONG  num_entries 
)

constructor

create a cache in which num_entries objects can be cached whose lookup table of sizeof(LONG)*num_entries must fit into memory

Parameters:
cache_size cache size in Megabytes
obj_size object size
num_entries number of cached objects

Definition at line 46 of file Cache.h.

template<class T>
CCache< T >::~CCache (  ) 

Definition at line 90 of file Cache.h.


Member Function Documentation

template<class T>
bool CCache< T >::is_cached ( LONG  number  ) 

checks if an object is cached

Parameters:
number number of object to check for
Returns:
if an object is cached

Definition at line 102 of file Cache.h.

template<class T>
T* CCache< T >::lock_entry ( LONG  number  ) 

lock and get a cache entry

Parameters:
number number of object to lock and get
Returns:
cache entry or NULL when not cached

Definition at line 112 of file Cache.h.

template<class T>
void CCache< T >::unlock_entry ( LONG  number  ) 

unlock a cache entry

Parameters:
number number of object to unlock

Definition at line 128 of file Cache.h.

template<class T>
T* CCache< T >::set_entry ( LONG  number  ) 

returns the address of a free cache entry to where the data of size obj_size has to be written

Parameters:
number number of object to unlock
Returns:
address of a free cache entry

Definition at line 141 of file Cache.h.


Member Data Documentation

template<class T>
bool CCache< T >::cache_is_full

if cache is full

Definition at line 223 of file Cache.h.

template<class T>
LONG CCache< T >::entry_size

size of one entry

Definition at line 225 of file Cache.h.

template<class T>
LONG CCache< T >::nr_cache_lines

number of cache lines

Definition at line 227 of file Cache.h.

template<class T>
TEntry* CCache< T >::lookup_table

lookup table

Definition at line 229 of file Cache.h.

template<class T>
TEntry** CCache< T >::cache_table

cache table containing cached objects

Definition at line 231 of file Cache.h.

template<class T>
T* CCache< T >::cache_block

cache block

Definition at line 233 of file Cache.h.

CParallel CSGObject::parallel [static, inherited]

Definition at line 105 of file SGObject.h.

CIO CSGObject::io [static, inherited]

Definition at line 106 of file SGObject.h.

CVersion CSGObject::version [static, inherited]

Definition at line 107 of file SGObject.h.


The documentation for this class was generated from the following file:

SHOGUN Machine Learning Toolbox - Documentation