ARB
Classes | Macros | Typedefs | Functions | Variables
AW_inotify.cxx File Reference
#include "aw_inotify.hxx"
#include "aw_root.hxx"
#include <arbdbt.h>
#include <arb_file.h>
#include <unistd.h>
#include <string>
#include <list>
#include <set>
#include <sys/stat.h>
Include dependency graph for AW_inotify.cxx:

Go to the source code of this file.

Classes

class  TrackedFile
 
class  TrackedFiles
 

Macros

#define USE_STATPOLL
 
#define IF_TRACE_INOTIFY(x)
 

Typedefs

typedef set< FileChangedCallback > CallbackList
 
typedef SmartPtr< TrackedFileTrackedFilePtr
 

Functions

static SmartPtr< TrackedFilesallTrackers (new TrackedFiles)
 
static unsigned timed_inotifications_check_cb ()
 
static void show_tracked_error ()
 
void AW_add_inotification (const char *file, const FileChangedCallback &fccb)
 
void AW_remove_inotification (const char *file, const FileChangedCallback &fccb)
 

Variables

static bool maintain_timer_callback = true
 
const unsigned AW_INOTIFY_TIMER = 700
 

Macro Definition Documentation

#define USE_STATPOLL

Definition at line 30 of file AW_inotify.cxx.

#define IF_TRACE_INOTIFY (   x)

Definition at line 49 of file AW_inotify.cxx.

Typedef Documentation

typedef set<FileChangedCallback> CallbackList

Definition at line 53 of file AW_inotify.cxx.

Definition at line 142 of file AW_inotify.cxx.

Function Documentation

static SmartPtr<TrackedFiles> allTrackers ( new  TrackedFiles)
static
static unsigned timed_inotifications_check_cb ( )
static

Definition at line 455 of file AW_inotify.cxx.

References allTrackers(), AW_INOTIFY_TIMER, and fputs().

Referenced by AW_add_inotification().

static void show_tracked_error ( )
static

Definition at line 466 of file AW_inotify.cxx.

References allTrackers().

Referenced by AW_add_inotification(), and AW_remove_inotification().

void AW_add_inotification ( const char file,
const FileChangedCallback &  fccb 
)

callback after a file changes

Parameters
filethe file to watch
fccbcallback to call

Definition at line 473 of file AW_inotify.cxx.

References AW_root::add_timed_callback(), allTrackers(), fputs(), maintain_timer_callback, show_tracked_error(), AW_root::SINGLETON, and timed_inotifications_check_cb().

Referenced by AW_edit_notified(), and PT_selection::PT_selection().

void AW_remove_inotification ( const char file,
const FileChangedCallback &  fccb 
)

Definition at line 489 of file AW_inotify.cxx.

References allTrackers(), and show_tracked_error().

Variable Documentation

bool maintain_timer_callback = true
static

Definition at line 452 of file AW_inotify.cxx.

Referenced by AW_add_inotification().

const unsigned AW_INOTIFY_TIMER = 700

Definition at line 453 of file AW_inotify.cxx.

Referenced by timed_inotifications_check_cb().