Ptex: PtexCacheImpl Class Reference

Ptex

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Private Attributes | List of all members
PtexCacheImpl Class Reference

Ptex cache implementation. More...

`#include <PtexCache.h>`

Inheritance diagram for PtexCacheImpl:

## Public Member Functions
| PtexCacheImpl (int maxFiles, int maxMem)
virtual void | release ()
| Release resources held by this pointer (pointer becomes invalid). More...
void | setPendingDelete ()
void | handlePendingDelete ()
void | setFileInUse (PtexLruItem *file)
void | setFileUnused (PtexLruItem *file)
void | removeFile ()
void | setDataInUse (PtexLruItem *data, int size)
void | setDataUnused (PtexLruItem *data, int size)
void | removeData (int size)
void | purgeFiles ()
void | purgeData ()
Public Member Functions inherited from PtexCache
virtual void | setSearchPath (const char *path)=0
| Set a search path for finding textures. More...
virtual const char * | getSearchPath ()=0
| Query the search path. More...
virtual PtexTexture * | get (const char *path, Ptex::String &error)=0
| Open a texture. More...
virtual void | purge (PtexTexture *texture)=0
| Remove a texture file from the cache. More...
virtual void | purge (const char *path)=0
| Remove a texture file from the cache by pathname. More...
virtual void | purgeAll ()=0
| Remove all texture files from the cache. More...

## Static Public Member Functions
static void | addFile ()
static void | addData ()
Static Public Member Functions inherited from PtexCache
static PtexCache * | create (int maxFiles=0, int maxMem=0, bool premultiply=false, PtexInputHandler *handler=0)
| Create a cache with the specified limits. More...

## Public Attributes
Mutex | openlock
CacheLock | cachelock

## Protected Member Functions
| ~PtexCacheImpl ()
Protected Member Functions inherited from PtexCache
virtual | ~PtexCache ()
| Destructor not for public use. Use release() instead. More...

## Private Attributes
bool | _pendingDelete
int | _maxFiles
int | _unusedFileCount
long int | _maxDataSize
long int | _unusedDataSize
int | _minDataCount
int | _unusedDataCount
PtexLruList | _unusedFiles
PtexLruList | _unusedData

## Detailed Description

Ptex cache implementation.

Maintains a file and memory cache within set limits

Definition at line 192 of file PtexCache.h.

## Constructor & Destructor Documentation

PtexCacheImpl::PtexCacheImpl | ( | int | maxFiles,
|  | int | maxMem
| ) |  |
| inline

Definition at line 194 of file PtexCache.h.

PtexCacheImpl::~PtexCacheImpl | ( |  | ) |
| protected

Definition at line 146 of file PtexCache.cpp.

References _unusedData, _unusedFiles, cachelock, and PtexLruList::pop().

## Member Function Documentation

static void PtexCacheImpl::addData | ( |  | ) |
| inlinestatic

Definition at line 227 of file PtexCache.h.

References STATS_INC.

static void PtexCacheImpl::addFile | ( |  | ) |
| inlinestatic

Definition at line 223 of file PtexCache.h.

References STATS_INC.

void PtexCacheImpl::handlePendingDelete | ( |  | ) |
| inline

Definition at line 220 of file PtexCache.h.

Referenced by PtexReader::release(), and PtexReader::TiledFaceBase::release().

void PtexCacheImpl::purgeData | ( |  | ) |
| inline

Definition at line 240 of file PtexCache.h.

Referenced by PtexReader::blendFaces(), PtexReader::readLevel(), PtexReader::readMetaData(), PtexReader::TiledFace::readTile(), PtexReader::PackedFace::reduce(), and PtexReader::TiledFaceBase::reduce().

void PtexCacheImpl::purgeFiles | ( |  | ) |
| inline

Definition at line 232 of file PtexCache.h.

Referenced by PtexReaderCache::get().

virtual void PtexCacheImpl::release | ( |  | ) |
| inlinevirtual

Release resources held by this pointer (pointer becomes invalid).

Implements PtexCache.

Definition at line 213 of file PtexCache.h.

void PtexCacheImpl::removeData | ( | int | size | ) |

Definition at line 192 of file PtexCache.cpp.

References _unusedDataCount, _unusedDataSize, and STATS_INC.

void PtexCacheImpl::removeFile | ( |  | ) |

Definition at line 169 of file PtexCache.cpp.

References _unusedFileCount, and STATS_INC.

void PtexCacheImpl::setDataInUse | ( | PtexLruItem * | data,
|  | int | size
| ) |  |

Definition at line 176 of file PtexCache.cpp.

References _unusedData, _unusedDataCount, _unusedDataSize, cachelock, and PtexLruList::extract().

void PtexCacheImpl::setDataUnused | ( | PtexLruItem * | data,
|  | int | size
| ) |  |

Definition at line 184 of file PtexCache.cpp.

References _unusedData, _unusedDataCount, _unusedDataSize, cachelock, and PtexLruList::push().

void PtexCacheImpl::setFileInUse | ( | PtexLruItem * | file | ) |

Definition at line 155 of file PtexCache.cpp.

References _unusedFileCount, _unusedFiles, cachelock, and PtexLruList::extract().

void PtexCacheImpl::setFileUnused | ( | PtexLruItem * | file | ) |

Definition at line 162 of file PtexCache.cpp.

References _unusedFileCount, _unusedFiles, cachelock, and PtexLruList::push().

void PtexCacheImpl::setPendingDelete | ( |  | ) |
| inline

Definition at line 219 of file PtexCache.h.

Referenced by PtexReader::~PtexReader().

## Member Data Documentation

long int PtexCacheImpl::_maxDataSize
| private

Definition at line 258 of file PtexCache.h.

int PtexCacheImpl::_maxFiles
| private

Definition at line 257 of file PtexCache.h.

int PtexCacheImpl::_minDataCount
| private

Definition at line 259 of file PtexCache.h.

bool PtexCacheImpl::_pendingDelete
| private

Definition at line 255 of file PtexCache.h.

PtexLruList PtexCacheImpl::_unusedData
| private

Definition at line 260 of file PtexCache.h.

Referenced by setDataInUse(), setDataUnused(), and ~PtexCacheImpl().

int PtexCacheImpl::_unusedDataCount
| private

Definition at line 259 of file PtexCache.h.

Referenced by removeData(), setDataInUse(), and setDataUnused().

long int PtexCacheImpl::_unusedDataSize
| private

Definition at line 258 of file PtexCache.h.

Referenced by removeData(), setDataInUse(), and setDataUnused().

int PtexCacheImpl::_unusedFileCount
| private

Definition at line 257 of file PtexCache.h.

Referenced by removeFile(), setFileInUse(), and setFileUnused().

PtexLruList PtexCacheImpl::_unusedFiles
| private

Definition at line 260 of file PtexCache.h.

Referenced by setFileInUse(), setFileUnused(), and ~PtexCacheImpl().

CacheLock PtexCacheImpl::cachelock

Definition at line 216 of file PtexCache.h.

Referenced by PtexReader::blendFaces(), PtexReaderCache::get(), PtexReader::getData(), PtexReader::MetaData::getEntry(), PtexReader::getMetaData(), PtexReader::TiledReducedFace::getTile(), PtexReaderCache::purge(), PtexReaderCache::purgeAll(), PtexReader::readFace(), PtexReader::readLevel(), PtexReader::readMetaData(), PtexReader::TiledFace::readTile(), PtexReader::PackedFace::reduce(), PtexReader::ConstantFace::reduce(), PtexReader::TiledFaceBase::reduce(), PtexReader::release(), setDataInUse(), setDataUnused(), setFileInUse(), setFileUnused(), and ~PtexCacheImpl().

Mutex PtexCacheImpl::openlock

Definition at line 215 of file PtexCache.h.

Referenced by PtexReaderCache::get(), PtexReaderCache::getSearchPath(), and PtexReaderCache::setSearchPath().

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

- PtexCache.h
- PtexCache.cpp