Google

Main Page   Class Hierarchy   Compound List   File List   Compound Members  

csVfsCacheManager Class Reference

This is a general cache that can cache data on VFS. More...

#include <vfscache.h>

Inheritance diagram for csVfsCacheManager:

iCacheManager iBase List of all members.

Public Methods

 csVfsCacheManager (iObjectRegistry *object_reg, const char *vfsdir)
 Construct the cache manager with the given directory. More...

virtual ~csVfsCacheManager ()
virtual void SetCurrentType (const char *type)
 Set current type. More...

virtual const char* GetCurrentType () const
 Get current type or NULL if none set.

virtual void SetCurrentScope (const char *scope)
 Set current scope. More...

virtual const char* GetCurrentScope () const
 Get current scope or NULL if none set.

virtual bool CacheData (void *data, uint32 size, const char *type, const char *scope, uint32 id)
 Cache some data. More...

virtual iDataBufferReadCache (const char *type, const char *scope, uint32 id)
 Retreive some data from the cache. More...

virtual bool ClearCache (const char *type=NULL, const char *scope=NULL, const uint32 *id=NULL)
 Clear items from the cache. More...


Public Attributes

 SCF_DECLARE_IBASE

Detailed Description

This is a general cache that can cache data on VFS.


Constructor & Destructor Documentation

csVfsCacheManager::csVfsCacheManager ( iObjectRegistry * object_reg,
const char * vfsdir )
 

Construct the cache manager with the given directory.

All cached data will be put somewhere in that directory.


Member Function Documentation

virtual bool csVfsCacheManager::CacheData ( void * data,
uint32 size,
const char * type,
const char * scope,
uint32 id ) [virtual]
 

Cache some data.

Returns true if this succeeded.

Reimplemented from iCacheManager.

virtual bool csVfsCacheManager::ClearCache ( const char * type = NULL,
const char * scope = NULL,
const uint32 * id = NULL ) [virtual]
 

Clear items from the cache.

There are four ways to call this function:

  • NULL, NULL, NULL: clear entire cache.
  • 'type', NULL, NULL: clear everything of this type.
  • 'type', 'scope', NULL: clear everything of this type and scope.
  • 'type', 'scope', id: clear the specific item.
Returns true if items were deleted. Returns false if item was not found or deletion is not possible.

Reimplemented from iCacheManager.

virtual iDataBuffer* csVfsCacheManager::ReadCache ( const char * type,
const char * scope,
uint32 id ) [virtual]
 

Retreive some data from the cache.

Returns NULL if the data could not be found in the cache. The returned data buffer should be DecRef()'ed if you are ready with it.

Reimplemented from iCacheManager.

virtual void csVfsCacheManager::SetCurrentScope ( const char * scope ) [virtual]
 

Set current scope.

This will be used in CacheData() and ReadCache() when the given 'scope' there is NULL.

Reimplemented from iCacheManager.

virtual void csVfsCacheManager::SetCurrentType ( const char * type ) [virtual]
 

Set current type.

This will be used in CacheData() and ReadCache() when the given 'type' there is NULL.

Reimplemented from iCacheManager.


The documentation for this class was generated from the following file:
Generated for Crystal Space by doxygen 1.2.5 written by Dimitri van Heesch, ©1997-2000