VTK
Classes | Public Member Functions | Protected Attributes | List of all members
vtkTextureImageCache< Key > Class Template Reference

#include <vtkOpenGLContextDevice2DPrivate.h>

Inheritance diagram for vtkTextureImageCache< Key >:
[legend]

Classes

struct  CacheData
 
struct  CacheElement
 CacheElement associates a unique key to some cache. More...
 

Public Member Functions

 vtkTextureImageCache ()
 Construct a texture image cache with a maximum number of texture of 50. More...
 
bool IsKeyInCache (const Key &key) const
 Search the cache list to see if a given key already exists. More...
 
CacheDataGetCacheData (const Key &key)
 Return the cache associated to a key. More...
 
 vtkTextureImageCache ()
 Construct a texture image cache with a maximum number of texture of 50. More...
 
bool IsKeyInCache (const Key &key) const
 Search the cache list to see if a given key already exists. More...
 
CacheDataGetCacheData (const Key &key)
 Return the cache associated to a key. More...
 
void ReleaseGraphicsResources (vtkWindow *window)
 Release all the OpenGL Pixel Buffer Object(PBO) associated with the textures of the cache list. More...
 
void ReleaseGraphicsResources (vtkWindow *window)
 Release all the OpenGL Pixel Buffer Object(PBO) associated with the textures of the cache list. More...
 

Protected Member Functions

CacheDataAddCacheData (const Key &key, const CacheData &cacheData)
 Add a new cache entry into the cache list. More...
 
CacheDataAddCacheData (const Key &key, const CacheData &cacheData)
 Add a new cache entry into the cache list. More...
 

Protected Attributes

std::list< CacheElementCache
 List of a pair of key and cache data. More...
 
size_t MaxSize
 Maximum size the cache list can be. More...
 

Detailed Description

template<class Key>
class vtkTextureImageCache< Key >

Definition at line 54 of file vtkOpenGLContextDevice2DPrivate.h.

Constructor & Destructor Documentation

template<class Key>
vtkTextureImageCache< Key >::vtkTextureImageCache ( )
inline

Construct a texture image cache with a maximum number of texture of 50.

Definition at line 98 of file vtkOpenGLContextDevice2DPrivate.h.

template<class Key>
vtkTextureImageCache< Key >::vtkTextureImageCache ( )
inline

Construct a texture image cache with a maximum number of texture of 50.

Definition at line 98 of file vtkOpenGLContextDevice2DPrivate.h.

Member Function Documentation

template<class Key>
bool vtkTextureImageCache< Key >::IsKeyInCache ( const Key &  key) const
inline

Search the cache list to see if a given key already exists.

Returns true if the key is found, false otherwise.

Definition at line 107 of file vtkOpenGLContextDevice2DPrivate.h.

template<class Key>
vtkTextureImageCache< Key >::CacheData & vtkTextureImageCache< Key >::GetCacheData ( const Key &  key)

Return the cache associated to a key.

If the key doesn't exist yet in the cache list, create a new cache. The returned cache is moved at the beginning of the cache list for faster search next time. The most use cache is faster to be searched.

Definition at line 167 of file vtkOpenGLContextDevice2DPrivate.h.

template<class Key>
void vtkTextureImageCache< Key >::ReleaseGraphicsResources ( vtkWindow window)
inline

Release all the OpenGL Pixel Buffer Object(PBO) associated with the textures of the cache list.

Definition at line 125 of file vtkOpenGLContextDevice2DPrivate.h.

template<class Key>
CacheData& vtkTextureImageCache< Key >::AddCacheData ( const Key &  key,
const CacheData cacheData 
)
inlineprotected

Add a new cache entry into the cache list.

Enforce the MaxSize size of the list by removing the least used cache if needed.

Definition at line 141 of file vtkOpenGLContextDevice2DPrivate.h.

template<class Key>
bool vtkTextureImageCache< Key >::IsKeyInCache ( const Key &  key) const
inline

Search the cache list to see if a given key already exists.

Returns true if the key is found, false otherwise.

Definition at line 107 of file vtkOpenGLContextDevice2DPrivate.h.

template<class Key>
CacheData& vtkTextureImageCache< Key >::GetCacheData ( const Key &  key)

Return the cache associated to a key.

If the key doesn't exist yet in the cache list, create a new cache. The returned cache is moved at the beginning of the cache list for faster search next time. The most use cache is faster to be searched.

template<class Key>
void vtkTextureImageCache< Key >::ReleaseGraphicsResources ( vtkWindow window)
inline

Release all the OpenGL Pixel Buffer Object(PBO) associated with the textures of the cache list.

Definition at line 125 of file vtkOpenGLContextDevice2DPrivate.h.

template<class Key>
CacheData& vtkTextureImageCache< Key >::AddCacheData ( const Key &  key,
const CacheData cacheData 
)
inlineprotected

Add a new cache entry into the cache list.

Enforce the MaxSize size of the list by removing the least used cache if needed.

Definition at line 141 of file vtkOpenGLContextDevice2DPrivate.h.

Member Data Documentation

template<class Key>
std::list< CacheElement > vtkTextureImageCache< Key >::Cache
protected

List of a pair of key and cache data.

Definition at line 156 of file vtkOpenGLContextDevice2DPrivate.h.

template<class Key>
size_t vtkTextureImageCache< Key >::MaxSize
protected

Maximum size the cache list can be.

Definition at line 161 of file vtkOpenGLContextDevice2DPrivate.h.


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