Skip to content

EntropyEngine::Core::IO::FileWatchManager

Manager for FileWatch objects using EntropyObject handle stamping. More…

#include <FileWatchManager.h>

Name
~FileWatchManager()
FileWatchManager &operator=(const FileWatchManager & ) =delete
FileWatchManager &operator=(FileWatchManager && ) =delete
boolisValid(const FileWatch * watch) const
Validates a FileWatch object using handle stamping.
voiddestroyWatch(FileWatch * watch)
Stops a watch and releases the reference.
FileWatch *createWatch(const std::string & path, FileWatchCallback callback, const WatchOptions & options)
Creates a new file system watch.
FileWatchManager(VirtualFileSystem * vfs)
FileWatchManager(const FileWatchManager & ) =delete
FileWatchManager(FileWatchManager && ) =delete
Name
classFileWatchListener
classFileWatch
class EntropyEngine::Core::IO::FileWatchManager;

Manager for FileWatch objects using EntropyObject handle stamping.

FileWatchManager owns the efsw::FileWatcher instance and manages FileWatch objects in slots. When creating a watch, the manager allocates a slot, creates the FileWatch object, and stamps it with handle identity using HandleAccess::set(). This enables generation-based validation.

Thread safety: All public methods are thread-safe via mutex.

~FileWatchManager()
FileWatchManager & operator=(
const FileWatchManager &
) =delete
FileWatchManager & operator=(
FileWatchManager &&
) =delete
bool isValid(
const FileWatch * watch
) const

Validates a FileWatch object using handle stamping.

Parameters:

  • watch Watch to validate

Return: true if watch is valid and still active

void destroyWatch(
FileWatch * watch
)

Stops a watch and releases the reference.

Parameters:

  • watch Watch to stop (may be nullptr)

Note: Calls watch->stop() and watch->release()

FileWatch * createWatch(
const std::string & path,
FileWatchCallback callback,
const WatchOptions & options
)

Creates a new file system watch.

Parameters:

  • path Directory or file path to watch
  • callback Function to call when events occur
  • options Watch configuration options

Return: FileWatch* with refcount=1 (caller owns the reference), or nullptr if failed

explicit FileWatchManager(
VirtualFileSystem * vfs
)
FileWatchManager(
const FileWatchManager &
) =delete
FileWatchManager(
FileWatchManager &&
) =delete
friend class FileWatchListener(
FileWatchListener
);
friend class FileWatch(
FileWatch
);

Updated on 2026-01-26 at 16:50:32 -0500