HDK
|
#include <UT_CappedCache.h>
Public Member Functions | |
GusdUT_CappedCache (const char *name, int64 size_in_mb=32) | |
~GusdUT_CappedCache () override | |
template<typename Item > | |
UT_IntrusivePtr< const Item > | Find (const UT_CappedKey &key) |
template<typename Item , typename Creator , typename... Args> | |
UT_IntrusivePtr< const Item > | FindOrCreate (const UT_CappedKey &key, const Creator &creator, Args &...args) |
template<typename T > | |
bool | FindVal (const UT_CappedKey &key) |
template<typename T , typename Creator , typename... Args> | |
bool | FindOrCreateVal (const UT_CappedKey &key, const Creator &creator, Args &...args) |
template<typename MatchFn > | |
int64 | ClearEntries (const MatchFn &matchFn) |
Public Member Functions inherited from UT_CappedCache | |
UT_CappedCache (const char *name, int64 size_in_mb=32) | |
~UT_CappedCache () override | |
UT_CappedCache (const UT_CappedCache &)=delete | |
UT_CappedCache & | operator= (const UT_CappedCache &)=delete |
void | clear () |
Clear the cache. More... | |
exint | entries () const |
Number of entries in the cache. More... | |
exint | getListEntries () const |
UT_CappedItemHandle | findItem (const UT_CappedKey &key) |
Find an item in the cache. More... | |
UT_CappedItemHandle | addItem (const UT_CappedKey &key, const UT_CappedItemHandle &item) |
void | deleteItem (const UT_CappedKey &key) |
Remove an item from the cache. More... | |
template<typename T > | |
void | threadSafeTraversal (T &task) |
const char * | utGetCacheName () const override |
bool | utHasMaxSize () const override |
int64 | utGetCurrentSize () const override |
int64 | utGetMaxSize () const override |
void | utSetMaxSize (int64 bytes) override |
int64 | utReduceCacheSizeBy (int64 bytes) override |
Public Member Functions inherited from UT_Cache | |
UT_Cache () | |
virtual | ~UT_Cache () |
UT_Cache (const UT_Cache &)=delete | |
UT_Cache & | operator= (const UT_Cache &)=delete |
void | utClearCache () |
virtual bool | utHasMinSize () const |
virtual int64 | utGetMinSize () const |
virtual void | utSetMinSize (int64) |
virtual bool | utUpdateCacheInfo () |
Additional Inherited Members | |
Static Public Member Functions inherited from UT_Cache | |
static const UT_ValArray < UT_Cache * > & | utGetCacheList () |
get the list of caches More... | |
static void | setCacheAddRemoveCB (void(*callback)(void *), void *data) |
callback to be called when a cache is added or deleted. More... | |
static int64 | utClearSpaceFromCaches (int64 amount) |
this method attempts to free up 'amount' bytes from all the caches. More... | |
Variant of UT_CappedCache that improves on item construction. This adds in a mechanism for locking items during construction, to prevent multiple threads from performing the same work to initialize cache items.
Definition at line 82 of file UT_CappedCache.h.
Definition at line 85 of file UT_CappedCache.h.
|
inlineoverride |
Definition at line 87 of file UT_CappedCache.h.
Definition at line 170 of file UT_CappedCache.h.
UT_IntrusivePtr< const Item > GusdUT_CappedCache::Find | ( | const UT_CappedKey & | key | ) |
Definition at line 129 of file UT_CappedCache.h.
UT_IntrusivePtr< const Item > GusdUT_CappedCache::FindOrCreate | ( | const UT_CappedKey & | key, |
const Creator & | creator, | ||
Args &... | args | ||
) |
Definition at line 140 of file UT_CappedCache.h.
bool GusdUT_CappedCache::FindOrCreateVal | ( | const UT_CappedKey & | key, |
const Creator & | creator, | ||
Args &... | args | ||
) |
bool GusdUT_CappedCache::FindVal | ( | const UT_CappedKey & | key | ) |