载入中...
搜索中...
未找到
EditorAutomationTargetFactory.h
浏览该文件的文档.
1#pragma once
2
6
7#include <algorithm>
8#include <memory>
9#include <string_view>
10#include <vector>
11
12namespace eve::editor {
13
16 // Declared first so reverse destruction destroys the borrowing target before its support object.
17 std::shared_ptr<void> support;
18 std::unique_ptr<IEditableTarget> target;
19};
20
23public:
24 static constexpr const char* capabilityName = "IEditorAutomationTargetFactory";
25
28
39 [[nodiscard]] virtual std::vector<std::string_view> types() const = 0;
40
42 [[nodiscard]] bool supports(std::string_view type) const {
43 const std::vector<std::string_view> accepted = types();
45 return std::find(accepted.begin(), accepted.end(), type) != accepted.end();
46 }
47
53 const TargetId& target, std::string_view type, const EditorValue::Object& request) = 0;
54};
55
56} // namespace eve::editor
LogicalId target
const GltfImportRequest & request
Move-only operation result carrying either a value or Status.
Definition Result.h:155
UUID-backed identifier adapter for legacy textual boundaries.
Definition Identity.h:314
std::map< std::string, Value > Object
Multi-provider extension point for domain-specific automation target creation.
bool supports(std::string_view type) const
Whether this factory owns the requested stable target type.
virtual std::vector< std::string_view > types() const =0
Stable target type names this factory accepts.
virtual ~IEditorAutomationTargetFactory()=default
Releases IEditorAutomationTargetFactory resources.
virtual Result< AutomationOwnedTarget > create(const TargetId &target, std::string_view type, const EditorValue::Object &request)=0
Create a domain target from an automation request. @ownership Success transfers the target and any su...
Target plus optional borrowed-dependency owner returned by an automation factory.
std::unique_ptr< IEditableTarget > target