29 std::shared_ptr<const GenericKey> loader_key_;
33 : file_paths_(std::move(
file_paths)), loader_key_(std::move(loader_key))
49 return a.file_paths_ ==
b.file_paths_ && *a.loader_key_ == *
b.loader_key_;
54 if (
const auto *other_typed =
dynamic_cast<const LoadFileKey *
>(&other)) {
55 return *
this == *other_typed;
65 return std::make_unique<LoadFileKey>(*
this);
101 std::lock_guard
lock{file_stat_map.
mutex};
107 const std::optional<int64_t> new_time = new_times[
i];
109 if (old_time != new_time) {
110 outdated_paths.
add(path);
121 if (
const auto *other_key_typed =
dynamic_cast<const LoadFileKey *
>(&other_key)) {
125 return outdated_paths.contains(path);
136 FunctionRef<std::unique_ptr<CachedValue>()> load_fn)
int BLI_stat(const char *path, BLI_stat_t *buffer) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
File and directory operations.
unsigned long long int uint64_t
Value & lookup_or_add_as(ForwardKey &&key, ForwardValue &&...value)
virtual std::unique_ptr< GenericKey > to_storable() const =0
constexpr int64_t size() const
constexpr const T * end() const
constexpr IndexRange index_range() const
constexpr const T * begin() const
constexpr const char * c_str() const
Span< std::string > file_paths() const
bool equal_to(const GenericKey &other) const override
uint64_t hash() const override
friend bool operator==(const LoadFileKey &a, const LoadFileKey &b)
LoadFileKey(Vector< std::string > file_paths, std::shared_ptr< const GenericKey > loader_key)
std::unique_ptr< GenericKey > to_storable() const override
std::shared_ptr< CachedValue > get_base(const GenericKey &key, FunctionRef< std::unique_ptr< CachedValue >()> compute_fn)
void remove_if(FunctionRef< bool(const GenericKey &)> predicate)
static FileStatMap & get_file_stat_map()
std::shared_ptr< CachedValue > get_loaded_base(const GenericKey &loader_key, Span< StringRefNull > file_paths, FunctionRef< std::unique_ptr< CachedValue >()> load_fn)
static std::optional< int64_t > get_file_modification_time(const StringRefNull path)
static void invalidate_outdated_caches_if_necessary(const Span< StringRefNull > file_paths)
void isolate_task(const Function &function)
uint64_t get_default_hash(const T &v, const Args &...args)
Map< std::string, std::optional< int64_t > > map