pygccxml.parser.declarations_cache module

class cache_base_t

Bases: object

cached_value(source_file, configuration)

Return declarations, we have cached, for the source_file and the given configuration.

Parameters
  • source_file – path to the C++ source file being parsed.

  • configuration – configuration that was used for parsing.

flush()

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

logger = <Logger pygccxml.declarations_cache (INFO)>
update(source_file, configuration, declarations, included_files)

update cache entry

Parameters
  • source_file – path to the C++ source file being parsed

  • configuration – configuration used in parsing xml_generator_configuration_t

  • declarations – declaration tree found when parsing

  • included_files – files included by parsing.

configuration_signature(config)

Return a signature for a configuration (xml_generator_configuration_t) object.

This can then be used as a key in the cache. This method must take into account anything about a configuration that could cause the declarations generated to be different between runs.

class dummy_cache_t

Bases: pygccxml.parser.declarations_cache.cache_base_t

This is an empty cache object.

By default no caching is enabled in pygccxml.

cached_value(source_file, configuration)

Return declarations, we have cached, for the source_file and the given configuration.

Parameters
  • source_file – path to the C++ source file being parsed.

  • configuration – configuration that was used for parsing.

flush()

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

update(source_file, configuration, declarations, included_files)

update cache entry

Parameters
  • source_file – path to the C++ source file being parsed

  • configuration – configuration used in parsing xml_generator_configuration_t

  • declarations – declaration tree found when parsing

  • included_files – files included by parsing.

class file_cache_t(name)

Bases: pygccxml.parser.declarations_cache.cache_base_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.

cached_value(source_file, configuration)

Attempt to lookup the cached declarations for the given file and configuration.

Returns None if declaration not found or signature check fails.

flush()

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

update(source_file, configuration, declarations, included_files)

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

file_signature(filename)

Return a signature for a file.

class record_t(source_signature, config_signature, included_files, included_files_signature, declarations)

Bases: object

property config_signature
static create_key(source_file, configuration)
property declarations
property included_files
property included_files_signature
key()
property source_signature
property was_hit