Foundry.PathCache¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
None
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class Foundry.PathCache(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
Thread-safe cache for path lookups
Foundry.PathCachecan be used to cache path lookup entries as often needed by runtimes.This object is thread-safe and may be accessed from multiple threads simultaneously.
- classmethod new()¶
- Return type:
- contains(program_name)¶
- Parameters:
program_name (
str) – the name of the program to lookup- Returns:
Trueif an entry was found and had_program_path is set; otherwiseFalse.- had_program_path:
a location to store if a path was found for program_name.
- Return type:
This function helps for detecting negative cache entries without copying the program_path string.
- insert(program_name, program_path)¶
- Parameters:
Inserts a cache entry for program_name for program_path.
program_path may be
Noneto register a negative cache entry. SeeFoundry.PathCache.lookup() for handling negative cache entries.
- lookup(program_name)¶
- Parameters:
program_name (
str) – the program name to lookup- Returns:
Trueif program_name was found and program_path is set; otherwiseFalseis returned.- program_path:
a location to store the program_path for program_name.
- Return type:
Trueis returned when an entry is found in the cache. That entry may beNoneindicating a negative cache entry.