![]() |
CernVM-FS
2.12.0
|
#include <file_watcher.h>
Public Types | |
typedef std::map< std::string, EventHandler * > | HandlerMap |
Public Member Functions | |
FileWatcher () | |
virtual | ~FileWatcher () |
void | RegisterHandler (const std::string &file_path, EventHandler *handler) |
bool | Spawn () |
void | Stop () |
Static Public Member Functions | |
static FileWatcher * | Create () |
Protected Member Functions | |
void | RegisterFilter (const std::string &file_path, EventHandler *handler) |
virtual bool | RunEventLoop (const HandlerMap &handler_map, int read_pipe, int write_pipe)=0 |
virtual int | TryRegisterFilter (const std::string &file_path)=0 |
Protected Attributes | |
std::map< int, WatchRecord > | watch_records_ |
Static Protected Attributes | |
static const unsigned | kInitialDelay = 1000 |
static const unsigned | kMaxDelay = 10000 |
static const unsigned | kResetDelay = 50000 |
Static Private Member Functions | |
static void * | BackgroundThread (void *d) |
Private Attributes | |
HandlerMap | handler_map_ |
int | control_pipe_to_back_ [2] |
int | control_pipe_to_front_ [2] |
pthread_t | thread_ |
bool | started_ |
Definition at line 62 of file file_watcher.h.
typedef std::map<std::string, EventHandler*> file_watcher::FileWatcher::HandlerMap |
Definition at line 64 of file file_watcher.h.
file_watcher::FileWatcher::FileWatcher | ( | ) |
Definition at line 34 of file file_watcher.cc.
|
virtual |
|
staticprivate |
Definition at line 100 of file file_watcher.cc.
Referenced by Spawn().
|
static |
Definition at line 44 of file file_watcher.cc.
Referenced by MountPoint::CreateResolvConfWatcher().
|
protected |
Definition at line 112 of file file_watcher.cc.
Referenced by file_watcher::FileWatcherInotify::RunEventLoop(), and file_watcher::FileWatcherKqueue::RunEventLoop().
void file_watcher::FileWatcher::RegisterHandler | ( | const std::string & | file_path, |
EventHandler * | handler | ||
) |
Definition at line 56 of file file_watcher.cc.
Referenced by MountPoint::CreateResolvConfWatcher().
|
protectedpure virtual |
Implemented in file_watcher::FileWatcherInotify, and file_watcher::FileWatcherKqueue.
Referenced by BackgroundThread().
bool file_watcher::FileWatcher::Spawn | ( | ) |
Definition at line 61 of file file_watcher.cc.
Referenced by Spawn().
void file_watcher::FileWatcher::Stop | ( | ) |
Definition at line 81 of file file_watcher.cc.
Referenced by ~FileWatcher(), and MountPoint::~MountPoint().
|
protectedpure virtual |
Implemented in file_watcher::FileWatcherInotify, and file_watcher::FileWatcherKqueue.
Referenced by RegisterFilter().
|
private |
Definition at line 98 of file file_watcher.h.
Referenced by BackgroundThread(), Spawn(), and Stop().
|
private |
Definition at line 99 of file file_watcher.h.
Referenced by BackgroundThread(), Spawn(), and Stop().
|
private |
Definition at line 96 of file file_watcher.h.
Referenced by BackgroundThread(), RegisterHandler(), and Stop().
|
staticprotected |
Definition at line 79 of file file_watcher.h.
Referenced by RegisterFilter().
|
staticprotected |
Definition at line 80 of file file_watcher.h.
Referenced by RegisterFilter().
|
staticprotected |
Definition at line 81 of file file_watcher.h.
Referenced by RegisterFilter().
|
private |
Definition at line 103 of file file_watcher.h.
|
private |
Definition at line 101 of file file_watcher.h.
|
protected |
Definition at line 91 of file file_watcher.h.
Referenced by RegisterFilter(), file_watcher::FileWatcherKqueue::RemoveFilter(), file_watcher::FileWatcherKqueue::RunEventLoop(), and file_watcher::FileWatcherInotify::RunEventLoop().