AutoscanInotify Class Reference

#include <autoscan_inotify.h>

Inheritance diagram for AutoscanInotify:
zmm::Object

Data Structures

class  Watch
class  WatchAutoscan
class  WatchMove
class  Wd

Public Member Functions

 AutoscanInotify ()
virtual ~AutoscanInotify ()
void init ()
void shutdown ()
 shutdown the inotify thread
void monitor (zmm::Ref< AutoscanDirectory > dir)
 Start monitoring a directory.
void unmonitor (zmm::Ref< AutoscanDirectory > dir)
 Stop monitoring a directory.
void retain ()
void release ()
int getRefCount ()

Static Public Member Functions

static void * operator new (size_t size)
static void operator delete (void *ptr)

Protected Attributes

mt_atomic_t _ref_count

Private Types

enum  watch_type_t { WatchAutoscanType, WatchMoveType }

Private Member Functions

void threadProc ()
zmm::String normalizePathNoEx (zmm::String path)
void monitorUnmonitorRecursive (zmm::String startPath, bool unmonitor, zmm::Ref< AutoscanDirectory > adir, zmm::String normalizedAutoscanPath, bool startPoint)
int monitorDirectory (zmm::String path, zmm::Ref< AutoscanDirectory > adir, zmm::String normalizedAutoscanPath, bool startPoint, zmm::Ref< zmm::Array< zmm::StringBase > > pathArray=nil)
void unmonitorDirectory (zmm::String path, zmm::Ref< AutoscanDirectory > adir)
zmm::Ref< WatchAutoscangetAppropriateAutoscan (zmm::Ref< Wd > wdObj, zmm::Ref< AutoscanDirectory > adir)
zmm::Ref< WatchAutoscangetAppropriateAutoscan (zmm::Ref< Wd > wdObj, zmm::String path)
zmm::Ref< WatchAutoscangetStartPoint (zmm::Ref< Wd > wdObj)
bool removeFromWdObj (zmm::Ref< Wd > wdObj, zmm::Ref< Watch > toRemove)
bool removeFromWdObj (zmm::Ref< Wd > wdObj, zmm::Ref< WatchAutoscan > toRemove)
bool removeFromWdObj (zmm::Ref< Wd > wdObj, zmm::Ref< WatchMove > toRemove)
void monitorNonexisting (zmm::String path, zmm::Ref< AutoscanDirectory > adir, zmm::String normalizedAutoscanPath)
void recheckNonexistingMonitor (int curWd, zmm::Ref< zmm::Array< zmm::StringBase > > nonexistingPathArray, zmm::Ref< AutoscanDirectory > adir, zmm::String normalizedAutoscanPath)
void recheckNonexistingMonitors (int wd, zmm::Ref< Wd > wdObj)
void removeNonexistingMonitor (int wd, zmm::Ref< Wd > wdObj, zmm::Ref< zmm::Array< zmm::StringBase > > pathAr)
int watchPathForMoves (zmm::String path, int wd)
int addMoveWatch (zmm::String path, int removeWd, int parentWd)
void checkMoveWatches (int wd, zmm::Ref< Wd > wdObj)
void removeWatchMoves (int wd)
void addDescendant (int startPointWd, int addWd, zmm::Ref< AutoscanDirectory > adir)
void removeDescendants (int wd)

Static Private Member Functions

static void * staticThreadProc (void *arg)

Private Attributes

pthread_t thread
zmm::Ref< Inotifyinotify
zmm::Ref< Condcond
zmm::Ref< Mutexmutex
zmm::Ref< zmm::ObjectQueue
< AutoscanDirectory > > 
monitorQueue
zmm::Ref< zmm::ObjectQueue
< AutoscanDirectory > > 
unmonitorQueue
int events
zmm::Ref< DBOHash< int, Wd > > watches
bool shutdownFlag
 is set to true by shutdown() if the inotify thread should terminate

Detailed Description

Definition at line 49 of file autoscan_inotify.h.


Member Enumeration Documentation

Enumerator:
WatchAutoscanType 
WatchMoveType 

Definition at line 84 of file autoscan_inotify.h.


Constructor & Destructor Documentation

AutoscanInotify::AutoscanInotify (  ) 
virtual AutoscanInotify::~AutoscanInotify (  )  [virtual]

Member Function Documentation

void AutoscanInotify::addDescendant ( int  startPointWd,
int  addWd,
zmm::Ref< AutoscanDirectory adir 
) [private]
int AutoscanInotify::addMoveWatch ( zmm::String  path,
int  removeWd,
int  parentWd 
) [private]
void AutoscanInotify::checkMoveWatches ( int  wd,
zmm::Ref< Wd wdObj 
) [private]
zmm::Ref<WatchAutoscan> AutoscanInotify::getAppropriateAutoscan ( zmm::Ref< Wd wdObj,
zmm::String  path 
) [private]
zmm::Ref<WatchAutoscan> AutoscanInotify::getAppropriateAutoscan ( zmm::Ref< Wd wdObj,
zmm::Ref< AutoscanDirectory adir 
) [private]
int Object::getRefCount (  )  [inherited]

Definition at line 78 of file object.cc.

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

zmm::Ref<WatchAutoscan> AutoscanInotify::getStartPoint ( zmm::Ref< Wd wdObj  )  [private]
void AutoscanInotify::init (  ) 
void AutoscanInotify::monitor ( zmm::Ref< AutoscanDirectory dir  ) 

Start monitoring a directory.

int AutoscanInotify::monitorDirectory ( zmm::String  path,
zmm::Ref< AutoscanDirectory adir,
zmm::String  normalizedAutoscanPath,
bool  startPoint,
zmm::Ref< zmm::Array< zmm::StringBase > >  pathArray = nil 
) [private]
void AutoscanInotify::monitorNonexisting ( zmm::String  path,
zmm::Ref< AutoscanDirectory adir,
zmm::String  normalizedAutoscanPath 
) [private]
void AutoscanInotify::monitorUnmonitorRecursive ( zmm::String  startPath,
bool  unmonitor,
zmm::Ref< AutoscanDirectory adir,
zmm::String  normalizedAutoscanPath,
bool  startPoint 
) [private]
zmm::String AutoscanInotify::normalizePathNoEx ( zmm::String  path  )  [private]
void Object::operator delete ( void *  ptr  )  [static, inherited]

Definition at line 87 of file object.cc.

References FREE.

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

Definition at line 83 of file object.cc.

References MALLOC.

void AutoscanInotify::recheckNonexistingMonitor ( int  curWd,
zmm::Ref< zmm::Array< zmm::StringBase > >  nonexistingPathArray,
zmm::Ref< AutoscanDirectory adir,
zmm::String  normalizedAutoscanPath 
) [private]
void AutoscanInotify::recheckNonexistingMonitors ( int  wd,
zmm::Ref< Wd wdObj 
) [private]
void Object::release (  )  [inherited]
void AutoscanInotify::removeDescendants ( int  wd  )  [private]
bool AutoscanInotify::removeFromWdObj ( zmm::Ref< Wd wdObj,
zmm::Ref< WatchMove toRemove 
) [private]
bool AutoscanInotify::removeFromWdObj ( zmm::Ref< Wd wdObj,
zmm::Ref< WatchAutoscan toRemove 
) [private]
bool AutoscanInotify::removeFromWdObj ( zmm::Ref< Wd wdObj,
zmm::Ref< Watch toRemove 
) [private]
void AutoscanInotify::removeNonexistingMonitor ( int  wd,
zmm::Ref< Wd wdObj,
zmm::Ref< zmm::Array< zmm::StringBase > >  pathAr 
) [private]
void AutoscanInotify::removeWatchMoves ( int  wd  )  [private]
void Object::retain (  )  [inherited]
void AutoscanInotify::shutdown (  ) 

shutdown the inotify thread

warning: currently doesn't remove all the remaining inotify watches!

static void* AutoscanInotify::staticThreadProc ( void *  arg  )  [static, private]
void AutoscanInotify::threadProc (  )  [private]
void AutoscanInotify::unmonitor ( zmm::Ref< AutoscanDirectory dir  ) 

Stop monitoring a directory.

void AutoscanInotify::unmonitorDirectory ( zmm::String  path,
zmm::Ref< AutoscanDirectory adir 
) [private]
int AutoscanInotify::watchPathForMoves ( zmm::String  path,
int  wd 
) [private]

Field Documentation

mt_atomic_t zmm::Object::_ref_count [protected, inherited]

Definition at line 75 of file autoscan_inotify.h.

int AutoscanInotify::events [private]

Definition at line 82 of file autoscan_inotify.h.

Definition at line 73 of file autoscan_inotify.h.

Definition at line 78 of file autoscan_inotify.h.

Reimplemented from zmm::Object.

Definition at line 76 of file autoscan_inotify.h.

is set to true by shutdown() if the inotify thread should terminate

Definition at line 199 of file autoscan_inotify.h.

pthread_t AutoscanInotify::thread [private]

Definition at line 71 of file autoscan_inotify.h.

Definition at line 79 of file autoscan_inotify.h.

Definition at line 169 of file autoscan_inotify.h.


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

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