lib
Class Cache
in cache_adt.h
- template < typename Key , typename Item , template < typename Key , class Entry > class Manager = Landlord_Cached , class Divider = Divider_Naive > class Cache
Constructor Summary |
Cache()
|
Method Summary |
void |
add( Key key, Item item, size_t size, uint cost )
|
bool |
empty() const
|
void |
remove( Key key )
|
bool |
remove_least_valuable( Item* pItem = 0, size_t* pSize = 0 )
|
bool |
retrieve( Key key, Item& item, size_t* psize = 0, bool refill_credit = true )
|
entries_awaiting_eviction
private std::list< Cache::Entry > entries_awaiting_eviction;
mgr
private Manager< Key, Cache::Entry > mgr;
Cache
public Cache();
add
public void add( Key key, Item item, size_t size, uint cost );
empty
public bool empty() const;
remove
public void remove( Key key );
remove_least_valuable
public bool remove_least_valuable( Item* pItem = 0, size_t* pSize = 0 );
retrieve
public bool retrieve( Key key, Item& item, size_t* psize = 0, bool refill_credit = true );