Nebula
Loading...
Searching...
No Matches
IO::FileWatcher Class Reference

#include <filewatcher.h>

Detailed Description

For registering callbacks for file modification events.

Inherits Thread.

Public Member Functions

 FileWatcher ()
 constructor
 
virtual ~FileWatcher ()
 destructor
 
void Setup ()
 starts watcher thread
 
void SetSpeed (double speed)
 
void Watch (Util::StringAtom const &folder, bool recursive, WatchFlags flags, WatchDelegate const &callback)
 Register Folder.
 
void Unwatch (Util::StringAtom const &folder)
 unregister
 

Private Member Functions

 __DeclareClass (FileWatcher)
 
 __DeclareInterfaceSingleton (FileWatcher)
 
void Update ()
 checks for file modifications and calls registered callbacks
 
void CheckQueue ()
 
void DoWork ()
 

Private Attributes

Ptr< IO::IoServerioServer
 
Util::Dictionary< Util::StringAtom, EventHandlerDatawatchers
 
Threading::SafeQueue< EventHandlerDatawatcherQueue
 
double interval
 

Constructor & Destructor Documentation

◆ FileWatcher()

IO::FileWatcher::FileWatcher ( )

constructor

◆ ~FileWatcher()

IO::FileWatcher::~FileWatcher ( )
virtual

destructor

Member Function Documentation

◆ __DeclareClass()

IO::FileWatcher::__DeclareClass ( FileWatcher )
private

◆ __DeclareInterfaceSingleton()

IO::FileWatcher::__DeclareInterfaceSingleton ( FileWatcher )
private

◆ CheckQueue()

void IO::FileWatcher::CheckQueue ( )
private

◆ DoWork()

void IO::FileWatcher::DoWork ( )
private

◆ SetSpeed()

void IO::FileWatcher::SetSpeed ( double speed)

◆ Setup()

void IO::FileWatcher::Setup ( )

starts watcher thread

◆ Unwatch()

void IO::FileWatcher::Unwatch ( Util::StringAtom const & folder)

unregister

◆ Update()

void IO::FileWatcher::Update ( )
private

checks for file modifications and calls registered callbacks

◆ Watch()

void IO::FileWatcher::Watch ( Util::StringAtom const & folder,
bool recursive,
WatchFlags flags,
WatchDelegate const & callback )

Register Folder.

Member Data Documentation

◆ interval

double IO::FileWatcher::interval
private

◆ ioServer

Ptr<IO::IoServer> IO::FileWatcher::ioServer
private

◆ watcherQueue

Threading::SafeQueue< EventHandlerData> IO::FileWatcher::watcherQueue
private

◆ watchers

Util::Dictionary<Util::StringAtom, EventHandlerData> IO::FileWatcher::watchers
private

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