Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
Olympe::SubGraphCallStack Struct Reference

Tracks the SubGraph call chain to detect cycles and enforce depth limits. More...

#include <VSGraphExecutor.h>

Public Member Functions

bool Contains (const std::string &path) const
 
void Push (const std::string &path)
 
void Pop ()
 

Public Attributes

std::vector< std::string > PathStack
 Stack of SubGraph file paths currently executing.
 
int32_t Depth = 0
 Current recursion depth.
 

Detailed Description

Tracks the SubGraph call chain to detect cycles and enforce depth limits.

Each SubGraph invocation pushes its file path onto PathStack before executing and pops it after. This allows O(n) cycle detection (n = depth) and guarantees that HandleSubGraph never recurses deeper than MAX_SUBGRAPH_DEPTH.

Definition at line 82 of file VSGraphExecutor.h.

Member Function Documentation

◆ Contains()

bool Olympe::SubGraphCallStack::Contains ( const std::string &  path) const
inline

Definition at line 86 of file VSGraphExecutor.h.

References GetComponentTypeID_Static(), and PathStack.

Referenced by Olympe::BehaviorTreeExecutor::ExecuteSubGraph().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Pop()

void Olympe::SubGraphCallStack::Pop ( )
inline

Definition at line 99 of file VSGraphExecutor.h.

References Depth, and PathStack.

Referenced by Olympe::BehaviorTreeExecutor::ExecuteSubGraph().

+ Here is the caller graph for this function:

◆ Push()

void Olympe::SubGraphCallStack::Push ( const std::string &  path)
inline

Definition at line 94 of file VSGraphExecutor.h.

References Depth, and PathStack.

Referenced by Olympe::BehaviorTreeExecutor::ExecuteSubGraph().

+ Here is the caller graph for this function:

Member Data Documentation

◆ Depth

int32_t Olympe::SubGraphCallStack::Depth = 0

Current recursion depth.

Definition at line 84 of file VSGraphExecutor.h.

Referenced by Pop(), and Push().

◆ PathStack

std::vector<std::string> Olympe::SubGraphCallStack::PathStack

Stack of SubGraph file paths currently executing.

Definition at line 83 of file VSGraphExecutor.h.

Referenced by Contains(), Pop(), and Push().


The documentation for this struct was generated from the following file: