HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GusdUT_CappedCache Class Reference

#include <UT_CappedCache.h>

+ Inheritance diagram for GusdUT_CappedCache:

Public Member Functions

 GusdUT_CappedCache (const char *name, int64 size_in_mb=32)
 
 ~GusdUT_CappedCache ()
 
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 ()
 
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)
 
virtual const char * utGetCacheName () const
 
virtual bool utHasMaxSize () const
 
virtual int64 utGetCurrentSize () const
 
virtual int64 utGetMaxSize () const
 
virtual void utSetMaxSize (int64 bytes)
 
virtual int64 utReduceCacheSizeBy (int64 bytes)
 
- Public Member Functions inherited from UT_Cache
 UT_Cache ()
 
virtual ~UT_Cache ()
 
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...
 

Detailed Description

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.

Constructor & Destructor Documentation

GusdUT_CappedCache::GusdUT_CappedCache ( const char *  name,
int64  size_in_mb = 32 
)
inline

Definition at line 85 of file UT_CappedCache.h.

GusdUT_CappedCache::~GusdUT_CappedCache ( )
inline

Definition at line 87 of file UT_CappedCache.h.

Member Function Documentation

template<typename MatchFn >
int64 GusdUT_CappedCache::ClearEntries ( const MatchFn &  matchFn)

Definition at line 170 of file UT_CappedCache.h.

template<typename Item >
UT_IntrusivePtr< const Item > GusdUT_CappedCache::Find ( const UT_CappedKey key)

Definition at line 129 of file UT_CappedCache.h.

template<typename Item , typename Creator , typename... Args>
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.

template<typename T , typename Creator , typename... Args>
bool GusdUT_CappedCache::FindOrCreateVal ( const UT_CappedKey key,
const Creator &  creator,
Args &...  args 
)
template<typename T >
bool GusdUT_CappedCache::FindVal ( const UT_CappedKey key)

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