Annchienta::CacheManager Class Reference

List of all members.

Public Member Functions

 CacheManager ()
void clear ()
CacheablegetCacheable (const char *fileName, CacheableType cacheableType)
MaskgetMask (const char *fileName)
SoundgetSound (const char *fileName)
SurfacegetSurface (const char *fileName)
 ~CacheManager ()

Private Attributes

std::list< Cacheable * > cacheables


Detailed Description

This describes a class which is used to create an engine cache, so certain data objects can be loaded quicker.

Constructor & Destructor Documentation

Annchienta::CacheManager::CacheManager (  ) 

Annchienta::CacheManager::~CacheManager (  ) 


Member Function Documentation

void Annchienta::CacheManager::clear (  ) 

Clears the cache. All objects are removed from the cache.

Cacheable* Annchienta::CacheManager::getCacheable ( const char *  fileName,
CacheableType  cacheableType 
)

Fetches a Cacheable from the cache. It is better to use the getSurface(), getSound(), getMask()... functions when possible.

Parameters:
fileName Filename of the sought cacheable.
cacheableType CacheableType of the sought cacheable.
Returns:
The sought Cacheable.

Mask* Annchienta::CacheManager::getMask ( const char *  fileName  ) 

Fetches a Mask from the cache. The Mask is loaded if it isn't found in the cache.

Parameters:
fileName File to be loaded.
Returns:
The desired Mask.

Sound* Annchienta::CacheManager::getSound ( const char *  fileName  ) 

Fetches a Sound from the cache. The Sound is loaded if it isn't found in the cache.

Parameters:
fileName File to be loaded.
Returns:
The desired Sound.

Surface* Annchienta::CacheManager::getSurface ( const char *  fileName  ) 

Fetches a Surface from the cache. The Surface is loaded if it isn't found in the cache.

Parameters:
fileName File to be loaded.
Returns:
The desired Surface.


Member Data Documentation


Generated on Wed Feb 4 16:31:47 2009 for Annchienta by  doxygen 1.5.7.1