Skip to content

EntropyEngine::Core::IO::FileWatch

File system watch object (refcounted, handle-stampable). More…

#include <FileWatch.h>

Inherits from EntropyEngine::Core::EntropyObject

Name
~FileWatch() override
voidstop()
Stops watching the file system.
const std::string &path() const
Gets the path being watched.
const WatchOptions &options() const
Gets the watch options.
boolisWatching() const
Checks if this watch is currently active.
virtual const char *className() const override
Runtime class name for diagnostics and reflection.
FileWatch(FileWatchManager * owner, const std::string & path, FileWatchCallback callback, const WatchOptions & options)
Constructs a file watch (internal - use FileWatchManager::createWatch).
Name
classFileWatchManager

Protected Classes inherited from EntropyEngine::Core::EntropyObject

Name
structHandleCore
Optional handle identity stamped by an owner/registry.

Public Functions inherited from EntropyEngine::Core::EntropyObject

Name
virtual~EntropyObject() =default
virtual const TypeSystem::TypeInfo *typeInfo() const
Optional richer type information; may be null.
booltryRetain() const
Attempts to retain only if the object is still alive.
virtual std::stringtoString() const
Human-readable short string (class@ptr by default).
voidretain() const
Increments the reference count.
voidrelease() const
Decrements the reference count and deletes when it reaches zero.
uint32_trefCount() const
Current reference count (approximate under contention).
EntropyObject &operator=(const EntropyObject & ) =delete
EntropyObject &operator=(EntropyObject && ) =delete
boolhasHandle() const
template <class OwnerT >
OwnerT *
handleOwnerAs() const
Returns the stamped owner pointer cast to the requested type.
const void *handleOwner() const
uint32_thandleIndex() const
uint64_thandleId() const
uint32_thandleGeneration() const
WeakControlBlock *getWeakControlBlock() const
Lazily retrieves or creates the weak control block.
virtual std::stringdescription() const
Long-form description; defaults to toString().
virtual std::stringdebugString() const
Debug-oriented string including refcount and handle when present.
virtual uint64_tclassHash() const
Stable type hash for cross-language identification.
EntropyObject() =default
EntropyObject(EntropyObject && ) =delete
EntropyObject(const EntropyObject & ) =delete

Protected Functions inherited from EntropyEngine::Core::EntropyObject

Name
void_setHandleIdentity(void * owner, uint32_t index, uint32_t generation)
void_clearHandleIdentity()

Protected Attributes inherited from EntropyEngine::Core::EntropyObject

Name
std::atomic< WeakControlBlock * >_weakBlock
Lazily allocated control block for weak refs.
std::atomic< uint32_t >_refCount
Thread-safe retain/release counter.
struct EntropyEngine::Core::EntropyObject::HandleCore_handle

Friends inherited from EntropyEngine::Core::EntropyObject

Name
structHandleAccess
class EntropyEngine::Core::IO::FileWatch;

File system watch object (refcounted, handle-stampable).

FileWatch is an EntropyObject that represents an active file system watch. The object is refcounted and can be stamped with handle identity by the FileWatchManager for validation. When the last reference is released, the destructor automatically stops the watch.

Usage:

FileWatch* watch = vfs.watchDirectory("./src", callback, opts);
// watch has refcount=1, you own the reference
// Later, stop and release
watch->stop(); // Stop watching
watch->release(); // Decrement refcount (may delete if 0)
~FileWatch() override
void stop()

Stops watching the file system.

Note: Idempotent - safe to call multiple times

inline const std::string & path() const

Gets the path being watched.

inline const WatchOptions & options() const

Gets the watch options.

inline bool isWatching() const

Checks if this watch is currently active.

inline virtual const char * className() const override

Runtime class name for diagnostics and reflection.

Reimplements: EntropyEngine::Core::EntropyObject::className

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

Constructs a file watch (internal - use FileWatchManager::createWatch).

friend class FileWatchManager(
FileWatchManager
);

Updated on 2026-01-26 at 17:14:35 -0500