Skip to main content

triage::TriageSession

triage::TriageSession

Mark/Commit/Recall state machine consuming command sequences. More…

#include <TriageSession.hpp>

Public Types

Name
enum class State { Idle, Marking}

Public Functions

Name
TriageSession()
void setPipeline(commands::CommandSequenceDescriptor pipeline)
Set the command pipeline to execute on commit.
commands::CommandSequenceDescriptor const & pipeline() const
Access the current pipeline.
void mark(TimeFrameIndex frame)
Begin marking from the given frame. Transitions Idle -> Marking. No-op if already Marking.
void recall()
Abort the current marking and reset to Idle. The caller is responsible for jumping back to the mark frame. No-op if already Idle.
commands::CommandResult commit(TimeFrameIndex current_frame, std::shared_ptr< DataManager > dm, TimeController * time_controller =[nullptr], commands::CommandRecorder * recorder =[nullptr])
Execute the pipeline for [mark_frame, current_frame] and transition to Idle on success.
State state() const
Current state of the session.
TimeFrameIndex markFrame() const
The frame where marking started. Only meaningful when state == Marking.
std::vector< std::unique_ptr< commands::ICommand > > const & lastCommitCommands() const
Commands from the last successful commit (retained for undo support).
std::vector< std::unique_ptr< commands::ICommand > > takeLastCommitCommands()
Take ownership of the last commit’s commands (moves them out).

Detailed Description

class triage::TriageSession;

Mark/Commit/Recall state machine consuming command sequences.

The triage session is a consumer of the command architecture, not a bespoke system. It manages a simple state machine and, on commit, executes a user-configured CommandSequenceDescriptor.

State transitions: IDLE –[mark]–> MARKING –[commit]–> IDLE |–[recall]–> IDLE

Public Types Documentation

enum State

Enumerator Value Description
Idle
Marking

Public Functions Documentation

function TriageSession

TriageSession()

function setPipeline

void setPipeline(
    commands::CommandSequenceDescriptor pipeline
)

Set the command pipeline to execute on commit.

function pipeline

commands::CommandSequenceDescriptor const & pipeline() const

Access the current pipeline.

function mark

void mark(
    TimeFrameIndex frame
)

Begin marking from the given frame. Transitions Idle -> Marking. No-op if already Marking.

function recall

void recall()

Abort the current marking and reset to Idle. The caller is responsible for jumping back to the mark frame. No-op if already Idle.

function commit

commands::CommandResult commit(
    TimeFrameIndex current_frame,
    std::shared_ptr< DataManager > dm,
    TimeController * time_controller =nullptr,
    commands::CommandRecorder * recorder =nullptr
)

Execute the pipeline for [mark_frame, current_frame] and transition to Idle on success.

Parameters:

  • current_frame The end frame of the triage range
  • dm The DataManager to operate on
  • time_controller Optional pointer passed to CommandContext (e.g. for AdvanceFrame)
  • recorder Optional CommandRecorder for recording executed commands

Return: CommandResult indicating success or failure. On failure, state remains Marking so the user can retry or recall.

function state

State state() const

Current state of the session.

function markFrame

TimeFrameIndex markFrame() const

The frame where marking started. Only meaningful when state == Marking.

function lastCommitCommands

std::vector< std::unique_ptr< commands::ICommand > > const & lastCommitCommands() const

Commands from the last successful commit (retained for undo support).

function takeLastCommitCommands

std::vector< std::unique_ptr< commands::ICommand > > takeLastCommitCommands()

Take ownership of the last commit’s commands (moves them out).


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