ACE_Filecache Class Reference

A hash table holding the information about entry point into the Cached Virtual Filesystem. On insertion, the reference count is incremented. On destruction, reference count is decremented. More...

#include <Filecache.h>

Collaboration diagram for ACE_Filecache:

Collaboration graph
[legend]

List of all members.

Public Types

enum  { ACE_DEFAULT_VIRTUAL_FILESYSTEM_TABLE_SIZE = 512, ACE_DEFAULT_VIRTUAL_FILESYSTEM_CACHE_SIZE = 20 }

Public Member Functions

 ~ACE_Filecache (void)
int find (const ACE_TCHAR *filename)
ACE_Filecache_Objectfetch (const ACE_TCHAR *filename, int mapit=1)
ACE_Filecache_Objectremove (const ACE_TCHAR *filename)
 Remove the file associated with ``filename'' from the cache.
ACE_Filecache_Objectcreate (const ACE_TCHAR *filename, int size)
 Create a new Filecache_Object, returns it.
ACE_Filecache_Objectfinish (ACE_Filecache_Object *&new_file)

Static Public Member Functions

static ACE_Filecacheinstance (void)
 Singleton pattern.

Protected Member Functions

ACE_Filecache_Objectinsert_i (const ACE_TCHAR *filename, ACE_SYNCH_RW_MUTEX &filelock, int mapit)
ACE_Filecache_Objectremove_i (const ACE_TCHAR *filename)
ACE_Filecache_Objectupdate_i (const ACE_TCHAR *filename, ACE_SYNCH_RW_MUTEX &filelock, int mapit)
 ACE_Filecache (void)
 Prevent it from being called.

Private Attributes

ACE_OFF_T size_
ACE_Filecache_Hash hash_
 The hash table.
ACE_SYNCH_RW_MUTEX hash_lock_ [ACE_DEFAULT_VIRTUAL_FILESYSTEM_TABLE_SIZE]
ACE_SYNCH_RW_MUTEX file_lock_ [ACE_DEFAULT_VIRTUAL_FILESYSTEM_TABLE_SIZE]

Static Private Attributes

static ACE_Filecachecvf_ = 0
 The reference to the instance.


Detailed Description

A hash table holding the information about entry point into the Cached Virtual Filesystem. On insertion, the reference count is incremented. On destruction, reference count is decremented.

Member Enumeration Documentation

anonymous enum

Enumerator:
ACE_DEFAULT_VIRTUAL_FILESYSTEM_TABLE_SIZE  For this stupid implementation, use an array. Someday, use a balanced search tree, or real hash table.
ACE_DEFAULT_VIRTUAL_FILESYSTEM_CACHE_SIZE  This determines the highwater mark in megabytes for the cache. This will be ignored for now.


Constructor & Destructor Documentation

ACE_Filecache::~ACE_Filecache ( void   ) 

ACE_Filecache::ACE_Filecache ( void   )  [protected]

Prevent it from being called.


Member Function Documentation

ACE_Filecache * ACE_Filecache::instance ( void   )  [static]

Singleton pattern.

int ACE_Filecache::find ( const ACE_TCHAR filename  ) 

Returns 0 if the file associated with ``filename'' is in the cache, or -1 if not.

ACE_Filecache_Object * ACE_Filecache::fetch ( const ACE_TCHAR filename,
int  mapit = 1 
)

Return the file associated with ``filename'' if it is in the cache, or create if not.

ACE_Filecache_Object * ACE_Filecache::remove ( const ACE_TCHAR filename  ) 

Remove the file associated with ``filename'' from the cache.

ACE_Filecache_Object * ACE_Filecache::create ( const ACE_TCHAR filename,
int  size 
)

Create a new Filecache_Object, returns it.

ACE_Filecache_Object * ACE_Filecache::finish ( ACE_Filecache_Object *&  new_file  ) 

Release an acquired Filecache_Object, returns it again or NULL if it was deleted.

ACE_Filecache_Object * ACE_Filecache::insert_i ( const ACE_TCHAR filename,
ACE_SYNCH_RW_MUTEX &  filelock,
int  mapit 
) [protected]

ACE_Filecache_Object * ACE_Filecache::remove_i ( const ACE_TCHAR filename  )  [protected]

ACE_Filecache_Object * ACE_Filecache::update_i ( const ACE_TCHAR filename,
ACE_SYNCH_RW_MUTEX &  filelock,
int  mapit 
) [protected]


Member Data Documentation

The hash table.

ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_Filecache * ACE_Filecache::cvf_ = 0 [static, private]

The reference to the instance.

ACE_SYNCH_RW_MUTEX ACE_Filecache::hash_lock_[ACE_DEFAULT_VIRTUAL_FILESYSTEM_TABLE_SIZE] [private]

ACE_SYNCH_RW_MUTEX ACE_Filecache::file_lock_[ACE_DEFAULT_VIRTUAL_FILESYSTEM_TABLE_SIZE] [private]


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

Generated on Wed Apr 23 02:39:07 2008 for ACE by  doxygen 1.5.5