载入中...
搜索中...
未找到
eve::cap::ProviderRef< I > 模板类 参考

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.
 

详细描述

template<class I>
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]

template<class I >
eve::cap::ProviderRef< I >::ProviderRef ( )
default

被这些函数引用 eve::cap::ProviderRef< I >::bind().

◆ ProviderRef() [2/4]

template<class I >
eve::cap::ProviderRef< I >::ProviderRef ( I *  impl)
inlineexplicitnoexcept

Capture an already-resolved provider pointer (may be nullptr).

在文件 Capability.h 第 111 行定义.

◆ ProviderRef() [3/4]

template<class I >
eve::cap::ProviderRef< I >::ProviderRef ( const ProviderRef< I > &  )
delete

◆ ProviderRef() [4/4]

template<class I >
eve::cap::ProviderRef< I >::ProviderRef ( ProviderRef< I > &&  other)
inlinenoexcept

在文件 Capability.h 第 115 行定义.

成员函数说明

◆ bind()

template<class I >
static ProviderRef eve::cap::ProviderRef< I >::bind ( )
inlinestatic

Resolve I once from the registry.

返回
A ProviderRef holding the current provider, or an empty one when absent.

在文件 Capability.h 第 128 行定义.

引用了 eve::cap::ProviderRef< I >::ProviderRef().

◆ get()

template<class I >
I * eve::cap::ProviderRef< I >::get ( ) const
inlinenoexcept

Borrowed provider, or nullptr when unbound / absent at bind time.

在文件 Capability.h 第 131 行定义.

◆ operator bool()

template<class I >
eve::cap::ProviderRef< I >::operator bool ( ) const
inlineexplicitnoexcept

在文件 Capability.h 第 132 行定义.

◆ operator*()

template<class I >
I & eve::cap::ProviderRef< I >::operator* ( ) const
inlinenoexcept

在文件 Capability.h 第 133 行定义.

◆ operator->()

template<class I >
I * eve::cap::ProviderRef< I >::operator-> ( ) const
inlinenoexcept

在文件 Capability.h 第 134 行定义.

◆ operator=() [1/2]

template<class I >
ProviderRef & eve::cap::ProviderRef< I >::operator= ( const ProviderRef< I > &  )
delete

◆ operator=() [2/2]

template<class I >
ProviderRef & eve::cap::ProviderRef< I >::operator= ( ProviderRef< I > &&  other)
inlinenoexcept

在文件 Capability.h 第 116 行定义.


该类的文档由以下文件生成: