summaryrefslogtreecommitdiff
path: root/src/hasher.hh
blob: 16b361f61fe659fd5a170c37ef1e7f2d7672b580 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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