|
Flint Engine
Modular C++20 2D game engine powered by SDL3
|
RAII handle returned by watch(). More...
#include <flint/resource/assets-manager.h>
Collaboration diagram for Flint::AssetManager::WatchHandle:Public Member Functions | |
| WatchHandle ()=default | |
| Construct an empty (inactive) handle. | |
| WatchHandle (AssetManager *manager, uint64_t id, std::weak_ptr< ManagerLifetime > managerLifetime) | |
| Construct an active handle tied to a specific watch entry. | |
| ~WatchHandle () | |
| Destructor; calls reset() to cancel the watch if still active. | |
| WatchHandle (WatchHandle &&other) noexcept | |
| Move constructor; transfers ownership and nulls the source. | |
| WatchHandle & | operator= (WatchHandle &&other) noexcept |
| Move-assignment operator. | |
| WatchHandle (const WatchHandle &)=delete | |
| WatchHandle & | operator= (const WatchHandle &)=delete |
| bool | isActive () const |
| Return whether this handle is still registered. | |
| void | reset () |
| Cancel the watch and release the handle. | |
RAII handle returned by watch().
While a WatchHandle is alive the associated callback remains registered. Destroying or resetting the handle automatically deregisters it. Handles are move-only; they cannot be copied.
Definition at line 95 of file assets-manager.h.
|
inline |
Construct an active handle tied to a specific watch entry.
| manager | Owning AssetManager. |
| id | Unique watch identifier. |
| managerLifetime | Weak pointer to the manager's lifetime token. |
Definition at line 107 of file assets-manager.h.
|
inline |
Destructor; calls reset() to cancel the watch if still active.
Definition at line 115 of file assets-manager.h.
|
inlinenoexcept |
Move constructor; transfers ownership and nulls the source.
Definition at line 120 of file assets-manager.h.
|
inlinenodiscard |
Return whether this handle is still registered.
Returns false once reset() has been called or the owning AssetManager has been destroyed.
true if the watch is active. Definition at line 157 of file assets-manager.h.
|
inlinenoexcept |
Move-assignment operator.
Cancels any existing watch on *this before taking ownership from other.
Definition at line 133 of file assets-manager.h.
|
inline |
Cancel the watch and release the handle.
Safe to call more than once; subsequent calls are no-ops.
Definition at line 166 of file assets-manager.h.