载入中...
搜索中...
未找到
StateAccessAdapter.h
浏览该文件的文档.
1#pragma once
2
9#include "tags/TagStore.h"
10
11namespace eve::tags {
12
21public:
23 explicit TagStoreStateAdapter(TagStore& store) noexcept : store_(store) {}
24
27 [[nodiscard]] std::optional<eve::Value> value(std::string_view subject, std::string_view key) const override;
30 [[nodiscard]] std::optional<bool> hasTag(std::string_view subject, std::string_view tag) const override;
33 [[nodiscard]] std::optional<eve::Value> attribute(std::string_view, std::string_view) const override {
34 return std::nullopt;
35 }
38 [[nodiscard]] std::optional<eve::Value> resource(std::string_view, std::string_view) const override {
39 return std::nullopt;
40 }
43 [[nodiscard]] std::optional<eve::Value> state(std::string_view subject, std::string_view key) const override;
46 [[nodiscard]] std::optional<bool> authority(std::string_view, std::string_view) const override {
47 return std::nullopt;
48 }
49
52 [[nodiscard]] eve::Result<eve::MutationReceipt> apply(std::span<const eve::StateMutation> mutations,
53 const eve::MutationContext& context) override;
54
55private:
56 TagStore& store_;
57};
58
59} // namespace eve::tags
double value
int subject
Definition AnimSmr.cpp:163
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 TagStore to read tags and apply volatile tag mutations.
std::optional< eve::Value > attribute(std::string_view, std::string_view) const override
Query a numeric or structured attribute.
TagStoreStateAdapter(TagStore &store) noexcept
Bind a borrowed authoritative TagStore.
std::optional< bool > authority(std::string_view, std::string_view) const override
Query read-only authority for a scope.
eve::Result< eve::MutationReceipt > apply(std::span< const eve::StateMutation > mutations, const eve::MutationContext &context) override
Apply a complete mutation set atomically.
std::optional< eve::Value > resource(std::string_view, std::string_view) const override
Query a resource value or marker.
std::optional< bool > hasTag(std::string_view subject, std::string_view tag) const override
Query exact tag membership.
Deterministic storage for generic tags and capabilities.
Definition TagStore.h:27
Correlation metadata shared by a mutation transaction.
Definition StateAccess.h:57