HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_Cache Class Referenceabstract

Common base class for various caches. More...

#include <UT_Cache.h>

+ Inheritance diagram for UT_Cache:

Public Member Functions

 UT_Cache ()
 
virtual ~UT_Cache ()
 
 UT_Cache (const UT_Cache &)=delete
 
UT_Cacheoperator= (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...
 

Detailed Description

Common base class for various caches.

Definition at line 21 of file UT_Cache.h.

Constructor & Destructor Documentation

UT_Cache::UT_Cache ( )
virtual UT_Cache::~UT_Cache ( )
virtual
UT_Cache::UT_Cache ( const UT_Cache )
delete

Member Function Documentation

UT_Cache& UT_Cache::operator= ( const UT_Cache )
delete
static void UT_Cache::setCacheAddRemoveCB ( void(*)(void *)  callback,
void data 
)
static

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)

static int64 UT_Cache::utClearSpaceFromCaches ( int64  amount)
static

this method attempts to free up 'amount' bytes from all the caches.

static const UT_ValArray<UT_Cache *>& UT_Cache::utGetCacheList ( )
static

get the list of caches

virtual const char* UT_Cache::utGetCacheName ( ) const
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.

virtual int64 UT_Cache::utGetCurrentSize ( ) const
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.

virtual int64 UT_Cache::utGetMaxSize ( ) const
inlinevirtual
virtual int64 UT_Cache::utGetMinSize ( ) const
inlinevirtual

Reimplemented in RE_BufferCache, and GT_PackedGeoCache.

Definition at line 53 of file UT_Cache.h.

virtual bool UT_Cache::utHasMaxSize ( ) const
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.

virtual bool UT_Cache::utHasMinSize ( ) const
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.

virtual int64 UT_Cache::utReduceCacheSizeBy ( int64  amount)
pure virtual

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.

virtual void UT_Cache::utSetMaxSize ( int64  )
inlinevirtual

Reimplemented in TIL_TileCache, TIL_ImageCache, OBJ_XformCache, UT_CappedCache, and RE_BufferCache.

Definition at line 48 of file UT_Cache.h.

virtual void UT_Cache::utSetMinSize ( int64  )
inlinevirtual

Definition at line 54 of file UT_Cache.h.

virtual bool UT_Cache::utUpdateCacheInfo ( )
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.


The documentation for this class was generated from the following file: