26#ifndef FSW_KQUEUE_MONITOR_H
27# define FSW_KQUEUE_MONITOR_H
34# include <sys/event.h>
42 struct kqueue_monitor_load;
78 void initialize_kqueue();
79 void terminate_kqueue();
80 void scan(const std::filesystem::path& path);
81 bool add_watch(const std::
string& path, const struct stat& fd_stat);
82 bool is_path_watched(const std::
string& path) const;
83 void remove_deleted();
84 void rescan_pending();
85 void scan_root_paths();
86 int wait_for_events(const std::vector<struct kevent>& changes,
87 std::vector<struct kevent>& event_list) const;
88 void process_events(const std::vector<struct kevent>& event_list,
93 std::unique_ptr<kqueue_monitor_load> load;
~kqueue_monitor() override
Destroys an instance of this class.
kqueue_monitor(std::vector< std::string > paths, FSW_EVENT_CALLBACK *callback, void *context=nullptr)
Constructs an instance of this class.
void run() final
Executes the monitor loop.
std::vector< std::string > paths
List of paths to watch.
Definition monitor.hpp:527
void * context
Pointer to context data that will be passed to the monitor::callback.
Definition monitor.hpp:547
FSW_EVENT_CALLBACK * callback
Callback to which change events should be notified.
Definition monitor.hpp:542
monitor(std::vector< std::string > paths, FSW_EVENT_CALLBACK *callback, void *context=nullptr)
Constructs a monitor watching the specified paths.
Definition monitor.cpp:50
Header of the fsw::monitor class.
Main namespace of libfswatch.
Definition event.cpp:24
void FSW_EVENT_CALLBACK(const std::vector< event > &, void *)
Function definition of an event callback.
Definition monitor.hpp:57