Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Class Members | File Members

CachedFileFactory Class Reference

List of all members.

Public Member Functions

 CachedFileFactory (u_long m)
 CachedFileFactory ()
void clean ()
u_long getMaxSize ()
u_long getMinSize ()
void initialize (u_long size)
void nullReferences (CachedFileBuffer *cfb)
Fileopen (const char *file)
void setMaxSize (u_long maxSize)
void setMinSize (u_long minSize)
void setSize (u_long m)
 ~CachedFileFactory ()

Protected Member Functions

u_long purgeRecords ()

Protected Attributes

HashMap< char *, CachedFileFactoryRecord * > buffers
list< CachedFileFactoryRecord * > buffersToRemove
u_long created
u_long maxSize
u_long minSize
Mutex mutex
u_long size
u_long used
u_long usedSize

Constructor & Destructor Documentation

CachedFileFactory::CachedFileFactory  ) 
 

Default constructor.

CachedFileFactory::~CachedFileFactory  ) 
 

Destructor.

CachedFileFactory::CachedFileFactory u_long  size  ) 
 

Class constructor.

Parameters:
m Max size to use for the cache.


Member Function Documentation

void CachedFileFactory::clean  ) 
 

Clean the used resources.

u_long CachedFileFactory::getMaxSize  ) 
 

Get the max dimension for a file in the cache.

Returns:
The current max value.

u_long CachedFileFactory::getMinSize  ) 
 

Get the min dimension for a file in the cache.

Returns:
The current min value.

void CachedFileFactory::initialize u_long  size  ) 
 

Initialize the structure.

void CachedFileFactory::nullReferences CachedFileBuffer cfb  ) 
 

Called by CachedFileBuffer when its counter reaches zero references.

Parameters:
cfb A pointer to the source CachedFileBuffer object.

File * CachedFileFactory::open const char *  filename  ) 
 

Open a new file in read-only mode, if the file is present in the cache then use the cache instead of a real file.

Parameters:
file The file name.

u_long CachedFileFactory::purgeRecords  )  [protected]
 

Remove pending records from the list.

void CachedFileFactory::setMaxSize u_long  maxSize  ) 
 

Set the max dimension for a file in the cache.

Parameters:
maxSize The new value.

void CachedFileFactory::setMinSize u_long  minSize  ) 
 

Set the min dimension for a file in the cache.

Parameters:
minSize The new value.

void CachedFileFactory::setSize u_long  m  ) 
 


Member Data Documentation

HashMap<char*, CachedFileFactoryRecord*> CachedFileFactory::buffers [protected]
 

list<CachedFileFactoryRecord*> CachedFileFactory::buffersToRemove [protected]
 

u_long CachedFileFactory::created [protected]
 

Cache creation time.

u_long CachedFileFactory::maxSize [protected]
 

Max size for single file.

u_long CachedFileFactory::minSize [protected]
 

Min size for single file.

Mutex CachedFileFactory::mutex [protected]
 

u_long CachedFileFactory::size [protected]
 

Max elements count for this cache.

u_long CachedFileFactory::used [protected]
 

Number of times the cache was used.

u_long CachedFileFactory::usedSize [protected]
 

Size currently used.


Generated on Thu May 1 12:41:00 2008 for MyServer by  doxygen 1.3.9.1