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