26 #ifndef FSW_POLL_MONITOR_H
27 # define FSW_POLL_MONITOR_H
30 # include <sys/stat.h>
62 static const unsigned int MIN_POLL_LATENCY = 1;
67 typedef bool (
poll_monitor::*poll_monitor_scan_callback)(
68 const std::string& path,
69 const struct stat& stat);
71 typedef struct watched_file_info
79 void scan(
const std::string& path, poll_monitor_scan_callback fn);
80 void collect_initial_data();
82 bool add_path(
const std::string& path,
83 const struct stat& fd_stat,
84 poll_monitor_scan_callback poll_callback);
85 bool initial_scan_callback(
const std::string& path,
const struct stat& stat);
86 bool intermediate_scan_callback(
const std::string& path,
87 const struct stat& stat);
88 void find_removed_files();
89 void swap_data_containers();
94 std::vector<event> events;
void * context
Pointer to context data that will be passed to the monitor::callback.
Definition: monitor.hpp:553
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:42
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.
Definition: cmonitor.h:50
Header of the fsw::monitor class.
std::vector< std::string > paths
List of paths to watch.
Definition: monitor.hpp:533
FSW_EVENT_CALLBACK * callback
Callback to which change events should be notified.
Definition: monitor.hpp:548
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