From f2c7776e00d6a0ed9f601fbfbf082cab0393d640 Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Wed, 4 Dec 2024 12:31:15 +0100 Subject: rehash_utils: add a class for the rehash function ... to allow a more specific signature when passing around the rehash function. --- src/buildtool/execution_api/utils/rehash_utils.hpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/buildtool/execution_api/utils/rehash_utils.hpp') diff --git a/src/buildtool/execution_api/utils/rehash_utils.hpp b/src/buildtool/execution_api/utils/rehash_utils.hpp index e4a09ca9..f21d5e41 100644 --- a/src/buildtool/execution_api/utils/rehash_utils.hpp +++ b/src/buildtool/execution_api/utils/rehash_utils.hpp @@ -17,6 +17,7 @@ #include #include +#include #include #include "gsl/gsl" @@ -77,6 +78,24 @@ namespace RehashUtils { RepositoryConfig const& repo_config) -> expected, std::string>; +class Rehasher { + public: + Rehasher(StorageConfig source_config, + StorageConfig target_config, + std::optional> apis) + : source_{std::move(source_config)}, + target_{std::move(target_config)}, + apis_{std::move(apis)} {} + + [[nodiscard]] auto Rehash(Artifact::ObjectInfo const& info) const + -> expected; + + private: + StorageConfig const source_; + StorageConfig const target_; + std::optional> const apis_; +}; + } // namespace RehashUtils #endif // INCLUDED_SRC_BUILDTOOL_EXECUTION_API_UTILS_REHASH_UTILS_HPP -- cgit v1.2.3