Thread-safe owned-provider table keyed by capability name + provider id. 更多...
#include <CapabilityOwned.h>
静态 Public 成员函数 | |
| static Result< OwnedProviderHandle > | provide (std::string id, std::shared_ptr< I > provider) |
Publish an owning provider under id, replacing only after explicit unload. | |
| static Result< OwnedProviderLease< I > > | acquire (const OwnedProviderHandle &handle) |
| Acquire an owning lease for an exact handle generation. | |
| static Result< OwnedProviderLease< I > > | acquire (std::string_view id) |
Acquire the current generation published under id. | |
| static Result< void > | unload (const OwnedProviderHandle &handle) |
| Unpublish one exact provider generation and clear the borrowed slot when it matches. | |
详细描述
class eve::cap::OwnedProviderRegistry< I >
Thread-safe owned-provider table keyed by capability name + provider id.
@cost Register/acquire/unload take the owned-registry mutex; keep out of hot paths.
在文件 CapabilityOwned.h 第 92 行定义.
成员函数说明
◆ acquire() [1/2]
|
inlinestatic |
Acquire an owning lease for an exact handle generation.
- 返回
- Unsupported when absent, Conflict when the generation is stale.
在文件 CapabilityOwned.h 第 113 行定义.
引用了 eve::Applied, handle, eve::cap::detail::ownedRegistry(), record , 以及 eve::Status::success().
◆ acquire() [2/2]
|
inlinestatic |
Acquire the current generation published under id.
在文件 CapabilityOwned.h 第 124 行定义.
引用了 eve::Applied, eve::cap::detail::ownedRegistry(), record , 以及 eve::Status::success().
◆ provide()
|
inlinestatic |
Publish an owning provider under id, replacing only after explicit unload.
- 参数
-
id Non-empty stable provider id within capability I.provider Non-null shared ownership of the implementation.
- 返回
- Generation-qualified handle, or Conflict when
idis already published.
在文件 CapabilityOwned.h 第 100 行定义.
引用了 eve::cap::detail::ownedPublicationMutex(), eve::cap::detail::ownedRegistry(), provider, eve::cap::detail::provideRaw() , 以及 result.
◆ unload()
|
inlinestatic |
Unpublish one exact provider generation and clear the borrowed slot when it matches.
在文件 CapabilityOwned.h 第 135 行定义.
引用了 eve::Applied, eve::Result< T >::failure(), handle, eve::cap::detail::ownedPublicationMutex(), eve::cap::detail::ownedRegistry(), removed, eve::cap::detail::revokeRaw(), eve::Status::success() , 以及 eve::Result< T >::success().
该类的文档由以下文件生成:
- src/engine/common/CapabilityOwned.h