26 #ifndef FSW_POLL_MONITOR_H 27 # define FSW_POLL_MONITOR_H 30 # include <sys/stat.h> 60 static const unsigned int MIN_POLL_LATENCY = 1;
65 typedef bool (
poll_monitor::*poll_monitor_scan_callback)(
66 const std::string& path,
67 const struct stat& stat);
69 typedef struct watched_file_info
77 void scan(
const std::string& path, poll_monitor_scan_callback fn);
78 void collect_initial_data();
80 bool add_path(
const std::string& path,
81 const struct stat& fd_stat,
82 poll_monitor_scan_callback poll_callback);
83 bool initial_scan_callback(
const std::string& path,
const struct stat& stat);
84 bool intermediate_scan_callback(
const std::string& path,
85 const struct stat& stat);
86 void find_removed_files();
87 void swap_data_containers();
92 std::vector<event> events;
void * context
Pointer to context data that will be passed to the monitor::callback.
Definition: monitor.hpp:542
Base class of all monitors.
Definition: monitor.hpp:146
virtual ~poll_monitor()
Destroys an instance of this class.
Definition: poll_monitor.cpp:60
Main namespace of libfswatch.
Definition: event.cpp:23
Definition: poll_monitor.cpp:44
void run()
Execute monitor loop.
Definition: poll_monitor.cpp:195
poll_monitor(std::vector< std::string > paths, FSW_EVENT_CALLBACK *callback, void *context=nullptr)
Constructs an instance of this class.
Header of the fsw::monitor class.
std::vector< std::string > paths
List of paths to watch.
Definition: monitor.hpp:522
FSW_EVENT_CALLBACK * callback
Callback to which change events should be notified.
Definition: monitor.hpp:537
void FSW_EVENT_CALLBACK(const std::vector< event > &, void *)
Function definition of an event callback.
Definition: monitor.hpp:60
stat()-based monitor.
Definition: poll_monitor.hpp:41