---
name: "ACE_Filecache"
section: "3"
platform: "linux"
package: "libace-doc"
version: "5.0.7-4"
release: "Debian 2.2 (Potato)"
platforms: ["linux"]
url: "https://new.carta.tech/ACE_Filecache"
---

# ACE\_Filecache(3)

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.

## NAME

ACE\_Filecache -  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.

## SYNOPSIS

```
#include <ace/Filecache.h>
class ACE_Filecache
{
  public:
    static ACE_Filecache *instance (void);
    ~ACE_Filecache (void);
    int find (const char *filename);
    ACE_Filecache_Object *fetch (const char *filename, int mapit = 1);
    ACE_Filecache_Object *remove (const char *filename);
    ACE_Filecache_Object *create (const char *filename, int size);
    ACE_Filecache_Object *finish (ACE_Filecache_Object *&new_file);
        enum{ ACE_DEFAULT_VIRTUAL_FILESYSTEM_TABLE_SIZE = 512,
        ACE_DEFAULT_VIRTUAL_FILESYSTEM_CACHE_SIZE = 20 };

  protected:
    ACE_Filecache_Object *insert_i (
        const char *filename,
        ACE_SYNCH_RW_MUTEX &filelock,
        int mapit
        );
    ACE_Filecache_Object *remove_i (const char *filename);
    ACE_Filecache_Object *update_i (
        const char *filename,
        ACE_SYNCH_RW_MUTEX &filelock,
        int mapit
        );
    ACE_Filecache (void);
  private:
    int size_;
    ACE_Filecache_Hash hash_;
    static ACE_Filecache *cvf_;
        ACE_SYNCH_RW_MUTEX hash_lock_[ACE_DEFAULT_VIRTUAL_FILESYSTEM_TABLE_SIZE];

        ACE_SYNCH_RW_MUTEX file_lock_[ACE_DEFAULT_VIRTUAL_FILESYSTEM_TABLE_SIZE];

};
```

## Synchronization variables.

```
    ACE_SYNCH_RW_MUTEX hash_lock_[ACE_DEFAULT_VIRTUAL_FILESYSTEM_TABLE_SIZE];

```

```
    ACE_SYNCH_RW_MUTEX file_lock_[ACE_DEFAULT_VIRTUAL_FILESYSTEM_TABLE_SIZE];

```

## AUTHOR

James Hu

## LIBRARY

ace
