One-shot borrowed capability pointer for composition roots and hot paths. 更多...
#include <Capability.h>
Public 成员函数 | |
| ProviderRef ()=default | |
| ProviderRef (I *impl) noexcept | |
| Capture an already-resolved provider pointer (may be nullptr). | |
| ProviderRef (const ProviderRef &)=delete | |
| ProviderRef & | operator= (const ProviderRef &)=delete |
| ProviderRef (ProviderRef &&other) noexcept | |
| ProviderRef & | operator= (ProviderRef &&other) noexcept |
| I * | get () const noexcept |
| Borrowed provider, or nullptr when unbound / absent at bind time. | |
| operator bool () const noexcept | |
| I & | operator* () const noexcept |
| I * | operator-> () const noexcept |
静态 Public 成员函数 | |
| static ProviderRef | bind () |
Resolve I once from the registry. | |
详细描述
class eve::cap::ProviderRef< I >
One-shot borrowed capability pointer for composition roots and hot paths.
Resolve once at construction (or via bind()), store as a member, and never re-query the registry from a per-frame path. There is intentionally no requery() / operator() that hits the table again (R-MECH-2 / R-MECH-3).
@cost O(1) member access after construction; construction performs one registry lookup. @ownership Borrowed; the provider must outlive this reference or be revoked only after every ProviderRef that observed it has been destroyed. @lifetime Valid until the referenced provider is revoked/replaced; the cached pointer is not updated automatically. @thread Same affinity as query() — safe to read after registration has settled.
在文件 Capability.h 第 107 行定义.
构造及析构函数说明
◆ ProviderRef() [1/4]
|
default |
被这些函数引用 eve::cap::ProviderRef< I >::bind().
◆ ProviderRef() [2/4]
|
inlineexplicitnoexcept |
Capture an already-resolved provider pointer (may be nullptr).
在文件 Capability.h 第 111 行定义.
◆ ProviderRef() [3/4]
|
delete |
◆ ProviderRef() [4/4]
|
inlinenoexcept |
在文件 Capability.h 第 115 行定义.
成员函数说明
◆ bind()
|
inlinestatic |
Resolve I once from the registry.
- 返回
- A
ProviderRefholding the current provider, or an empty one when absent.
在文件 Capability.h 第 128 行定义.
◆ get()
|
inlinenoexcept |
Borrowed provider, or nullptr when unbound / absent at bind time.
在文件 Capability.h 第 131 行定义.
◆ operator bool()
|
inlineexplicitnoexcept |
在文件 Capability.h 第 132 行定义.
◆ operator*()
|
inlinenoexcept |
在文件 Capability.h 第 133 行定义.
◆ operator->()
|
inlinenoexcept |
在文件 Capability.h 第 134 行定义.
◆ operator=() [1/2]
|
delete |
◆ operator=() [2/2]
|
inlinenoexcept |
在文件 Capability.h 第 116 行定义.
该类的文档由以下文件生成:
- src/engine/common/Capability.h