Package pygccxml :: Package parser :: Module declarations_cache :: Class file_cache_t

# type file_cache_t

source code

      object --+
               |
    cache_base_t --+
                   |
                  file_cache_t

Cache implementation to store data in a pickled form in a file. This class contains some cache logic that keeps track of which entries have been 'hit' in the cache and if an entry has not been hit then it is deleted at the time of the flush(). This keeps the cache from growing larger when files change and are not used again.

Instance Methods

__init__(self, name) | source code

flush(self) Flush (write out) the cache to disk if needed. | source code

update(self, source_file, configuration, declarations, included_files) Update a cached record with the current key and value contents. | source code

cached_value(self, source_file, configuration) Attempt to lookup the cached decls for the given file and configuration. | source code

Class Variables
Inherited from `cache_base_t`: `logger`

Method Details

### __init__(self, name)
(Constructor)

source code

Parameters:
  - `name` - name of the cache file.
Overrides: cache_base_t.__init__

### flush(self)

source code

Flush (write out) the cache to disk if needed.

Overrides: cache_base_t.flush
  (inherited documentation)

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

source code

Update a cached record with the current key and value contents.

Parameters:
  - `source_file` - path to the C++ source file being parsed
  - `configuration` - configuration used in parsing (config_t)
  - `declarations` - declaration tree found when parsing
  - `included_files` - files included by parsing.
Overrides: cache_base_t.update

### cached_value(self, source_file, configuration)

source code

Attempt to lookup the cached decls for the given file and configuration. If not found or signature check fails, returns None.

Overrides: cache_base_t.cached_value