Fork Vasum on GitHub Official Vasum Wiki on Tizen.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
utils::Inotify Class Reference

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
 
Inotifyoperator= (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::EventPollmEventPoll
 
std::vector< HandlermHandlers
 

Detailed Description

Inotify monitors a directory and when a specified file or folder is created or deleted it calls a corresponding handler.

Member Typedef Documentation

typedef std::function<void(const std::string&, const uint32_t)> utils::Inotify::Callback
typedef std::lock_guard<std::recursive_mutex> utils::Inotify::Lock
private

Constructor & Destructor Documentation

utils::Inotify::Inotify ( cargo::ipc::epoll::EventPoll eventPoll)
utils::Inotify::~Inotify ( )
virtual
utils::Inotify::Inotify ( const Inotify )
delete

Member Function Documentation

int utils::Inotify::getFD ( ) const
Returns
inotify file descriptor
void utils::Inotify::handleInternal ( )
private
Inotify& utils::Inotify::operator= ( const Inotify )
delete
void utils::Inotify::removeHandler ( const std::string &  path)

Stop watching the path.

void utils::Inotify::removeHandlerInternal ( const std::string &  path)
private
void utils::Inotify::setHandler ( const std::string &  path,
const uint32_t  eventMask,
const Callback &&  callback 
)

Add a callback for a specified path.

Member Data Documentation

cargo::ipc::epoll::EventPoll& utils::Inotify::mEventPoll
private
int utils::Inotify::mFD
private
std::vector<Handler> utils::Inotify::mHandlers
private
std::recursive_mutex utils::Inotify::mMutex
private

The documentation for this class was generated from the following files: