|
SHOGUN
v1.1.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)

Classes | |
| struct | TEntry |
Public Member Functions | |
| CCache () | |
| 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 |
Public Member Functions inherited from CSGObject | |
| CSGObject () | |
| CSGObject (const CSGObject &orig) | |
| virtual | ~CSGObject () |
| virtual bool | is_generic (EPrimitiveType *generic) const |
| template<class T > | |
| void | set_generic () |
| void | unset_generic () |
| virtual void | print_serializable (const char *prefix="") |
| virtual bool | save_serializable (CSerializableFile *file, const char *prefix="") |
| virtual bool | load_serializable (CSerializableFile *file, const char *prefix="") |
| void | set_global_io (SGIO *io) |
| SGIO * | get_global_io () |
| void | set_global_parallel (Parallel *parallel) |
| Parallel * | get_global_parallel () |
| void | set_global_version (Version *version) |
| Version * | get_global_version () |
| SGVector< char * > | get_modelsel_names () |
| char * | get_modsel_param_descr (const char *param_name) |
| index_t | get_modsel_param_index (const char *param_name) |
Protected Attributes | |
| bool | cache_is_full |
| int64_t | entry_size |
| int64_t | nr_cache_lines |
| TEntry * | lookup_table |
| TEntry ** | cache_table |
| T * | cache_block |
Additional Inherited Members | |
Public Attributes inherited from CSGObject | |
| SGIO * | io |
| Parallel * | parallel |
| Version * | version |
| Parameter * | m_parameters |
| Parameter * | m_model_selection_parameters |
Protected Member Functions inherited from CSGObject | |
| virtual void | load_serializable_pre () throw (ShogunException) |
| virtual void | load_serializable_post () throw (ShogunException) |
| virtual void | save_serializable_pre () throw (ShogunException) |
| virtual void | save_serializable_post () throw (ShogunException) |
| CCache | ( | int64_t | cache_size, |
| int64_t | obj_size, | ||
| int64_t | num_entries | ||
| ) |
|
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 | ) |
|
protected |