Package pygccxml :: Package parser :: Module directory_cache :: Class directory_cache_t

# type directory_cache_t

source code

                         object --+
                                  |
    declarations_cache.cache_base_t --+
                                      |
                                     directory_cache_t

Cache class that stores its data as multiple files inside a directory.

The cache stores one index file called "index.dat" which is always read by the cache when the cache object is created. Each header file will have its corresponding *.cache file that stores the declarations found in the header file. The index file is used to determine whether a *.cache file is still valid or not (by checking if one of the dependent files (i.e. the header file itself and all included files) have been modified since the last run).

Instance Methods

__init__(self, dir=`'``cache``'`, compression=False, md5_sigs=True) Constructor. | source code

flush(self) Save the index table to disk. | source code

update(self, source_file, configuration, declarations, included_files) Replace a cache entry by a new value. | source code

cached_value(self, source_file, configuration) Return the cached declarations or None. | source code

Class Variables
Inherited from `declarations_cache.cache_base_t`: `logger`

Method Details

### __init__(self, dir=`'``cache``'`, compression=False, md5_sigs=True)
(Constructor)

source code

Constructor.

dir is the cache directory (it is created if it does not exist). If compression is set to True the cache files will be compressed using gzip. md5_sigs determines whether file modifications is checked by computing a md5 digest or by checking the modification date.

Overrides: declarations_cache.cache_base_t.__init__

### flush(self)

source code

Save the index table to disk.

Overrides: declarations_cache.cache_base_t.flush

### update(self, source_file, configuration, declarations, included_files)

source code

Replace a cache entry by a new value.

Parameters:
  - `source_file` (str) - Header file name.
  - `configuration` (config_t) - Configuration object.
  - `declarations` (picklable object) - Declarations contained in the header file.
  - `included_files` (list of str) - Dependent files
Overrides: declarations_cache.cache_base_t.update

### cached_value(self, source_file, configuration)

source code

Return the cached declarations or None.

Parameters:
  - `source_file` (str) - Header file name
  - `configuration` (config_t) - Configuration object
Returns:
  Cached declarations or None
Overrides: declarations_cache.cache_base_t.cached_value