![]() |
Olympe Engine 2.0
2D Game Engine with ECS Architecture
|
Records execution trace during graph simulation. More...
#include <GraphExecutionTracer.h>
Public Member Functions | |
| GraphExecutionTracer () | |
| ~GraphExecutionTracer () | |
| void | Reset () |
| Clears all recorded events and resets state. | |
| void | RecordNodeEntered (int32_t nodeId, const std::string &nodeName, const std::string &nodeType) |
| Records that execution entered a node. | |
| void | RecordNodeExited (int32_t nodeId, int32_t nextNodeId) |
| Records that execution exited a node successfully. | |
| void | RecordConditionEvaluated (int32_t nodeId, const std::string &expression, bool result, const std::string &message="") |
| Records a condition evaluation result. | |
| void | RecordBranchTaken (int32_t nodeId, const std::string &branchName, int32_t nextNodeId) |
| Records that a branch was taken based on condition. | |
| void | RecordError (int32_t nodeId, const std::string &nodeName, const std::string &errorMessage, const std::string &severity="Error") |
| Records an execution error. | |
| void | RecordExecutionBlocked (int32_t nodeId, const std::string &reason) |
| Records that execution was blocked (dead-end, etc.). | |
| void | RecordDataPinResolved (int32_t nodeId, const std::string &pinName, const std::string &value) |
| Records data pin resolution. | |
| void | RecordExecutionCompleted (bool success, const std::string &message) |
| Records graph execution completion. | |
| const std::vector< ExecutionEvent > & | GetEvents () const |
| Returns all recorded events. | |
| int32_t | GetStepCount () const |
| Returns the number of steps executed. | |
| bool | HasErrors () const |
| Returns true if any errors were recorded. | |
| const std::vector< int32_t > & | GetErrorNodes () const |
| Returns the set of node IDs that encountered errors. | |
| std::string | GetTraceLog () const |
| Returns a formatted trace log as a multi-line string. | |
| std::string | GetExecutionSummary () const |
| Returns a summary of the execution (steps, errors, etc.). | |
Private Member Functions | |
| void | AddEvent (const ExecutionEvent &event) |
Private Attributes | |
| std::vector< ExecutionEvent > | m_events |
| std::vector< int32_t > | m_errorNodes |
| int32_t | m_stepCount = 0 |
| bool | m_executionComplete = false |
| bool | m_executionSuccess = false |
Records execution trace during graph simulation.
Used by GraphExecutionSimulator to capture execution flow. Can be queried to understand why a graph failed or which path was taken.
Definition at line 70 of file GraphExecutionTracer.h.
| Olympe::GraphExecutionTracer::GraphExecutionTracer | ( | ) |
Definition at line 15 of file GraphExecutionTracer.cpp.
| Olympe::GraphExecutionTracer::~GraphExecutionTracer | ( | ) |
Definition at line 20 of file GraphExecutionTracer.cpp.
|
private |
Definition at line 240 of file GraphExecutionTracer.cpp.
References GetComponentTypeID_Static(), and m_events.
Referenced by RecordBranchTaken(), RecordConditionEvaluated(), RecordDataPinResolved(), RecordError(), RecordExecutionBlocked(), RecordExecutionCompleted(), RecordNodeEntered(), and RecordNodeExited().
Here is the call graph for this function:
Here is the caller graph for this function:Returns the set of node IDs that encountered errors.
Definition at line 164 of file GraphExecutionTracer.h.
References m_errorNodes.
|
inline |
Returns all recorded events.
Definition at line 149 of file GraphExecutionTracer.h.
References m_events.
Referenced by Olympe::ExecutionTestPanel::DisplayTrace(), and Olympe::ExecutionTestPanel::RenderTraceLog().
Here is the caller graph for this function:| std::string Olympe::GraphExecutionTracer::GetExecutionSummary | ( | ) | const |
Returns a summary of the execution (steps, errors, etc.).
Definition at line 204 of file GraphExecutionTracer.cpp.
References Olympe::ConditionEvaluated, Olympe::ErrorOccurred, GetComponentTypeID_Static(), m_errorNodes, m_events, m_executionComplete, m_executionSuccess, m_stepCount, and Olympe::NodeEntered.
Referenced by Olympe::ExecutionTestPanel::GetTestSummary(), Olympe::ExecutionTestPanel::RenderSummary(), and Olympe::ExecutionTestPanel::RunExecutionTest().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Returns the number of steps executed.
Definition at line 154 of file GraphExecutionTracer.h.
References m_stepCount.
| std::string Olympe::GraphExecutionTracer::GetTraceLog | ( | ) | const |
Returns a formatted trace log as a multi-line string.
Definition at line 144 of file GraphExecutionTracer.cpp.
References Olympe::BranchTaken, Olympe::ConditionEvaluated, Olympe::DataPinResolved, Olympe::ErrorOccurred, Olympe::ExecutionBlocked, Olympe::ExecutionCompleted, GetComponentTypeID_Static(), m_errorNodes, m_events, m_executionComplete, m_executionSuccess, m_stepCount, Olympe::NodeEntered, Olympe::NodeExited, and Olympe::ExecutionEvent::nodeId.
Referenced by Olympe::ExecutionTestPanel::GetExecutionLog(), and Olympe::ExecutionTestPanel::RenderSummary().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Returns true if any errors were recorded.
Definition at line 159 of file GraphExecutionTracer.h.
References m_errorNodes.
| void Olympe::GraphExecutionTracer::RecordBranchTaken | ( | int32_t | nodeId, |
| const std::string & | branchName, | ||
| int32_t | nextNodeId | ||
| ) |
Records that a branch was taken based on condition.
| nodeId | ID of the branch node. |
| branchName | Name of the branch taken ("True", "False", case name, etc.). |
| nextNodeId | ID of the node being branched to. |
Definition at line 79 of file GraphExecutionTracer.cpp.
References AddEvent(), Olympe::BranchTaken, GetComponentTypeID_Static(), m_stepCount, and Olympe::ExecutionEvent::type.
Here is the call graph for this function:| void Olympe::GraphExecutionTracer::RecordConditionEvaluated | ( | int32_t | nodeId, |
| const std::string & | expression, | ||
| bool | result, | ||
| const std::string & | message = "" |
||
| ) |
Records a condition evaluation result.
| nodeId | ID of the node containing the condition. |
| expression | String representation of the condition. |
| result | Whether the condition evaluated to true. |
| message | Optional additional details. |
Definition at line 62 of file GraphExecutionTracer.cpp.
References AddEvent(), Olympe::ConditionEvaluated, GetComponentTypeID_Static(), m_stepCount, and Olympe::ExecutionEvent::type.
Here is the call graph for this function:| void Olympe::GraphExecutionTracer::RecordDataPinResolved | ( | int32_t | nodeId, |
| const std::string & | pinName, | ||
| const std::string & | value | ||
| ) |
Records data pin resolution.
| nodeId | ID of the node. |
| pinName | Name of the pin. |
| value | Resolved value as string. |
Definition at line 121 of file GraphExecutionTracer.cpp.
References AddEvent(), Olympe::DataPinResolved, GetComponentTypeID_Static(), m_stepCount, and Olympe::ExecutionEvent::type.
Here is the call graph for this function:| void Olympe::GraphExecutionTracer::RecordError | ( | int32_t | nodeId, |
| const std::string & | nodeName, | ||
| const std::string & | errorMessage, | ||
| const std::string & | severity = "Error" |
||
| ) |
Records an execution error.
| nodeId | ID of the node where error occurred (NODE_INDEX_NONE for graph-level). |
| nodeName | Name of the node (if applicable). |
| errorMessage | Description of the error. |
| severity | "Error" or "Critical". |
Definition at line 89 of file GraphExecutionTracer.cpp.
References AddEvent(), Olympe::ErrorOccurred, GetComponentTypeID_Static(), m_errorNodes, m_stepCount, and Olympe::ExecutionEvent::type.
Here is the call graph for this function:| void Olympe::GraphExecutionTracer::RecordExecutionBlocked | ( | int32_t | nodeId, |
| const std::string & | reason | ||
| ) |
Records that execution was blocked (dead-end, etc.).
| nodeId | ID of the node causing the block. |
| reason | Why execution was blocked. |
Definition at line 106 of file GraphExecutionTracer.cpp.
References AddEvent(), Olympe::ExecutionBlocked, GetComponentTypeID_Static(), m_errorNodes, m_stepCount, and Olympe::ExecutionEvent::type.
Here is the call graph for this function:| void Olympe::GraphExecutionTracer::RecordExecutionCompleted | ( | bool | success, |
| const std::string & | message | ||
| ) |
Records graph execution completion.
| success | true if completed successfully, false if ended with error. |
| message | Summary message. |
Definition at line 131 of file GraphExecutionTracer.cpp.
References AddEvent(), Olympe::ExecutionCompleted, GetComponentTypeID_Static(), m_executionComplete, m_executionSuccess, m_stepCount, and Olympe::ExecutionEvent::type.
Here is the call graph for this function:| void Olympe::GraphExecutionTracer::RecordNodeEntered | ( | int32_t | nodeId, |
| const std::string & | nodeName, | ||
| const std::string & | nodeType | ||
| ) |
Records that execution entered a node.
| nodeId | ID of the node being entered. |
| nodeName | Display name of the node. |
| nodeType | Type of the node (from TaskNodeType). |
Definition at line 33 of file GraphExecutionTracer.cpp.
References AddEvent(), GetComponentTypeID_Static(), m_stepCount, Olympe::NodeEntered, and Olympe::ExecutionEvent::type.
Here is the call graph for this function:Records that execution exited a node successfully.
| nodeId | ID of the node being exited. |
| nextNodeId | ID of the next node in execution (NODE_INDEX_NONE if end). |
Definition at line 45 of file GraphExecutionTracer.cpp.
References AddEvent(), GetComponentTypeID_Static(), m_stepCount, Olympe::NodeExited, and Olympe::ExecutionEvent::type.
Here is the call graph for this function:| void Olympe::GraphExecutionTracer::Reset | ( | ) |
Clears all recorded events and resets state.
Definition at line 24 of file GraphExecutionTracer.cpp.
References m_errorNodes, m_events, m_executionComplete, m_executionSuccess, and m_stepCount.
Referenced by Olympe::ExecutionTestPanel::RunExecutionTest().
Here is the caller graph for this function:
|
private |
Definition at line 181 of file GraphExecutionTracer.h.
Referenced by GetErrorNodes(), GetExecutionSummary(), GetTraceLog(), HasErrors(), RecordError(), RecordExecutionBlocked(), and Reset().
|
private |
Definition at line 180 of file GraphExecutionTracer.h.
Referenced by AddEvent(), GetEvents(), GetExecutionSummary(), GetTraceLog(), and Reset().
Definition at line 183 of file GraphExecutionTracer.h.
Referenced by GetExecutionSummary(), GetTraceLog(), RecordExecutionCompleted(), and Reset().
Definition at line 184 of file GraphExecutionTracer.h.
Referenced by GetExecutionSummary(), GetTraceLog(), RecordExecutionCompleted(), and Reset().
|
private |
Definition at line 182 of file GraphExecutionTracer.h.
Referenced by GetExecutionSummary(), GetStepCount(), GetTraceLog(), RecordBranchTaken(), RecordConditionEvaluated(), RecordDataPinResolved(), RecordError(), RecordExecutionBlocked(), RecordExecutionCompleted(), RecordNodeEntered(), RecordNodeExited(), and Reset().