## NAME

ACE_Filecache_Object - 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.

## SYNOPSIS

    #include <ace/Filecache.h>

    class ACE_Filecache_Object
    {
      public:
        friend class ACE_Filecache;
        ACE_Filecache_Object (
            const char *filename,
            ACE_SYNCH_RW_MUTEX &lock,
            LPSECURITY_ATTRIBUTES sa = 0,
            int mapit = 1
            );
        ACE_Filecache_Object (
            const char *filename,
            int size,
            ACE_SYNCH_RW_MUTEX &lock,
            LPSECURITY_ATTRIBUTES sa = 0
            );
        ~ACE_Filecache_Object (void);
        int acquire (void);
        int release (void);
        int error (void) const;
        int error (
            int error_value,
            const char *s = "ACE_Filecache_Object"
            );
        const char *filename (void) const;
        ACE_HANDLE handle (void) const;
        void *address (void) const;
        size_t size (void) const;
        int update (void) const;
        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 };

      protected:
        ACE_Filecache_Object (void);
        void init (void);
      private:
        int error_i (
            int error_value,
            const char *s = "ACE_Filecache_Object"
            );
        char *tempname_;
        char filename_[MAXPATHLEN + 1];
        ACE_Mem_Map mmap_;
        ACE_HANDLE handle_;
        size_t size_;
        int action_;
        int error_;
        int stale_;
        LPSECURITY_ATTRIBUTES sa_;
        ACE_SYNCH_RW_MUTEX junklock_;
        ACE_SYNCH_RW_MUTEX &lock_;
    };

## error_ accessors

    int error (void) const;

    int error (int error_value, const char *s = "ACE_Filecache_Object");

    const char *filename (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.

## AUTHOR

James Hu

## LIBRARY

ace