载入中...
搜索中...
未找到
eve::script::Borrowed< T > 模板类 参考
Non-owning C++ observation with no implicit lifetime extension. 更多...
#include <RuntimeRegistry.h>
Public 成员函数 | |
| constexpr | Borrowed () noexcept=default |
| Constructs a Borrowed. | |
| constexpr | Borrowed (T *value, std::uint64_t ownerEpoch=0) noexcept |
| Constructs a Borrowed. | |
| constexpr | Borrowed (T &value, std::uint64_t ownerEpoch=0) noexcept |
| Constructs a Borrowed. | |
| 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. | |
详细描述
template<class T>
class eve::script::Borrowed< T >
class eve::script::Borrowed< T >
Non-owning C++ observation with no implicit lifetime extension.
- 模板参数
-
T Observed object type, possibly const-qualified.
- 备注
- The owner must outlive every use. This type intentionally has no reset-to-own or heap-management operation.
Borrowed public API.
在文件 RuntimeRegistry.h 第 42 行定义.
构造及析构函数说明
◆ Borrowed() [1/3]
template<class T >
|
constexprdefaultnoexcept |
Constructs a Borrowed.
◆ Borrowed() [2/3]
template<class T >
|
inlineexplicitconstexprnoexcept |
◆ Borrowed() [3/3]
template<class T >
|
inlineexplicitconstexprnoexcept |
成员函数说明
◆ get()
template<class T >
|
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.
在文件 RuntimeRegistry.h 第 65 行定义.
◆ isBound()
template<class T >
|
inlineconstexprnoexcept |
Returns whether the observation currently names an object.
在文件 RuntimeRegistry.h 第 67 行定义.
◆ operator*()
template<class T >
|
inlineconstexprnoexcept |
Dereferences the borrowed object; the caller owns validity proof.
在文件 RuntimeRegistry.h 第 73 行定义.
◆ operator->()
template<class T >
|
inlineconstexprnoexcept |
Pointer-like access to the borrowed object.
在文件 RuntimeRegistry.h 第 71 行定义.
◆ ownerEpoch()
template<class T >
|
inlineconstexprnoexcept |
Returns the epoch of the owner that produced this observation.
在文件 RuntimeRegistry.h 第 69 行定义.
该类的文档由以下文件生成:
- src/engine/common/RuntimeRegistry.h