Inotify Class Reference

Inotify interface. More...

#include <mt_inotify.h>

Inheritance diagram for Inotify:

Public Member Functions

 Inotify ()
virtual ~Inotify ()
int addWatch (zmm::String path, int events)
 Puts a file or directory on the inotify watch list.
void removeWatch (int wd)
 Removes a previously added file or directory from the watch list.
struct inotify_eventnextEvent ()
 Returns the next inotify event.
void stop ()
 Unblock the next_event function.
void retain ()
void release ()
int getRefCount ()

Static Public Member Functions

static bool supported ()
 Checks if inotify is supported on the system.
static void * operator new (size_t size)
static void operator delete (void *ptr)

Protected Attributes

mt_atomic_t _ref_count
pthread_mutex_t mutex

Private Attributes

int inotify_fd
int stop_fds_pipe [2]
int stop_fd_read
int stop_fd_write

Detailed Description

Inotify interface.

Definition at line 44 of file mt_inotify.h.

Constructor & Destructor Documentation

Inotify::Inotify (  ) 
virtual Inotify::~Inotify (  )  [virtual]

Member Function Documentation

int Inotify::addWatch ( zmm::String  path,
int  events 

Puts a file or directory on the inotify watch list.

path file or directory to monitor.
events inotify event mask
watch descriptor or a negative value on error
int Object::getRefCount (  )  [inherited]

Definition at line 78 of file

References zmm::Object::_ref_count, and atomic_get().

struct inotify_event* Inotify::nextEvent (  )  [read]

Returns the next inotify event.

This function will return the next inotify event that occurs, in case that there are no events the function will block indefinetely. It can be unblocked by the stop function.

void Object::operator delete ( void *  ptr  )  [static, inherited]

Definition at line 87 of file

References FREE.

void * Object::operator new ( size_t  size  )  [static, inherited]

Definition at line 83 of file

References MALLOC.

void Object::release (  )  [inherited]
void Inotify::removeWatch ( int  wd  ) 

Removes a previously added file or directory from the watch list.

wd watch descriptor that was returned by the add_watch function
void Object::retain (  )  [inherited]
void Inotify::stop (  ) 

Unblock the next_event function.

static bool Inotify::supported (  )  [static]

Checks if inotify is supported on the system.

Referenced by ConfigManager::validate().

Field Documentation

mt_atomic_t zmm::Object::_ref_count [protected, inherited]
int Inotify::inotify_fd [private]

Definition at line 74 of file mt_inotify.h.

pthread_mutex_t zmm::Object::mutex [protected, inherited]
int Inotify::stop_fd_read [private]

Definition at line 76 of file mt_inotify.h.

int Inotify::stop_fd_write [private]

Definition at line 77 of file mt_inotify.h.

int Inotify::stop_fds_pipe[2] [private]

Definition at line 75 of file mt_inotify.h.

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

Generated on Fri Mar 26 20:16:57 2010 for MediaTomb by  doxygen 1.6.1