HDK
|
Common base class for various caches. More...
#include <UT_Cache.h>
Public Member Functions | |
UT_Cache () | |
virtual | ~UT_Cache () |
UT_Cache (const UT_Cache &)=delete | |
UT_Cache & | operator= (const UT_Cache &)=delete |
void | utClearCache () |
virtual const char * | utGetCacheName () const =0 |
required - return the english name for this cache. More... | |
virtual int64 | utGetCurrentSize () const =0 |
required - return the current cache size, in bytes More... | |
virtual int64 | utReduceCacheSizeBy (int64 amount)=0 |
virtual bool | utHasMaxSize () const |
optional - override if the cache has a well defined maximum size More... | |
virtual int64 | utGetMaxSize () const |
virtual void | utSetMaxSize (int64) |
virtual bool | utHasMinSize () const |
virtual int64 | utGetMinSize () const |
virtual void | utSetMinSize (int64) |
virtual bool | utUpdateCacheInfo () |
Static Public Member Functions | |
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... | |
Common base class for various caches.
Definition at line 21 of file UT_Cache.h.
UT_Cache::UT_Cache | ( | ) |
|
virtual |
|
delete |
callback to be called when a cache is added or deleted.
void UT_Cache::utClearCache | ( | ) |
clear this cache. May not entirely clear the cache if some items are in use (depending on the cache)
this method attempts to free up 'amount' bytes from all the caches.
|
static |
get the list of caches
|
pure virtual |
required - return the english name for this cache.
Implemented in TIL_TileCache, TIL_ImageCache, OBJ_XformCache, UT_CappedCache, GT_PackedGeoCache, and RE_BufferCache.
|
pure virtual |
required - return the current cache size, in bytes
Implemented in TIL_TileCache, TIL_ImageCache, OBJ_XformCache, UT_CappedCache, GT_PackedGeoCache, and RE_BufferCache.
|
inlinevirtual |
Reimplemented in TIL_TileCache, TIL_ImageCache, OBJ_XformCache, UT_CappedCache, GT_PackedGeoCache, and RE_BufferCache.
Definition at line 47 of file UT_Cache.h.
|
inlinevirtual |
Reimplemented in RE_BufferCache, and GT_PackedGeoCache.
Definition at line 53 of file UT_Cache.h.
|
inlinevirtual |
optional - override if the cache has a well defined maximum size
Reimplemented in TIL_TileCache, TIL_ImageCache, OBJ_XformCache, UT_CappedCache, and RE_BufferCache.
Definition at line 46 of file UT_Cache.h.
|
inlinevirtual |
optional - override if the cache has a well defined minimum size (this doesn't include a current min size imposed by items locked in the cache)
Definition at line 52 of file UT_Cache.h.
required - free contents of the cache by amount
bytes. Returns the amount of memory (in bytes) actually freed. This does not change the cache size
Implemented in TIL_TileCache, OBJ_XformCache, TIL_ImageCache, UT_CappedCache, GT_PackedGeoCache, and RE_BufferCache.
Reimplemented in TIL_TileCache, TIL_ImageCache, OBJ_XformCache, UT_CappedCache, and RE_BufferCache.
Definition at line 48 of file UT_Cache.h.
Definition at line 54 of file UT_Cache.h.
|
inlinevirtual |
override in case a method needs to be run to get the most up-to-date cache information. Return true if it has changed.
Definition at line 58 of file UT_Cache.h.