#include <mt_inotify.h>
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_event * | nextEvent () |
| 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 |
Inotify interface.
Definition at line 44 of file mt_inotify.h.
| Inotify::Inotify | ( | ) |
| virtual Inotify::~Inotify | ( | ) | [virtual] |
| 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 |
| int Object::getRefCount | ( | ) | [inherited] |
Definition at line 78 of file object.cc.
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] |
| void * Object::operator new | ( | size_t | size | ) | [static, inherited] |
| void Object::release | ( | ) | [inherited] |
Definition at line 66 of file object.cc.
References zmm::Object::_ref_count, atomic_dec(), and zmm::Object::mutex.
Referenced by zmm::ArrayBase::clear(), zmm::String::operator=(), DSOHash< zmm::Array< CacheObject > >::releaseData(), DSBHash< VT >::releaseData(), DSOHash< zmm::Array< CacheObject > >::remove(), zmm::ArrayBase::remove(), zmm::ArrayBase::removeUnordered(), zmm::ArrayBase::set(), zmm::ArrayBase::~ArrayBase(), DSOHash< zmm::Array< CacheObject > >::~DSOHash(), zmm::ObjectQueue< AutoscanDirectory >::~ObjectQueue(), zmm::ObjectStack< Element >::~ObjectStack(), and zmm::String::~String().
| 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] |
Definition at line 58 of file object.cc.
References zmm::Object::_ref_count, atomic_inc(), and zmm::Object::mutex.
Referenced by zmm::ArrayBase::append(), zmm::ObjectQueue< AutoscanDirectory >::enqueue(), zmm::ArrayBase::insert(), zmm::String::operator=(), zmm::ObjectStack< Element >::push(), DSOHash< zmm::Array< CacheObject > >::put(), DSBHash< VT >::put(), zmm::ArrayBase::set(), and zmm::String::String().
| 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().
mt_atomic_t zmm::Object::_ref_count [protected, inherited] |
Definition at line 54 of file object.h.
Referenced by zmm::Object::getRefCount(), zmm::Object::Object(), zmm::Object::release(), and zmm::Object::retain().
int Inotify::inotify_fd [private] |
Definition at line 74 of file mt_inotify.h.
pthread_mutex_t zmm::Object::mutex [protected, inherited] |
Reimplemented in AutoscanList, AutoscanInotify, CachedURL, Dictionary_r, DVDNavReader, IOHandlerBufferHelper, ReentrantArray< T >, SingletonManager, Singleton< T >, StorageCache, MutexAutolock, Cond, ThreadExecutor, Singleton< UpdateManager >, Singleton< Timer >, Singleton< ContentDirectoryService >, Singleton< ConfigManager >, Singleton< Server >, Singleton< Runtime >, Singleton< ContentManager >, Singleton< ConnectionManagerService >, Singleton< PlayHook >, Singleton< Storage >, and Singleton< SessionManager >.
Definition at line 56 of file object.h.
Referenced by zmm::Object::Object(), zmm::Object::release(), zmm::Object::retain(), and zmm::Object::~Object().
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.
1.6.1