BruteForceBackend.hh 733 B

1234567891011121314151617181920212223242526
  1. #ifndef BRUTE_FORCE_H
  2. #define BRUTE_FORCE_H
  3. #include "../Backend.hh"
  4. #include "../DirTree.hh"
  5. #include "../Watcher.hh"
  6. class BruteForceBackend : public Backend {
  7. public:
  8. void writeSnapshot(WatcherRef watcher, std::string *snapshotPath) override;
  9. void getEventsSince(WatcherRef watcher, std::string *snapshotPath) override;
  10. void subscribe(WatcherRef watcher) override {
  11. throw "Brute force backend doesn't support subscriptions.";
  12. }
  13. void unsubscribe(WatcherRef watcher) override {
  14. throw "Brute force backend doesn't support subscriptions.";
  15. }
  16. std::shared_ptr<DirTree> getTree(WatcherRef watcher, bool shouldRead = true);
  17. private:
  18. void readTree(WatcherRef watcher, std::shared_ptr<DirTree> tree);
  19. };
  20. #endif