Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

ACE_Filecache_Object Class Reference

Abstraction over a real file. This is what the Virtual Filesystem contains. This class is not intended for general consumption. Please consult a physician before attempting to use this class. More...

#include <Filecache.h>

Collaboration diagram for ACE_Filecache_Object:

Collaboration graph
[legend]
List of all members.

Public Types

enum  Creation_States { ACE_READING = 1, ACE_WRITING = 2 }
enum  Error_Conditions {
  ACE_SUCCESS = 0, ACE_ACCESS_FAILED, ACE_OPEN_FAILED, ACE_COPY_FAILED,
  ACE_STAT_FAILED, ACE_MEMMAP_FAILED, ACE_WRITE_FAILED
}

Public Methods

 ACE_Filecache_Object (const ACE_TCHAR *filename, ACE_SYNCH_RW_MUTEX &lock, LPSECURITY_ATTRIBUTES sa = 0, int mapit = 1)
 Creates a file for reading.

 ACE_Filecache_Object (const ACE_TCHAR *filename, int size, ACE_SYNCH_RW_MUTEX &lock, LPSECURITY_ATTRIBUTES sa = 0)
 Creates a file for writing.

 ~ACE_Filecache_Object (void)
 Only if reference count is zero should this be called.

int acquire (void)
 Increment the reference_count_.

int release (void)
 Decrement the reference_count_.

int error (void) const
int error (int error_value, const ACE_TCHAR *s = ACE_LIB_TEXT ("ACE_Filecache_Object"))
const ACE_TCHARfilename (void) const
 filename_ accessor.

ACE_HANDLE handle (void) const
 handle_ accessor.

void* address (void) const
 Base memory address for memory mapped file.

size_t size (void) const
 size_ accessor.

int update (void) const
 True if file on disk is newer than cached file.


Protected Methods

 ACE_Filecache_Object (void)
 Prevent from being called.

void init (void)
 Common initialization code,.


Private Methods

int error_i (int error_value, const ACE_TCHAR *s = ACE_LIB_TEXT ("ACE_Filecache_Object"))
 Internal error logging method, no locking.


Private Attributes

ACE_TCHARtempname_
 The temporary file name and the real file name. The real file is copied into the temporary file for safety reasons.

ACE_TCHAR filename_ [MAXPATHLEN + 1]
ACE_Mem_Map mmap_
 mmap_ holds the memory mapped version of the temporary file. handle_ is the descriptor to the temporary file.

ACE_HANDLE handle_
ACE_stat stat_
 Used to compare against the real file to test if an update is needed.

size_t size_
int action_
 Status indicators.

int error_
int stale_
 If set to 1, means the object is flagged for removal.

LPSECURITY_ATTRIBUTES sa_
 Security attribute object.

ACE_SYNCH_RW_MUTEX junklock_
 lock_ provides a bookkeeping mechanism for users of this object. junklock_ is the default initializer.

ACE_SYNCH_RW_MUTEX& lock_

Friends

class  ACE_Filecache

Detailed Description

Abstraction over a real file. This is what the Virtual Filesystem contains. This class is not intended for general consumption. Please consult a physician before attempting to use this class.


Member Enumeration Documentation

enum ACE_Filecache_Object::Creation_States
 

Enumeration values:
ACE_READING  
ACE_WRITING  

enum ACE_Filecache_Object::Error_Conditions
 

Enumeration values:
ACE_SUCCESS  
ACE_ACCESS_FAILED  
ACE_OPEN_FAILED  
ACE_COPY_FAILED  
ACE_STAT_FAILED  
ACE_MEMMAP_FAILED  
ACE_WRITE_FAILED  


Constructor & Destructor Documentation

ACE_Filecache_Object::ACE_Filecache_Object ( const ACE_TCHAR * filename,
ACE_SYNCH_RW_MUTEX & lock,
LPSECURITY_ATTRIBUTES sa = 0,
int mapit = 1 )
 

Creates a file for reading.

ACE_Filecache_Object::ACE_Filecache_Object ( const ACE_TCHAR * filename,
int size,
ACE_SYNCH_RW_MUTEX & lock,
LPSECURITY_ATTRIBUTES sa = 0 )
 

Creates a file for writing.

ACE_Filecache_Object::~ACE_Filecache_Object ( void )
 

Only if reference count is zero should this be called.

ACE_Filecache_Object::ACE_Filecache_Object ( void ) [protected]
 

Prevent from being called.


Member Function Documentation

int ACE_Filecache_Object::acquire ( void )
 

Increment the reference_count_.

void * ACE_Filecache_Object::address ( void ) const
 

Base memory address for memory mapped file.

int ACE_Filecache_Object::error ( int error_value,
const ACE_TCHAR * s = ACE_LIB_TEXT ("ACE_Filecache_Object") )
 

int ACE_Filecache_Object::error ( void ) const
 

int ACE_Filecache_Object::error_i ( int error_value,
const ACE_TCHAR * s = ACE_LIB_TEXT ("ACE_Filecache_Object") ) [private]
 

Internal error logging method, no locking.

const ACE_TCHAR * ACE_Filecache_Object::filename ( void ) const
 

filename_ accessor.

ACE_HANDLE ACE_Filecache_Object::handle ( void ) const
 

handle_ accessor.

void ACE_Filecache_Object::init ( void ) [protected]
 

Common initialization code,.

int ACE_Filecache_Object::release ( void )
 

Decrement the reference_count_.

size_t ACE_Filecache_Object::size ( void ) const
 

size_ accessor.

int ACE_Filecache_Object::update ( void ) const
 

True if file on disk is newer than cached file.


Friends And Related Function Documentation

class ACE_Filecache [friend]
 


Member Data Documentation

int ACE_Filecache_Object::action_ [private]
 

Status indicators.

int ACE_Filecache_Object::error_ [private]
 

ACE_TCHAR ACE_Filecache_Object::filename_[MAXPATHLEN+1] [private]
 

ACE_HANDLE ACE_Filecache_Object::handle_ [private]
 

ACE_SYNCH_RW_MUTEX ACE_Filecache_Object::junklock_ [private]
 

lock_ provides a bookkeeping mechanism for users of this object. junklock_ is the default initializer.

ACE_SYNCH_RW_MUTEX & ACE_Filecache_Object::lock_ [private]
 

ACE_Mem_Map ACE_Filecache_Object::mmap_ [private]
 

mmap_ holds the memory mapped version of the temporary file. handle_ is the descriptor to the temporary file.

LPSECURITY_ATTRIBUTES ACE_Filecache_Object::sa_ [private]
 

Security attribute object.

size_t ACE_Filecache_Object::size_ [private]
 

int ACE_Filecache_Object::stale_ [private]
 

If set to 1, means the object is flagged for removal.

ACE_stat ACE_Filecache_Object::stat_ [private]
 

Used to compare against the real file to test if an update is needed.

ACE_TCHAR * ACE_Filecache_Object::tempname_ [private]
 

The temporary file name and the real file name. The real file is copied into the temporary file for safety reasons.


The documentation for this class was generated from the following files:
Generated at Wed Nov 21 10:30:28 2001 for ACE by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000