载入中...
搜索中...
未找到
CapabilityOwned.h
浏览该文件的文档.
48 : handle_(std::exchange(other.handle_, OwnedProviderHandle{})), provider_(std::move(other.provider_)) {}
100 [[nodiscard]] static Result<OwnedProviderHandle> provide(std::string id, std::shared_ptr<I> provider) {
117 OwnedProviderLease<I>(record.value().handle, std::static_pointer_cast<I>(record.value().provider)),
128 OwnedProviderLease<I>(record.value().handle, std::static_pointer_cast<I>(record.value().provider)),
Stable, structured diagnostics shared by engine modules.
Move-only, checked operation results for the common layer.
Structured operation status used by the common Result foundation.
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:196
static Status success(StatusCode code=StatusCode::Ok)
Construct a successful status with an explicit non-error outcome.
Definition Status.cpp:19
Owning lease that keeps a shared_ptr provider alive while borrowed.
Definition CapabilityOwned.h:38
I * get() const noexcept
Borrowed interface pointer valid while this lease remains alive.
Definition CapabilityOwned.h:61
OwnedProviderLease & operator=(const OwnedProviderLease &other)=default
Share other, releasing this lease's previous ownership.
I * operator->() const noexcept
Definition CapabilityOwned.h:63
OwnedProviderLease()=default
OwnedProviderLease(OwnedProviderLease &&other) noexcept
Transfer ownership and identity, leaving other empty with generation zero.
Definition CapabilityOwned.h:47
const OwnedProviderHandle & handle() const noexcept
Definition CapabilityOwned.h:58
I & operator*() const noexcept
Definition CapabilityOwned.h:62
OwnedProviderLease & operator=(OwnedProviderLease &&other) noexcept
Transfer other and empty it; self-move preserves this lease.
Definition CapabilityOwned.h:50
OwnedProviderLease(const OwnedProviderLease &other)=default
Share the provider and its generation identity with other.
Thread-safe owned-provider table keyed by capability name + provider id.
Definition CapabilityOwned.h:92
static Result< void > unload(const OwnedProviderHandle &handle)
Unpublish one exact provider generation and clear the borrowed slot when it matches.
Definition CapabilityOwned.h:135
static Result< OwnedProviderLease< I > > acquire(std::string_view id)
Acquire the current generation published under id.
Definition CapabilityOwned.h:124
static Result< OwnedProviderLease< I > > acquire(const OwnedProviderHandle &handle)
Acquire an owning lease for an exact handle generation.
Definition CapabilityOwned.h:113
static Result< OwnedProviderHandle > provide(std::string id, std::shared_ptr< I > provider)
Publish an owning provider under id, replacing only after explicit unload.
Definition CapabilityOwned.h:100
ProviderRegistry< void > & ownedRegistry(const char *capabilityName)
Definition CapabilityOwned.cpp:18
void clearOwnedRaw()
Clear publications for isolated tests after borrowed dispatch has stopped.
Definition CapabilityOwned.cpp:25
std::mutex & ownedPublicationMutex()
Process-owned type-erased store; one canonical instance across link groups.
Definition CapabilityOwned.cpp:16
Definition Capability.cpp:9
@ Applied
Definition Container.h:602
Owning identity of one publication; generations are local to its registry.
Definition ProviderRegistry.h:19