visioncpp.cache¶
VisionCpp caching mechanism.
Provides a mechanism to cache compiled binaries to amortize compiler overheads.
-
visioncpp.cache.
emplace
(uid, path)[source]¶ Move a binary into cache.
- Arguments:
- uid (str): UID. path (str): Path to file.
- Returns:
- str: Path to cached item.
-
visioncpp.cache.
empty
()[source]¶ Empty the cache.
Moves the cache directory to the platform-specific Trash.
-
visioncpp.cache.
get_uid
(code)[source]¶ Compute an ID for a piece of code.
- Arguments:
- code (str): The code to generate the uid for.
- Returns:
- str: UID.
-
visioncpp.cache.
init
(path=None)[source]¶ Initialize cache.
This function is automatically called before any caching operation which would require it, however users may still call this to set an alternate cache location.
- Arguments:
- path (str, optional): Path to new cache location.
- Returns:
- str: Path to cache directory.