20 #ifndef BUILDCACHE_CACHE_HPP_
21 #define BUILDCACHE_CACHE_HPP_
23 #include <base/string_list.hpp>
24 #include <cache/cache_entry.hpp>
25 #include <cache/expected_file.hpp>
26 #include <cache/local_cache.hpp>
27 #include <cache/remote_cache.hpp>
45 const std::map<std::string, expected_file_t>& expected_files,
46 const bool allow_hard_links,
47 const bool create_target_dirs,
48 int& return_code) noexcept;
54 void add_direct(
const std::string& direct_hash,
55 const std::string& hash,
66 bool lookup(
const std::string& hash,
67 const std::map<std::string, expected_file_t>& expected_files,
68 const bool allow_hard_links,
69 const bool create_target_dirs,
70 int& return_code) noexcept;
78 void add(
const std::string& hash,
80 const std::map<std::string, expected_file_t>& expected_files,
81 const bool allow_hard_links);
84 bool lookup_in_local_cache(
const std::string& hash,
85 const std::map<std::string, expected_file_t>& expected_files,
86 const bool allow_hard_links,
87 const bool create_target_dirs,
90 bool lookup_in_remote_cache(
const std::string& hash,
91 const std::map<std::string, expected_file_t>& expected_files,
92 const bool allow_hard_links,
93 const bool create_target_dirs,
101 #endif // BUILDCACHE_CACHE_HPP_
bool lookup(const std::string &hash, const std::map< std::string, expected_file_t > &expected_files, const bool allow_hard_links, const bool create_target_dirs, int &return_code) noexcept
Perform a cache lookup.
Definition: cache.cpp:114
The top level namespace.
Definition: compressor.cpp:34
void add(const std::string &hash, const cache_entry_t &entry, const std::map< std::string, expected_file_t > &expected_files, const bool allow_hard_links)
Add a new entry to the cache(s).
Definition: cache.cpp:147
void add_direct(const std::string &direct_hash, const std::string &hash, const string_list_t &implicit_input_files)
Add a new direct mode entry to the cache.
Definition: cache.cpp:88
A convenient vector of strings container with support functions for program argument handling.
Definition: string_list.hpp:30
Definition: local_cache.hpp:36
An interface to the different caches.
Definition: cache.hpp:34
Definition: remote_cache.hpp:31
bool lookup_direct(const std::string &direct_hash, const std::map< std::string, expected_file_t > &expected_files, const bool allow_hard_links, const bool create_target_dirs, int &return_code) noexcept
Perform a direct mode cache lookup.
Definition: cache.cpp:53
Meta data for a single cache entry.
Definition: cache_entry.hpp:28