Inotify monitors a directory and when a specified file or folder is created or deleted it calls a corresponding handler. More...
#include <inotify.hpp>
Classes | |
struct | Handler |
Public Types | |
typedef std::function< void(const std::string &, const uint32_t)> | Callback |
Public Member Functions | |
Inotify (cargo::ipc::epoll::EventPoll &eventPoll) | |
virtual | ~Inotify () |
Inotify (const Inotify &)=delete | |
Inotify & | operator= (const Inotify &)=delete |
void | setHandler (const std::string &path, const uint32_t eventMask, const Callback &&callback) |
Add a callback for a specified path. More... | |
void | removeHandler (const std::string &path) |
Stop watching the path. More... | |
int | getFD () const |
Private Types | |
typedef std::lock_guard < std::recursive_mutex > | Lock |
Private Member Functions | |
void | handleInternal () |
void | removeHandlerInternal (const std::string &path) |
Private Attributes | |
std::recursive_mutex | mMutex |
int | mFD |
cargo::ipc::epoll::EventPoll & | mEventPoll |
std::vector< Handler > | mHandlers |
Inotify monitors a directory and when a specified file or folder is created or deleted it calls a corresponding handler.
typedef std::function<void(const std::string&, const uint32_t)> utils::Inotify::Callback |
|
private |
utils::Inotify::Inotify | ( | cargo::ipc::epoll::EventPoll & | eventPoll | ) |
|
virtual |
|
delete |
int utils::Inotify::getFD | ( | ) | const |
|
private |
void utils::Inotify::removeHandler | ( | const std::string & | path | ) |
Stop watching the path.
|
private |
void utils::Inotify::setHandler | ( | const std::string & | path, |
const uint32_t | eventMask, | ||
const Callback && | callback | ||
) |
Add a callback for a specified path.
|
private |
|
private |
|
private |
|
private |