Public Methods
Protected Methods
- template
int Add ( const CKey& k, CBuf* b )
- template
const CBuf* Find ( const CKey& k )
- template
void Flush ( DeleteType dt )
- template
const CBuf* Fetch ( const CKey& k )
- template
void ForEach ( void (*func)(CKey&, CBuf&, void *), void *args )
Protected Members
Private Types
Private Members
template class TCache
template class TCacheIterator
Cache generica di oggetti CBuf associati a chiave CKey
Gli oggetti CKey sono memorizzati in forma diretta, mentre gli oggetti
CBuf sono memorizzati in forma indiretta (puntatori a).
Notare il costruttore: szQue è la dimensione della cache
L'oggetto chiave (CKey) è soggetto alle restrizioni delle HashTable
ossia deve avere un operatore di copia (=), uno di conronto (==) e
deve avere una funzione:
unsigned HashValue() const;
oppure deve esistere una funzione globale del tipo:
unsigned HashValue( const CKey& t );
Per prelevare gli oggetti dalla cache si usa la funzione Fetch; se
la chiave esiste viene ritornato l'oggetto CBuf associato, altrimenti
viene chiamata la funzione FillCache (ridefibile in classi derivate)
per reperire all'esterno l'oggetto; FillCache potrà a sua volta chia-
mare la funzione Add dopo aver reperito l'oggetto associato alla
chiave, per salvarlo nella cache.
typedef TCAssoc Association | Association |
[private]
[private]
[private]
friend class TCacheIterator
| TCacheIterator |
[private]
TCache ( unsigned szQue = DEFAULT_QUEUE_SIZE,
unsigned szDic = DEFAULT_HASH_TABLE_SIZE )
| TCache |
[virtual]
int OwnsElements ()
| OwnsElements |
Reimplemented from TShouldDelete.
void OwnsElements ( int del )
| OwnsElements |
Reimplemented from TShouldDelete.
int Add ( const CKey& k, CBuf* b )
| Add |
const CBuf * Find ( const CKey& k )
| Find |
const CBuf * Fetch ( const CKey& k )
| Fetch |
void Flush ( DeleteType dt = DefDelete )
| Flush |
const CBuf * FillCache ( const CKey& )
| FillCache |
[virtual]
void ForEach ( void (*func)(CKey&, CBuf&, void *), void *args )
| ForEach |
unsigned GetItemsInContainer ()
| GetItemsInContainer |
[const]
[const]
[const]
[protected]
[protected]
template
int Add ( const CKey& k, CBuf* b )
| Add |
[protected]
template
const CBuf* Find ( const CKey& k )
| Find |
[protected]
template
void Flush ( DeleteType dt )
| Flush |
[protected]
template
const CBuf* Fetch ( const CKey& k )
| Fetch |
[protected]
template
void ForEach ( void (*func)(CKey&, CBuf&, void *), void *args )
| ForEach |
[protected]
Generated by: nicola on gulliver.wadahome.it on Sun May 25 13:54:34 2003, using kdoc 2.0a53. |