RAII keep-alive for one RuntimeObjectRegistry entry.
更多...
#include <RuntimeRegistry.h>
Public 类型 | |
| using | Ref = RuntimeHandleRef< Tag > |
Public 成员函数 | |
| RuntimePin ()=default | |
| Constructs an unbound pin. | |
| RuntimePin (const RuntimePin &)=delete | |
| RuntimePin & | operator= (const RuntimePin &)=delete |
| RuntimePin (RuntimePin &&other) noexcept | |
| Moves the keep-alive to a new pin; the source becomes unbound. | |
| RuntimePin & | operator= (RuntimePin &&other) noexcept |
| Move-assigns, releasing any keep-alive this pin already held. | |
| ~RuntimePin () | |
| Releases the keep-alive; an erased object is destroyed here. | |
| bool | isBound () const noexcept |
| Whether this pin still keeps an object alive. | |
| const Ref & | reference () const noexcept |
| The reference this pin was created from. | |
| T * | get () const noexcept |
| Borrows the pinned object; valid until the pin is released. | |
| Borrowed< T > | borrow () const noexcept |
| Borrows the pinned object together with its owner epoch. | |
| T * | operator-> () const noexcept |
| Pointer-like access to the pinned object. | |
| T & | operator* () const noexcept |
| Dereferences the pinned object. | |
友元 | |
| class | RuntimeObjectRegistry< T, Tag > |
详细描述
class eve::script::RuntimePin< T, Tag >
RAII keep-alive for one RuntimeObjectRegistry entry.
Borrowed<T> deliberately does not extend an object's lifetime; a RuntimePin does. The payload survives erase() and clear() for as long as one pin holds it, while the handle itself becomes stale immediately. The pin must not outlive the registry that produced it.
- 模板参数
-
T Object type stored by the producing registry. Tag Owner-specific tag of the producing registry.
RuntimePin public API.
在文件 RuntimeRegistry.h 第 276 行定义.
成员类型定义说明
◆ Ref
| using eve::script::RuntimePin< T, Tag >::Ref = RuntimeHandleRef<Tag> |
在文件 RuntimeRegistry.h 第 278 行定义.
构造及析构函数说明
◆ RuntimePin() [1/3]
|
default |
Constructs an unbound pin.
◆ RuntimePin() [2/3]
|
delete |
◆ RuntimePin() [3/3]
|
inlinenoexcept |
Moves the keep-alive to a new pin; the source becomes unbound.
Store.
在文件 RuntimeRegistry.h 第 286 行定义.
◆ ~RuntimePin()
|
inline |
Releases the keep-alive; an erased object is destroyed here.
在文件 RuntimeRegistry.h 第 308 行定义.
成员函数说明
◆ borrow()
|
inlinenoexcept |
Borrows the pinned object together with its owner epoch.
在文件 RuntimeRegistry.h 第 320 行定义.
引用了 eve::script::RuntimePin< T, Tag >::get() , 以及 eve::script::RuntimeHandleRef< Tag >::ownerEpoch.
◆ get()
|
inlinenoexcept |
Borrows the pinned object; valid until the pin is released.
在文件 RuntimeRegistry.h 第 317 行定义.
被这些函数引用 eve::script::RuntimePin< T, Tag >::borrow(), eve::script::RuntimePin< T, Tag >::operator*(), eve::script::RuntimePin< T, Tag >::operator->(), eve::graphics::vulkan::Graphics::reloadTextureFromFile() , 以及 eve::graphics::webgpu::Graphics::reloadTextureFromFile().
◆ isBound()
|
inlinenoexcept |
Whether this pin still keeps an object alive.
在文件 RuntimeRegistry.h 第 311 行定义.
◆ operator*()
|
inlinenoexcept |
Dereferences the pinned object.
在文件 RuntimeRegistry.h 第 326 行定义.
◆ operator->()
|
inlinenoexcept |
Pointer-like access to the pinned object.
在文件 RuntimeRegistry.h 第 323 行定义.
◆ operator=() [1/2]
|
delete |
◆ operator=() [2/2]
|
inlinenoexcept |
Move-assigns, releasing any keep-alive this pin already held.
Release.
在文件 RuntimeRegistry.h 第 294 行定义.
◆ reference()
|
inlinenoexcept |
The reference this pin was created from.
在文件 RuntimeRegistry.h 第 314 行定义.
友元及相关函数文档
◆ RuntimeObjectRegistry< T, Tag >
|
friend |
在文件 RuntimeRegistry.h 第 326 行定义.
该类的文档由以下文件生成:
- src/engine/common/RuntimeRegistry.h