ACE 8.0.1
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
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]

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 Member Functions

 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, ACE_OFF_T size, ACE_SYNCH_RW_MUTEX &lock, LPSECURITY_ATTRIBUTES sa=0)
 Creates a file for writing.
 
 ~ACE_Filecache_Object ()
 Only if reference count is zero should this be called.
 
int acquire ()
 Increment the reference_count_.
 
int release ()
 Decrement the reference_count_.
 
int error () const
 
int error (int error_value, const ACE_TCHAR *s=ACE_TEXT("ACE_Filecache_Object"))
 
const ACE_TCHARfilename () const
 filename_ accessor
 
ACE_HANDLE handle () const
 handle_ accessor.
 
voidaddress () const
 Base memory address for memory mapped file.
 
ACE_OFF_T size () const
 size_ accessor.
 
int update () const
 True if file on disk is newer than cached file.
 

Public Attributes

 ACE_ALLOC_HOOK_DECLARE
 

Protected Member Functions

 ACE_Filecache_Object ()
 Prevent from being called.
 
void init ()
 Common initialization code,.
 

Private Member Functions

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

Private Attributes

ACE_TCHARtempname_
 
ACE_TCHAR filename_ [MAXPATHLEN+1]
 
ACE_Mem_Map mmap_
 Holds the memory mapped version of the temporary file.
 
ACE_HANDLE handle_
 The descriptor to the temporary file.
 
ACE_stat stat_
 Used to compare against the real file to test if an update is needed.
 
ACE_OFF_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_
 The default initializer.
 
ACE_SYNCH_RW_MUTEXlock_
 Provides a bookkeeping mechanism for users of this object.
 

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

◆ Creation_States

Enumerator
ACE_READING 
ACE_WRITING 

◆ Error_Conditions

Enumerator
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() [1/3]

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() [2/3]

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

Creates a file for writing.

◆ ~ACE_Filecache_Object()

ACE_Filecache_Object::~ACE_Filecache_Object ( )

Only if reference count is zero should this be called.

◆ ACE_Filecache_Object() [3/3]

ACE_Filecache_Object::ACE_Filecache_Object ( )
protected

Prevent from being called.

Member Function Documentation

◆ acquire()

int ACE_Filecache_Object::acquire ( )

Increment the reference_count_.

◆ address()

void * ACE_Filecache_Object::address ( ) const

Base memory address for memory mapped file.

◆ error() [1/2]

int ACE_Filecache_Object::error ( ) const

◆ error() [2/2]

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

◆ error_i()

int ACE_Filecache_Object::error_i ( int error_value,
const ACE_TCHAR * s = ACE_TEXT ("ACE_Filecache_Object") )
private

Internal error logging method, no locking.

◆ filename()

const ACE_TCHAR * ACE_Filecache_Object::filename ( ) const

filename_ accessor

◆ handle()

ACE_HANDLE ACE_Filecache_Object::handle ( ) const

handle_ accessor.

◆ init()

void ACE_Filecache_Object::init ( )
protected

Common initialization code,.

◆ release()

int ACE_Filecache_Object::release ( )

Decrement the reference_count_.

◆ size()

ACE_OFF_T ACE_Filecache_Object::size ( ) const

size_ accessor.

◆ update()

int ACE_Filecache_Object::update ( ) const

True if file on disk is newer than cached file.

Friends And Related Symbol Documentation

◆ ACE_Filecache

Member Data Documentation

◆ ACE_ALLOC_HOOK_DECLARE

ACE_Filecache_Object::ACE_ALLOC_HOOK_DECLARE

◆ action_

int ACE_Filecache_Object::action_
private

Status indicators.

◆ error_

int ACE_Filecache_Object::error_
private

◆ filename_

ACE_TCHAR ACE_Filecache_Object::filename_[MAXPATHLEN+1]
private

◆ handle_

ACE_HANDLE ACE_Filecache_Object::handle_
private

The descriptor to the temporary file.

◆ junklock_

ACE_SYNCH_RW_MUTEX ACE_Filecache_Object::junklock_
private

The default initializer.

◆ lock_

ACE_SYNCH_RW_MUTEX& ACE_Filecache_Object::lock_
private

Provides a bookkeeping mechanism for users of this object.

◆ mmap_

ACE_Mem_Map ACE_Filecache_Object::mmap_
private

Holds the memory mapped version of the temporary file.

◆ sa_

LPSECURITY_ATTRIBUTES ACE_Filecache_Object::sa_
private

Security attribute object.

◆ size_

ACE_OFF_T ACE_Filecache_Object::size_
private

◆ stale_

int ACE_Filecache_Object::stale_
private

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

◆ stat_

ACE_stat ACE_Filecache_Object::stat_
private

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

◆ tempname_

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: