summaryrefslogtreecommitdiff
path: root/ace/Filecache.cpp
diff options
context:
space:
mode:
authorSteve Huston <shuston@riverace.com>1997-08-20 23:27:37 +0000
committerSteve Huston <shuston@riverace.com>1997-08-20 23:27:37 +0000
commitcaa0c8e1eab259c65514c6fcb96666f95cec6ee9 (patch)
tree846ffcc55a9569ed733c95bd7de454aa8eb0f278 /ace/Filecache.cpp
parent3a40dd7d88bea8717d0bc2961d519b243bc8c78f (diff)
downloadATCD-caa0c8e1eab259c65514c6fcb96666f95cec6ee9.tar.gz
Moved definition of ACE_Filecache_Object from Filecache.cpp to Filecache.h
to help the AIX template instantiator along.
Diffstat (limited to 'ace/Filecache.cpp')
-rw-r--r--ace/Filecache.cpp107
1 files changed, 0 insertions, 107 deletions
diff --git a/ace/Filecache.cpp b/ace/Filecache.cpp
index 04c346a6ada..1a99d6afaa8 100644
--- a/ace/Filecache.cpp
+++ b/ace/Filecache.cpp
@@ -31,113 +31,6 @@ ACE_SYNCH_RW_MUTEX ACE_Filecache::lock_;
ACE_SYNCH_RW_MUTEX ACE_Filecache::hash_lock_[ACE_Filecache::DEFAULT_VIRTUAL_FILESYSTEM_TABLE_SIZE];
ACE_SYNCH_RW_MUTEX ACE_Filecache::file_lock_[ACE_Filecache::DEFAULT_VIRTUAL_FILESYSTEM_TABLE_SIZE];
-class ACE_Filecache_Object
- // = TITLE
- // 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.
-{
- friend class ACE_Filecache;
-
-public:
- ACE_Filecache_Object (const char *filename,
- ACE_SYNCH_RW_MUTEX &lock);
- // Creates a file for reading.
-
- ACE_Filecache_Object (const char *filename,
- int size,
- ACE_SYNCH_RW_MUTEX &lock);
- // 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_.
-
- // = 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.
-
-protected:
- ACE_Filecache_Object (void);
- // Prevent from being called.
-
- void init (void);
- // Common initialization code,
-
-private:
- int error_i (int error_value,
- const char *s = "ACE_Filecache_Object");
- // Internal error logging method, no locking.
-
-public:
-
- enum
- {
- READING = 1,
- WRITING = 2
- };
-
- enum
- {
- SUCCESS = 0,
- ACCESS_FAILED,
- OPEN_FAILED,
- COPY_FAILED,
- STAT_FAILED,
- MEMMAP_FAILED,
- WRITE_FAILED
- };
-
-private:
- char *tempname_;
- char filename_[MAXPATHLEN + 1];
- // The temporary file name and the real file name. The real file is
- // copied into the temporary file for safety reasons.
-
- ACE_Mem_Map mmap_;
- ACE_HANDLE handle_;
- // mmap_ holds the memory mapped version of the temporary file.
- // handle_ is the descriptor to the temporary file.
-
- struct stat stat_;
- size_t size_;
- // Used to compare against the real file to test if an update is needed.
-
- int action_;
- int error_;
- // Status indicators.
-
- int stale_;
- // If set to 1, means the object is flagged for removal.
-
- ACE_SYNCH_RW_MUTEX junklock_;
- ACE_SYNCH_RW_MUTEX &lock_;
- // lock_ provides a bookkeeping mechanism for users of this object.
- // junklock_ is the default initializer
-};
-
void
ACE_Filecache_Handle::init (void)
{