4#include <unordered_map>
33 [[nodiscard]]
virtual std::unordered_map<ArtifactKey, std::string>
42 [[nodiscard]]
virtual std::unordered_map<ArtifactKey, std::string>
53 const std::string &tileset_name,
const std::unordered_map<ArtifactKey, std::string> &checksums)
const = 0;
67 const std::string &tileset_name,
const std::vector<ArtifactKey> &artifact_keys)
const;
81 [[nodiscard]]
virtual bool
Abstract service for managing artifact checksums.
virtual std::unordered_map< ArtifactKey, std::string > compute_tileset_artifact_checksums(const std::string &tileset_name) const =0
Computes checksums for the artifacts that belong to the given Tileset.
virtual std::vector< ArtifactKey > find_unsynced_tileset_artifacts(const std::string &tileset_name, const std::vector< ArtifactKey > &artifact_keys) const
Finds all artifacts for the given Tileset with unsynced changes compared to cached checksums.
virtual bool all_checksums_tileset_match(const std::string &tileset_name, const std::vector< ArtifactKey > &artifact_keys) const
Checks if all artifact checksums for the given Tileset match their cached values.
virtual ~ArtifactChecksumProvider()=default
virtual Result< void > cache_tileset_checksums(const std::string &tileset_name, const std::unordered_map< ArtifactKey, std::string > &checksums) const =0
Caches checksums for the given Tileset to persistent storage.
virtual std::unordered_map< ArtifactKey, std::string > load_cached_tileset_checksums(const std::string &tileset_name) const =0
Loads the cached checksums for the given Tileset.
std::expected< T, E > Result
A result with some type T on success, otherwise an error of type E.