summaryrefslogtreecommitdiff
path: root/src/hasher.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/hasher.hh')
-rw-r--r--src/hasher.hh29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/hasher.hh b/src/hasher.hh
new file mode 100644
index 0000000..16b361f
--- /dev/null
+++ b/src/hasher.hh
@@ -0,0 +1,29 @@
+#ifndef HASHER_HH
+#define HASHER_HH
+
+#include <filesystem>
+#include <functional>
+#include <memory>
+
+class Logger;
+class TaskRunner;
+
+class Hasher {
+public:
+ virtual ~Hasher() = default;
+
+ static std::unique_ptr<Hasher> create(std::shared_ptr<Logger> logger,
+ std::shared_ptr<TaskRunner> runner,
+ size_t threads = 1);
+
+ virtual void hash(std::filesystem::path path,
+ std::function<void(std::string,
+ uint64_t)> callback) = 0;
+
+protected:
+ Hasher() = default;
+ Hasher(Hasher const&) = delete;
+ Hasher& operator=(Hasher const&) = delete;
+};
+
+#endif // HASHER_HH