Skip to main content

commands::CommandContext

commands::CommandContext

Runtime context provided to every command at execution time. More…

#include <CommandContext.hpp>

Public Attributes

Name
std::shared_ptr< DataManager > data_manager
Shared DataManager that commands read from and mutate.
TimeController * time_controller
Optional visualization time controller.
std::map< std::string, std::string > runtime_variables
Runtime-resolved values for ${variable} substitution in command parameters.
std::function< void(float)> on_progress
Optional progress callback invoked during long-running commands.
CommandRecorder * recorder
Optional recorder for capturing executed command descriptors.

Detailed Description

struct commands::CommandContext;

Runtime context provided to every command at execution time.

This struct is not serialized — it is the environment that commands run in.

Public Attributes Documentation

variable data_manager

std::shared_ptr< DataManager > data_manager;

Shared DataManager that commands read from and mutate.

Must be non-null for most commands.

variable time_controller

TimeController * time_controller = nullptr;

Optional visualization time controller.

Typically sourced from [EditorRegistry::timeController()](/api_generated/Classes/classEditorRegistry.md#function-timecontroller). Commands such as [AdvanceFrame](/api_generated/Classes/classcommands_1_1AdvanceFrame.md) require this to be non-null.

variable runtime_variables

std::map< std::string, std::string > runtime_variables;

Runtime-resolved values for ${variable} substitution in command parameters.

Examples include current_frame and mark_frame.

variable on_progress

std::function< void(float)> on_progress;

Optional progress callback invoked during long-running commands.

Receives values in the range [0.0, 1.0].

variable recorder

CommandRecorder * recorder = nullptr;

Optional recorder for capturing executed command descriptors.

Used by executeSequence() as a fallback when no explicit recorder is passed.


Updated on 2026-11-13 at 20:25:42 +0000