Type for managing module-level caching
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
character(len=:), | public, | allocatable | :: | cache_dir |
Base cache directory |
||
character(len=:), | public, | allocatable | :: | compiler_id |
Compiler identifier for cache segregation |
||
character(len=:), | public, | allocatable | :: | compiler_version |
Compiler version for cache segregation |
||
logical, | public | :: | enabled | = | .true. |
Whether caching is enabled |
Initialize the module cache
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(module_cache_t), | intent(inout) | :: | this | |||
type(compiler_t), | intent(in) | :: | compiler | |||
character(len=*), | intent(in), | optional | :: | compiler_version |
Generate cache key for a source file
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(module_cache_t), | intent(in) | :: | this | |||
type(srcfile_t), | intent(in) | :: | srcfile | |||
type(srcfile_t), | intent(in), | optional | :: | dependencies(:) |
Store a compiled module in the cache
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(module_cache_t), | intent(in) | :: | this | |||
type(srcfile_t), | intent(in) | :: | srcfile | |||
character(len=*), | intent(in) | :: | cache_key | |||
character(len=*), | intent(in) | :: | build_dir | |||
type(error_t), | intent(out), | allocatable | :: | error |
Retrieve a cached module
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(module_cache_t), | intent(in) | :: | this | |||
character(len=*), | intent(in) | :: | cache_key | |||
character(len=*), | intent(in) | :: | target_dir | |||
type(srcfile_t), | intent(in) | :: | srcfile | |||
logical, | intent(out) | :: | found | |||
type(error_t), | intent(out), | allocatable | :: | error |
Check if a module is cached
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(module_cache_t), | intent(in) | :: | this | |||
character(len=*), | intent(in) | :: | cache_key |
Get the cache directory for a specific module
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(module_cache_t), | intent(in) | :: | this | |||
character(len=*), | intent(in) | :: | cache_key |
Clean stale cache entries
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(module_cache_t), | intent(in) | :: | this | |||
integer, | intent(in) | :: | max_age_days | |||
type(error_t), | intent(out), | allocatable | :: | error |
Deep copy procedures for module_cache_t
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(module_cache_t), | intent(in) | :: | this |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(module_cache_t), | intent(out) | :: | lhs | |||
type(module_cache_t), | intent(in) | :: | rhs |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(module_cache_t), | intent(out) | :: | lhs | |||
type(module_cache_t), | intent(in) | :: | rhs |
type :: module_cache_t !> Base cache directory character(:), allocatable :: cache_dir !> Compiler identifier for cache segregation character(:), allocatable :: compiler_id !> Compiler version for cache segregation character(:), allocatable :: compiler_version !> Whether caching is enabled logical :: enabled = .true. contains procedure :: init => cache_init procedure :: get_cache_key => cache_get_key procedure :: store_module => cache_store_module procedure :: retrieve_module => cache_retrieve_module procedure :: is_cached => cache_is_cached procedure :: get_module_dir => cache_get_module_dir procedure :: clean_stale => cache_clean_stale procedure :: deep_copy => cache_deep_copy procedure :: assign => cache_assign generic :: assignment(=) => assign end type module_cache_t