|
RADLib
RADical C++ application framework
|
inotify-backed filesystem watcher that emits on a RADCore EventLoop. More...
#include <RADCore.h>
Inheritance diagram for RADCore::RADFileSystemWatcher:
Collaboration diagram for RADCore::RADFileSystemWatcher:Public Member Functions | |
| RADFileSystemWatcher (EventLoop &loop) | |
| Creates a watcher that posts events to loop. More... | |
| ~RADFileSystemWatcher () override | |
| Stops the watcher. More... | |
| bool | addPath (const std::string &path) |
| Adds a non-recursive path watch. More... | |
| bool | addPath (const std::string &path, bool recursive) |
| Adds a path watch, recursively when requested. More... | |
| void | removePath (const std::string &path) |
| Removes a watched path. More... | |
| void | clear () |
| Removes all watched paths. More... | |
| std::vector< std::string > | paths () const |
| Returns currently watched paths. More... | |
Public Member Functions inherited from RADCore::RADObject | |
| RADObject () | |
| Creates a RADObject bound to the current thread. More... | |
| virtual | ~RADObject () |
| Disconnects tracked event links and releases lifetime token. More... | |
| void | registerLink (const ConnectionRecord &record) |
| Registers a connection for cleanup when this object is destroyed. More... | |
| std::thread::id | threadId () const |
| Returns the thread id this object is currently associated with. More... | |
| EventLoop * | associatedEventLoop () const |
| Returns the associated event loop, if any. More... | |
| ThreadAffinity | threadAffinity () const |
| Returns both thread id and associated loop atomically. More... | |
| std::weak_ptr< void > | lifetimeToken () const |
| Returns a weak token used to drop queued callbacks after destruction. More... | |
| void | moveToThread (std::thread::id tId, EventLoop *loop=nullptr) |
| Moves the object's affinity to tId and optional loop. More... | |
Public Attributes | |
| RADCore::Event< void(std::string, FileSystemEvent) > | changed |
| Raised with path and event type when a watched path changes. More... | |
| RADCore::Event< void(std::string) > | errorOccurred |
| Raised when watcher setup or event processing fails. More... | |
|
explicit |
Creates a watcher that posts events to loop.
|
override |
Stops the watcher.
| bool RADCore::RADFileSystemWatcher::addPath | ( | const std::string & | path | ) |
Adds a non-recursive path watch.
| bool RADCore::RADFileSystemWatcher::addPath | ( | const std::string & | path, |
| bool | recursive | ||
| ) |
Adds a path watch, recursively when requested.
| void RADCore::RADFileSystemWatcher::clear | ( | ) |
Removes all watched paths.
| std::vector<std::string> RADCore::RADFileSystemWatcher::paths | ( | ) | const |
Returns currently watched paths.
| void RADCore::RADFileSystemWatcher::removePath | ( | const std::string & | path | ) |
Removes a watched path.
| RADCore::Event<void (std::string, FileSystemEvent) > RADCore::RADFileSystemWatcher::changed |
Raised with path and event type when a watched path changes.
| RADCore::Event<void (std::string) > RADCore::RADFileSystemWatcher::errorOccurred |
Raised when watcher setup or event processing fails.