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

#include <TIL_TileCache.h>

+ Inheritance diagram for TIL_TileCache:

Public Member Functions

 TIL_TileCache (TIL_TileManager *tman)
 
 ~TIL_TileCache ()
 
void setCacheSize (int size_in_kb, bool force_redo=false)
 
void setInactiveCacheReduce (bool enable, int size_in_kb)
 
void setExternalResourceUsage (int64 bytes_used)
 
void setCookMode (bool cook)
 
void clear ()
 
void lockCache ()
 
void unlockCache ()
 
TIL_TilegetCachedTile (UT_TokenString *&token, int x, int y, int xsize, int ysize, void *node, const TIL_Plane *plane, int array_index, int component, int image_index, bool create_flag, bool &blocked, bool &created, TIL_Storage storage)
 
TIL_TilegetBlackTile (UT_TokenString *&token, int x, int y, int xsize, int ysize, void *node, const TIL_Plane *plane, int array_index, int component, int image_index)
 
bool isTileInCache (const UT_TokenString *token, int x, int y)
 
bool areTilesInCache (const UT_TokenString *token, int x1, int y1, int x2, int y2)
 
int lockTile (TIL_Tile *tile, int access, int block=1)
 
void unlockTile (TIL_Tile *tile, int access)
 
void lockTileWriteToRead (TIL_Tile *tile, int score)
 
int isReadLocked (const TIL_Tile *t) const
 
int isWriteLocked (const TIL_Tile *t) const
 
void releaseTile (TIL_Tile *tile)
 
void freeTile (TIL_Tile *&tile)
 
void moveTileFromCacheToCheckpointList (const UT_TokenString *token, int xstart, int ystart, int xend, int yend, UT_ValArray< TIL_Tile * > &tile_list)
 
void decrementTileCheckpointCount (UT_ValArray< TIL_Tile * > &tile_list)
 
void possiblyResumeTrimming ()
 
void removeAllWithParent (void *node)
 
unsigned getNumCheckpointedTiles () const
 
unsigned int getNumLockedTiles () const
 
void uncheckpointAllTiles ()
 
void unlockAllTiles ()
 
int64 getCacheSize () const
 
int64 getMaxCacheSize () const
 
int64 getInactiveCacheSize () const
 
bool getInactiveReduce () const
 
TIL_TilegetTempTile ()
 
void returnTile (TIL_Tile *tile)
 
void dumpContents (std::ostream &os)
 
- 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 ()
 

Static Public Member Functions

static void cacheReducePing (UI_Timer *t, void *data)
 
static TIL_TileCachegetTileCache ()
 
- 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...
 

Protected Member Functions

const char * utGetCacheName () const override
 required - return the english name for this cache. More...
 
int64 utGetCurrentSize () const override
 required - return the current cache size, in bytes More...
 
bool utHasMaxSize () const override
 optional - override if the cache has a well defined maximum size More...
 
int64 utGetMaxSize () const override
 
void utSetMaxSize (int64 size) override
 
int64 utReduceCacheSizeBy (int64 amount) override
 

Detailed Description

Definition at line 39 of file TIL_TileCache.h.

Constructor & Destructor Documentation

TIL_TileCache::TIL_TileCache ( TIL_TileManager tman)
TIL_TileCache::~TIL_TileCache ( )

Member Function Documentation

bool TIL_TileCache::areTilesInCache ( const UT_TokenString token,
int  x1,
int  y1,
int  x2,
int  y2 
)
static void TIL_TileCache::cacheReducePing ( UI_Timer *  t,
void data 
)
static
void TIL_TileCache::clear ( )
void TIL_TileCache::decrementTileCheckpointCount ( UT_ValArray< TIL_Tile * > &  tile_list)
void TIL_TileCache::dumpContents ( std::ostream &  os)
void TIL_TileCache::freeTile ( TIL_Tile *&  tile)
TIL_Tile* TIL_TileCache::getBlackTile ( UT_TokenString *&  token,
int  x,
int  y,
int  xsize,
int  ysize,
void node,
const TIL_Plane plane,
int  array_index,
int  component,
int  image_index 
)
TIL_Tile* TIL_TileCache::getCachedTile ( UT_TokenString *&  token,
int  x,
int  y,
int  xsize,
int  ysize,
void node,
const TIL_Plane plane,
int  array_index,
int  component,
int  image_index,
bool  create_flag,
bool &  blocked,
bool &  created,
TIL_Storage  storage 
)
int64 TIL_TileCache::getCacheSize ( void  ) const
inline

Definition at line 169 of file TIL_TileCache.h.

int64 TIL_TileCache::getInactiveCacheSize ( ) const
inline

Definition at line 171 of file TIL_TileCache.h.

bool TIL_TileCache::getInactiveReduce ( ) const
inline

Definition at line 172 of file TIL_TileCache.h.

int64 TIL_TileCache::getMaxCacheSize ( ) const
inline

Definition at line 170 of file TIL_TileCache.h.

unsigned TIL_TileCache::getNumCheckpointedTiles ( ) const
inline

Definition at line 158 of file TIL_TileCache.h.

unsigned int TIL_TileCache::getNumLockedTiles ( ) const
inline

Definition at line 161 of file TIL_TileCache.h.

TIL_Tile* TIL_TileCache::getTempTile ( )
static TIL_TileCache* TIL_TileCache::getTileCache ( )
static
int TIL_TileCache::isReadLocked ( const TIL_Tile t) const
inline

Definition at line 124 of file TIL_TileCache.h.

bool TIL_TileCache::isTileInCache ( const UT_TokenString token,
int  x,
int  y 
)
int TIL_TileCache::isWriteLocked ( const TIL_Tile t) const
inline

Definition at line 126 of file TIL_TileCache.h.

void TIL_TileCache::lockCache ( )
inline

Definition at line 65 of file TIL_TileCache.h.

int TIL_TileCache::lockTile ( TIL_Tile tile,
int  access,
int  block = 1 
)
inline

Definition at line 115 of file TIL_TileCache.h.

void TIL_TileCache::lockTileWriteToRead ( TIL_Tile tile,
int  score 
)
inline

Definition at line 121 of file TIL_TileCache.h.

void TIL_TileCache::moveTileFromCacheToCheckpointList ( const UT_TokenString token,
int  xstart,
int  ystart,
int  xend,
int  yend,
UT_ValArray< TIL_Tile * > &  tile_list 
)
void TIL_TileCache::possiblyResumeTrimming ( )
void TIL_TileCache::releaseTile ( TIL_Tile tile)
void TIL_TileCache::removeAllWithParent ( void node)
void TIL_TileCache::returnTile ( TIL_Tile tile)
void TIL_TileCache::setCacheSize ( int  size_in_kb,
bool  force_redo = false 
)
void TIL_TileCache::setCookMode ( bool  cook)
void TIL_TileCache::setExternalResourceUsage ( int64  bytes_used)
inline

Definition at line 51 of file TIL_TileCache.h.

void TIL_TileCache::setInactiveCacheReduce ( bool  enable,
int  size_in_kb 
)
void TIL_TileCache::uncheckpointAllTiles ( )
void TIL_TileCache::unlockAllTiles ( )
void TIL_TileCache::unlockCache ( )
inline

Definition at line 66 of file TIL_TileCache.h.

void TIL_TileCache::unlockTile ( TIL_Tile tile,
int  access 
)
inline

Definition at line 118 of file TIL_TileCache.h.

const char* TIL_TileCache::utGetCacheName ( ) const
inlineoverrideprotectedvirtual

required - return the english name for this cache.

Implements UT_Cache.

Definition at line 189 of file TIL_TileCache.h.

int64 TIL_TileCache::utGetCurrentSize ( ) const
inlineoverrideprotectedvirtual

required - return the current cache size, in bytes

Implements UT_Cache.

Definition at line 190 of file TIL_TileCache.h.

int64 TIL_TileCache::utGetMaxSize ( ) const
inlineoverrideprotectedvirtual

Reimplemented from UT_Cache.

Definition at line 192 of file TIL_TileCache.h.

bool TIL_TileCache::utHasMaxSize ( ) const
inlineoverrideprotectedvirtual

optional - override if the cache has a well defined maximum size

Reimplemented from UT_Cache.

Definition at line 191 of file TIL_TileCache.h.

int64 TIL_TileCache::utReduceCacheSizeBy ( int64  amount)
overrideprotectedvirtual

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

Implements UT_Cache.

void TIL_TileCache::utSetMaxSize ( int64  size)
overrideprotectedvirtual

Reimplemented from UT_Cache.


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