载入中...
搜索中...
未找到
CapabilityOwned.h
浏览该文件的文档.
39 [[nodiscard]] friend bool operator==(const OwnedProviderHandle&, const OwnedProviderHandle&) = default;
114EVENGINE_API_FOUNDATION std::unordered_map<std::string, OwnedSlot>& ownedSlots(const char* capabilityName);
115EVENGINE_API_FOUNDATION std::unordered_map<std::string, std::uint64_t>& ownedGenerations(const char* capabilityName);
134 [[nodiscard]] static Result<OwnedProviderHandle> provide(std::string id, std::shared_ptr<I> provider) {
154 return Result<OwnedProviderHandle>::success(std::move(handle), Status::success(StatusCode::Applied));
194 OwnedProviderLease<I>(found->second.handle, std::move(typed)), Status::success(StatusCode::Applied));
std::unordered_map< std::string, std::unordered_map< std::string, std::uint64_t > > generations
Definition CapabilityOwned.cpp:9
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.
Owning lease that keeps a shared_ptr provider alive while borrowed.
Definition CapabilityOwned.h:50
I * get() const noexcept
Borrowed interface pointer valid while this lease remains alive.
Definition CapabilityOwned.h:57
I * operator->() const noexcept
Definition CapabilityOwned.h:59
OwnedProviderLease()=default
const OwnedProviderHandle & handle() const noexcept
Definition CapabilityOwned.h:54
I & operator*() const noexcept
Definition CapabilityOwned.h:58
Thread-safe owned-provider table keyed by capability name + provider id.
Definition CapabilityOwned.h:126
static Result< void > unload(const OwnedProviderHandle &handle)
Unpublish one exact provider generation and clear the borrowed slot when it matches.
Definition CapabilityOwned.h:200
static Result< OwnedProviderLease< I > > acquire(std::string_view id)
Acquire the current generation published under id.
Definition CapabilityOwned.h:184
static Result< OwnedProviderLease< I > > acquire(const OwnedProviderHandle &handle)
Acquire an owning lease for an exact handle generation.
Definition CapabilityOwned.h:161
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:134
std::unordered_map< std::string, OwnedSlot > & ownedSlots(const char *capabilityName)
Definition CapabilityOwned.cpp:21
std::unordered_map< std::string, std::uint64_t > & ownedGenerations(const char *capabilityName)
Definition CapabilityOwned.cpp:25
Definition Capability.cpp:9
Definition Container.h:602
Generation-qualified id for one owned capability provider.
Definition CapabilityOwned.h:35
friend bool operator==(const OwnedProviderHandle &, const OwnedProviderHandle &)=default