载入中...
搜索中...
未找到
StateAccessAdapter.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4
10#include "common/StateAccess.h"
12
13namespace eve::statepatch {
14
23public:
25 explicit StatePatchStateAdapter(Store& store) noexcept : store_(store) {}
26
29 [[nodiscard]] std::optional<eve::Value> value(std::string_view subject, std::string_view key) const override;
32 [[nodiscard]] std::optional<bool> hasTag(std::string_view subject, std::string_view tag) const override;
35 [[nodiscard]] std::optional<eve::Value> attribute(std::string_view, std::string_view) const override {
36 return std::nullopt;
37 }
40 [[nodiscard]] std::optional<eve::Value> resource(std::string_view, std::string_view) const override {
41 return std::nullopt;
42 }
45 [[nodiscard]] std::optional<eve::Value> state(std::string_view subject, std::string_view key) const override;
48 [[nodiscard]] std::optional<bool> authority(std::string_view, std::string_view) const override {
49 return std::nullopt;
50 }
51
54 [[nodiscard]] eve::Result<eve::MutationReceipt> apply(std::span<const eve::StateMutation> mutations,
55 const eve::MutationContext& context) override;
56
57private:
58 Store& store_;
59};
60
61} // namespace eve::statepatch
double value
int subject
Definition AnimSmr.cpp:163
#define EVENGINE_API_FOUNDATION
每个链接组(link group)各自的导出宏。
Definition Export.h:106
std::uint32_t key
const std::string * tag
Consumer-owned query and mutation contracts for authoritative world state.
const VegetationPresetContext & context
Move-only operation result carrying either a value or Status.
Definition Result.h:155
All-or-nothing mutation boundary owned by the consumer.
Read-only world-state boundary owned by consumers such as Dialogue.
Definition StateAccess.h:79
Adapts one persistent Store to state queries and transactional writes.
StatePatchStateAdapter(Store &store) noexcept
Bind a borrowed authoritative persistent store.
std::optional< bool > authority(std::string_view, std::string_view) const override
Query read-only authority for a scope.
std::optional< eve::Value > resource(std::string_view, std::string_view) const override
Query a resource value or marker.
std::optional< eve::Value > attribute(std::string_view, std::string_view) const override
Query a numeric or structured attribute.
Deterministic subject-and-key JSON value store with atomic patching.
Definition StatePatch.h:119
Correlation metadata shared by a mutation transaction.
Definition StateAccess.h:57