载入中...
搜索中...
未找到
EditorTargetCoordinator.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4
8
9#include <cstdint>
10#include <memory>
11#include <string>
12#include <vector>
13
14namespace eve::editor {
15
16class EditorSession;
17class IEditorTransactionBackend;
18
27public:
32
35
37 [[nodiscard]] eve::editing::Result<void> registerPlannedCommand(
41 [[nodiscard]] eve::editing::Result<std::size_t> unregisterOwner(
42 const std::string& ownerModule) override;
44 [[nodiscard]] Result<void> registerTarget(IEditableTarget& target);
49 [[nodiscard]] Result<void> registerSharedHistoryTarget(IEditableTarget& target, IEditorTransactionBackend& backend);
53 [[nodiscard]] Result<void> unregisterSharedHistoryTarget(IEditableTarget& target,
56 [[nodiscard]] std::weak_ptr<void> lifetime() const;
58 [[nodiscard]] Result<void> unregisterTarget(const TargetId& target);
60 [[nodiscard]] Result<void> bind(EditorSession& session, const TargetId& target);
62 [[nodiscard]] Result<EditorValue> inspect(const TargetId& target) const;
64 [[nodiscard]] Result<TransactionReceipt> undo(const TargetId& target);
66 [[nodiscard]] Result<TransactionReceipt> redo(const TargetId& target);
67
70 std::string id;
71 std::string type; // IEditableTarget::describe().type, when the target reports one
72 std::uint64_t revision = 0;
73 std::uint64_t generation = 0;
74 };
75
85 [[nodiscard]] std::vector<TargetSummary> targets() const;
86
87private:
88 friend class EditorSession;
89 void detach(EditorSession& session) noexcept;
90
91 struct Impl;
92 std::unique_ptr<Impl> impl_;
93};
94
95} // namespace eve::editor
LogicalId target
std::string descriptor
std::uint64_t revision
Generation generation
Definition ECS.cpp:40
#define EVENGINE_API_ORCHESTRATION
Definition Export.h:111
std::vector< FieldTarget > targets
std::weak_ptr< const void > lifetime
OceanRenderBackend backend
std::optional< InteractionSession > session
Definition Tactics.cpp:39
std::vector< VegetationPresetCommand > commands
Move-only operation result carrying either a value or Status.
Definition Result.h:176
UUID-backed identifier adapter for legacy textual boundaries.
Definition Identity.h:313
IEditableTarget public API.
Lower-layer registration boundary implemented by an editor or runtime editing host.
Registry and execution gate for UI-, script- and automation-neutral commands.
Hosts interchangeable editor tools and routes their lifecycle/input.
Coordinates editable targets, per-target histories and domain commands.
EditorTargetCoordinator(const EditorTargetCoordinator &)=delete
EditorTargetCoordinator & operator=(const EditorTargetCoordinator &)=delete
Transaction boundary consumed by editor property and other UI models.
std::function< Result< CommandPlan >(IEditableTarget &, const CommandRequest &)> EditingCommandPlanner
Side-effect-free planner invoked with the resolved target.
Domain-owned metadata for one planned editing command.
Discovery metadata for one registered editable target.