5 #ifndef CVMFS_FILE_WATCHER_H_
6 #define CVMFS_FILE_WATCHER_H_
13 namespace file_watcher {
45 virtual bool Handle(
const std::string& file_path,
47 bool* clear_handler) = 0;
87 int read_pipe,
int write_pipe) = 0;
108 #endif // CVMFS_FILE_WATCHER_H_
int control_pipe_to_back_[2]
void RegisterFilter(const std::string &file_path, EventHandler *handler)
static const unsigned kMaxDelay
static FileWatcher * Create()
static void * BackgroundThread(void *d)
static const unsigned kResetDelay
virtual bool RunEventLoop(const HandlerMap &handler_map, int read_pipe, int write_pipe)=0
WatchRecord(const std::string &path, file_watcher::EventHandler *h)
file_watcher::EventHandler * handler_
static const unsigned kInitialDelay
int control_pipe_to_front_[2]
virtual bool Handle(const std::string &file_path, Event event, bool *clear_handler)=0
std::map< std::string, EventHandler * > HandlerMap
void RegisterHandler(const std::string &file_path, EventHandler *handler)
std::map< int, WatchRecord > watch_records_
virtual int TryRegisterFilter(const std::string &file_path)=0