Non-owning observation of a registry-owned object. 更多...
#include <RuntimeBorrow.h>
Public 成员函数 | |
| constexpr | Borrowed () noexcept=default |
| Constructs an unbound Borrowed. | |
| constexpr | Borrowed (T *value, std::uint64_t ownerEpoch=0) noexcept |
| Constructs a Borrowed from a nullable pointer. | |
| constexpr | Borrowed (T &value, std::uint64_t ownerEpoch=0) noexcept |
| Constructs a Borrowed from a live reference. | |
| constexpr T * | get () const noexcept |
Returns the observed pointer, or nullptr when unbound. | |
| constexpr bool | isBound () const noexcept |
| Returns whether the observation currently names an object. | |
| constexpr std::uint64_t | ownerEpoch () const noexcept |
| Returns the epoch of the owner that produced this observation. | |
| constexpr T * | operator-> () const noexcept |
| Pointer-like access to the borrowed object. | |
| constexpr T & | operator* () const noexcept |
| Dereferences the borrowed object; the caller owns validity proof. | |
详细描述
class eve::script::Borrowed< T >
Non-owning observation of a registry-owned object.
- 模板参数
-
T Observed object type; may be incomplete at the declaration site. @ownership Never owns; the producing registry remains responsible for destruction. @lifetime Valid only while the owner epoch remains current and no owner mutation, restore, clear or destruction has occurred.
在文件 RuntimeBorrow.h 第 27 行定义.
构造及析构函数说明
◆ Borrowed() [1/3]
|
constexprdefaultnoexcept |
Constructs an unbound Borrowed.
◆ Borrowed() [2/3]
|
inlineexplicitconstexprnoexcept |
Constructs a Borrowed from a nullable pointer.
在文件 RuntimeBorrow.h 第 32 行定义.
◆ Borrowed() [3/3]
|
inlineexplicitconstexprnoexcept |
Constructs a Borrowed from a live reference.
在文件 RuntimeBorrow.h 第 35 行定义.
成员函数说明
◆ get()
|
inlineconstexprnoexcept |
Returns the observed pointer, or nullptr when unbound.
- 返回
- A nullable borrowed pointer; this wrapper never transfers ownership. @ownership Borrowed from the owner that created this observation. @nullable Yes. @lifetime Valid only while the owner epoch remains current and no owner mutation, restore, clear or destruction has occurred. @thread Use on the owner thread; the wrapper provides no synchronization. @reentrancy Does not extend lifetime or invoke callbacks.
在文件 RuntimeBorrow.h 第 48 行定义.
◆ isBound()
|
inlineconstexprnoexcept |
Returns whether the observation currently names an object.
在文件 RuntimeBorrow.h 第 50 行定义.
◆ operator*()
|
inlineconstexprnoexcept |
Dereferences the borrowed object; the caller owns validity proof.
在文件 RuntimeBorrow.h 第 56 行定义.
◆ operator->()
|
inlineconstexprnoexcept |
Pointer-like access to the borrowed object.
在文件 RuntimeBorrow.h 第 54 行定义.
◆ ownerEpoch()
|
inlineconstexprnoexcept |
Returns the epoch of the owner that produced this observation.
在文件 RuntimeBorrow.h 第 52 行定义.
该类的文档由以下文件生成:
- src/engine/common/RuntimeBorrow.h