Handle¶
-
template<IsSceneObject T>
class Handle¶ Strongly-typed handle for scene objects.
Handle provides safe, type-checked access to scene objects managed by shared pointers. It ensures that the referenced object is still valid and owned by the scene, and allows for type-safe downcasting to derived types. Handles are used throughout the scene graph and asset management system to avoid raw pointer usage and to enforce object lifetime.
- Template Parameters:
T – Scene object type
Public Functions
-
bool valid() const¶
Checks if the handle points to a valid, scene-owned object.
- Returns:
true if valid, false otherwise
Gets a shared_ptr to the referenced object, optionally downcasting to a derived type.
- Template Parameters:
U – Type to cast to (default: T)
- Throws:
std::runtime_error –
- Returns:
std::shared_ptr
Protected Functions