acme
Foundational cross-platform layer of the ca2 framework
Loading...
Searching...
No Matches
solaris_file_watcher.h
1
27#pragma once
28
29
30namespace file_watcher
31{
32 / for Linux based on inotify.
34 class os_file_watcher : public file_watcher_impl
35 {
36 public:
38 typedef map_base < atom, atom, watch_struct *, watch_struct * > WatchMap;
39
40 public:
43 os_file_watcher();
44
47 virtual ~os_file_watcher();
48
51 atom add_watch(const string & directory, file_watch_listener* watcher, bool bRecursive);
52
54 void erase_watch(const string & directory);
55
57 void erase_watch(atom watchid);
58
59 string watch_path(atom watchid);
60
62 void update();
63
65 void handle_action(::file_watcher::file_watcher_impl::action * ptopic);
66
67 private:
69 WatchMap m_watchmap;
71 atom mLastWatchID;
73 ::i32 mFD;
75 struct timeval mTimeOut;
77 fd_set mDescriptorSet;
78
79
80 };
81
82
83} // namespace file_watcher
84
Definition atom.h:237
void handle_action(::file_watcher::file_watcher_impl::action *ptopic)
Handles the action.
Definition solaris_file_watcher.cpp:210
map_base< atom, atom, watch_struct *, watch_struct * > WatchMap
type for a map_base from atom to watch_struct pointer
Definition solaris_file_watcher.h:38
void erase_watch(const string &directory)
Remove a directory watch. This is a brute force lazy search O(nlogn).
void update()
Updates the watcher. Must be called often.
Definition solaris_file_watcher.cpp:176
atom add_watch(const string &directory, file_watch_listener *watcher, bool bRecursive)
Definition solaris_file_watcher.cpp:77
Definition solaris_file_watcher.cpp:34