Main Page   Modules   Alphabetical List   Data Structures   File List   Data Fields   Globals  

cache.h File Reference

cache is a way to retrieve faster data associated with hashindexes. More...

#include "hash.h"

Include dependency graph for cache.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Typedefs

typedef _cachecache_t
 a cache is actually a pointer to a _cache structure.

typedef void *(* cache_missfunc_t )(hashindex_t TAG, void *PARM)
 cache-miss callback function type. More...

typedef int(* cache_invfunc_t )(hashindex_t *PTAG, void **PDATA, void *PARM)
 cache-invalidation callback function type. More...


Functions

void cache_init (cache_t *CACHE, size_t SIZE, cache_missfunc_t MISSFUNC, cache_invfunc_t INVFUNC)
 initialises the cache. More...

void cache_finish (cache_t CACHE)
 finalises the cache. More...

void * cache_lookup (cache_t CACHE, hashindex_t TAG, void *PARM)
 the purpose of the cache - to lookup data associated with a tag. More...

int cache_invalidate (cache_t CACHE, void *PARM)
 cache invalidation. More...

void cache_enable (cache_t CACHE)
 enables a cache. More...

void cache_disable (cache_t CACHE)
 disables a cache. More...

void cache_status (cache_t CACHE, FILE *F, char const *NAME, int PREC)
 outputs the status of a cache. More...


Detailed Description

cache is a way to retrieve faster data associated with hashindexes.

Author:
Sebastian Glita
Note:
the cache uses actually the Least-Recently-Used algorithm.
See also:
share/hash.h
You can lookup data associated with a tag through a cache, which is also the way to fill-up and classify by LRU the cache entries. Also, intrinsec to a cache is the fact that it may hold associations which have become invalid between lookups: so the user-program must explicitly invalidate the entire cache or only some entries.

Definition in file cache.h.


Generated on Thu Jan 9 19:02:41 2003 for plint by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002