summaryrefslogtreecommitdiff
path: root/src/hasher.hh
diff options
context:
space:
mode:
authorJoel Klinghed <the_jk@spawned.biz>2021-11-17 22:34:57 +0100
committerJoel Klinghed <the_jk@spawned.biz>2021-11-17 22:34:57 +0100
commit6232d13f5321b87ddf12a1aa36b4545da45f173d (patch)
tree23f3316470a14136debd9d02f9e920ca2b06f4cc /src/hasher.hh
Travel3: Simple image and video display site
Reads the images and videos from filesystem and builds a site in memroy.
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