Class Handle
Defined in File resource-lifetime.h
Class Documentation
-
class Handle
Declaration:
finalMove-only native-object registration; destruction queues retirement without OpenGL calls.
Public Functions
-
Handle() = default
Create an empty logical registration; id() rejects it, resource_domain() returns null.
Adopt a native object through a retained live lifetime.
- Parameters:
lifetime – Required domain whose owner/current context is active.
kind – Matching native object family.
id – Nonzero untracked native name. Null lifetime throws invalid_args; track() validation/allocation errors propagate. If construction fails before adoption, the creator still owns untracked cleanup.
-
inline ~Handle()
Queue this registration for retirement and release the lifetime reference; performs no native calls and may run off the context owner.
-
Handle(Handle &&other) noexcept
Transfer the registration without native calls; other becomes empty and no longer retires the transferred object.
-
Handle &operator=(Handle &&other) noexcept
Retire the destination’s previous registration and take the source registration.
- Returns:
This handle; self-move preserves it. No OpenGL calls occur, and a moved source becomes empty.
-
NativeHandle id() const
Declaration:
[[nodiscard]]- Throws:
CE::Exceptions::failed_operation – For empty, stopped, foreign-thread or noncurrent use. A logical retained handle alone does not authorize native access.
- Returns:
Native name after requiring this registration’s live owner/current context.
-
inline ::CE::Rendering::OpenGL::ResourceKind kind() const noexcept
Declaration:
[[nodiscard]]- Returns:
Stored deletion family without native validation; for an empty/moved-from handle this is metadata only.
-
inline const ::CE::Rendering::OpenGL::ResourceLifetime *resource_domain() const noexcept
Declaration:
[[nodiscard]]- Returns:
Borrowed domain identity, or null for an empty/moved-from handle. This does not check activity, thread or current context; keep the handle/lifetime retained while comparing it.
-
Handle() = default