commands::CommandRecorder
commands::CommandRecorder
Records CommandDescriptors during sequence execution for replay, golden trace tests, and eventual integration into the Action Journal (Phase 4). More…
#include <CommandRecorder.hpp>
Public Functions
| Name | |
|---|---|
| void | record(CommandDescriptor desc) Append a command descriptor to the trace. |
| auto const & | trace() const Access the recorded trace. |
| CommandSequenceDescriptor | toSequence(std::string name =““) const Produce a CommandSequenceDescriptor from the recorded trace. |
| void | clear() Reset the recorder, clearing all recorded descriptors. |
| size_t | size() const Return the number of recorded descriptors. |
| bool | empty() const Report whether the trace is empty. |
Detailed Description
class commands::CommandRecorder;Records CommandDescriptors during sequence execution for replay, golden trace tests, and eventual integration into the Action Journal (Phase 4).
This is intentionally minimal: it appends descriptors, returns the trace, and can produce a CommandSequenceDescriptor suitable for JSON serialization and replay.
Public Functions Documentation
function record
void record(
CommandDescriptor desc
)Append a command descriptor to the trace.
Parameters:
- desc Descriptor to record (moved into internal storage).
function trace
inline auto const & trace() constAccess the recorded trace.
Return: Const reference to the ordered list of recorded descriptors.
function toSequence
CommandSequenceDescriptor toSequence(
std::string name =""
) constProduce a CommandSequenceDescriptor from the recorded trace.
Parameters:
- name Optional name for the generated sequence.
Return: A sequence descriptor containing the recorded commands.
function clear
void clear()Reset the recorder, clearing all recorded descriptors.
function size
inline size_t size() constReturn the number of recorded descriptors.
Return: Count of descriptors in the trace.
function empty
inline bool empty() constReport whether the trace is empty.
Return: True if no descriptors have been recorded.
Updated on 2026-11-13 at 20:25:42 +0000