载入中...
搜索中...
未找到
eve::editor::EditorCommandService类 参考

Registry and execution gate for UI-, script- and automation-neutral commands. 更多...

#include <EditorCommandService.h>

Public 成员函数

Result< EditorValue > registerCommand (CommandDescriptor descriptor, EditorCommandHandler handler, bool replace=false)
 Register one command.
 
Result< EditorValue > registerPlannedCommand (CommandDescriptor descriptor, EditorCommandPlanner planner, EditorCommandPlanExecutor executor, bool replace=false)
 Register a side-effect-free planner and explicit plan executor.
 
bool unregisterCommand (const CommandId &id, const std::string &ownerModule={})
 Remove one command, optionally requiring a matching owner.
 
size_t unregisterOwner (const std::string &ownerModule)
 Remove every command registered by a module.
 
void clear ()
 Remove all registrations. Primarily useful for isolated tests.
 
const CommandDescriptor * find (const CommandId &id) const
 Return command metadata or nullptr when it is not registered.
 
bool supportsPlanning (const CommandId &id) const
 Return whether the registered command requires plan/commit execution.
 
std::vector< CommandDescriptor > commands (const HostProfile &profile) const
 Return descriptors visible to a host profile.
 
uint64_t revision () const
 Monotonic registry generation changed by registration mutations.
 
Result< EditorValue > execute (const CommandId &id, const CommandContext &context, const EditorValue &payload) const
 Execute a command after payload and profile checks.
 
Result< CommandPlan > plan (const CommandRequest &request, const HostProfile &profile) const
 Produce a side-effect-free plan bound to the target, command generation, payload and source.
 
Result< TransactionReceipt > executePlan (const CommandRequest &request, const CommandPlan &plan, const HostProfile &profile) const
 Execute a plan only when its lifetime, registration, policy and input bindings remain valid.
 

详细描述

Registry and execution gate for UI-, script- and automation-neutral commands.

Registration is intended for module startup on the main thread. Execution is synchronous in this first slice; asynchronous work should return a stable task handle as its EditorValue.

在文件 EditorCommandService.h 第 51 行定义.

成员函数说明

◆ clear()

void eve::editor::EditorCommandService::clear ( )

Remove all registrations. Primarily useful for isolated tests.

在文件 EditorCommandService.cpp 第 101 行定义.

◆ commands()

std::vector< CommandDescriptor > eve::editor::EditorCommandService::commands ( const HostProfile &  profile) const

Return descriptors visible to a host profile.

在文件 EditorCommandService.cpp 第 119 行定义.

引用了 eve::editor::HostProfile::allowsCommand() , 以及 eve::editor::HostProfile::hasFeatures().

被这些函数引用 eve::editor::EditorSession::availableCommands().

◆ execute()

Result< EditorValue > eve::editor::EditorCommandService::execute ( const CommandId &  id,
const CommandContext &  context,
const EditorValue &  payload 
) const

Execute a command after payload and profile checks.

参数
idRegistered command identity.
contextCaptured session, target, source and host profile.
payloadStructured input value.
返回
Handler result or a structured rejection/failure.

在文件 EditorCommandService.cpp 第 128 行定义.

引用了 context, error, payload , 以及 value.

被这些函数引用 eve::editor::EditorSession::executeCommand().

◆ executePlan()

Result< TransactionReceipt > eve::editor::EditorCommandService::executePlan ( const CommandRequest &  request,
const CommandPlan &  plan,
const HostProfile &  profile 
) const

Execute a plan only when its lifetime, registration, policy and input bindings remain valid.

在文件 EditorCommandService.cpp 第 195 行定义.

引用了 message, plan(), request , 以及 status.

被这些函数引用 eve::editor::EditorSession::executePlan().

◆ find()

const CommandDescriptor * eve::editor::EditorCommandService::find ( const CommandId &  id) const

Return command metadata or nullptr when it is not registered.

在文件 EditorCommandService.cpp 第 107 行定义.

被这些函数引用 eve::editor::EditorSession::executeCommand().

◆ plan()

Result< CommandPlan > eve::editor::EditorCommandService::plan ( const CommandRequest &  request,
const HostProfile &  profile 
) const

Produce a side-effect-free plan bound to the target, command generation, payload and source.

在文件 EditorCommandService.cpp 第 154 行定义.

引用了 message, eve::Result< T >::ok(), request, status , 以及 eve::Result< T >::value().

被这些函数引用 executePlan() , 以及 eve::editor::EditorSession::planCommand().

◆ registerCommand()

Result< EditorValue > eve::editor::EditorCommandService::registerCommand ( CommandDescriptor  descriptor,
EditorCommandHandler  handler,
bool  replace = false 
)

Register one command.

参数
descriptorStable metadata. id and ownerModule must be non-empty.
handlerFunction invoked after host/profile checks.
replaceTrue to replace an existing command owned by the same module.
返回
Applied on success, Rejected for invalid or duplicate registration.

在文件 EditorCommandService.cpp 第 39 行定义.

引用了 descriptor, error , 以及 handler.

被这些函数引用 eve::editor::EditorExtensionRegistry::registerCommand().

◆ registerPlannedCommand()

Result< EditorValue > eve::editor::EditorCommandService::registerPlannedCommand ( CommandDescriptor  descriptor,
EditorCommandPlanner  planner,
EditorCommandPlanExecutor  executor,
bool  replace = false 
)

Register a side-effect-free planner and explicit plan executor.

参数
descriptorStable command metadata.
plannerFunction that validates and produces a plan.
executorFunction that commits an accepted plan.
replaceTrue to replace the same owner's registration.
返回
Applied on success, otherwise a structured registration error.

在文件 EditorCommandService.cpp 第 59 行定义.

引用了 descriptor , 以及 error.

◆ revision()

uint64_t eve::editor::EditorCommandService::revision ( ) const
inline

Monotonic registry generation changed by registration mutations.

在文件 EditorCommandService.h 第 86 行定义.

◆ supportsPlanning()

bool eve::editor::EditorCommandService::supportsPlanning ( const CommandId &  id) const

Return whether the registered command requires plan/commit execution.

在文件 EditorCommandService.cpp 第 113 行定义.

被这些函数引用 eve::editor::EditorAutomationProvider::invoke().

◆ unregisterCommand()

bool eve::editor::EditorCommandService::unregisterCommand ( const CommandId &  id,
const std::string &  ownerModule = {} 
)

Remove one command, optionally requiring a matching owner.

在文件 EditorCommandService.cpp 第 82 行定义.

◆ unregisterOwner()

size_t eve::editor::EditorCommandService::unregisterOwner ( const std::string &  ownerModule)

Remove every command registered by a module.

在文件 EditorCommandService.cpp 第 92 行定义.

引用了 removed.

被这些函数引用 eve::editor::EditorExtensionRegistry::unload().


该类的文档由以下文件生成: