Dependency graph for component execution ordering.
More...
#include <TopologyAnalyzer.hpp>
|
| void | AddEdge (const std::string &producer, const std::string &consumer, const std::string &signal_name="") |
| | Add a dependency edge: producer must execute before consumer.
|
| void | AddNode (const std::string &component) |
| | Add a node without any edges.
|
| std::vector< std::string > | GetNodes () const |
| | Get all nodes in the graph.
|
| TopologyResult | TopologicalSort () const |
| | Perform topological sort using Kahn's algorithm.
|
| std::vector< CycleInfo > | DetectCycles () const |
| | Detect cycles using DFS.
|
| size_t | Size () const |
| | Get number of nodes.
|
| bool | Empty () const |
| | Check if graph is empty.
|
| std::vector< std::string > | GetDependents (const std::string &component) const |
| | Get dependents of a component (what runs after it).
|
| std::vector< std::string > | GetDependencies (const std::string &component) const |
| | Get dependencies of a component (what runs before it).
|
Dependency graph for component execution ordering.
Builds a directed graph where:
- Nodes = Components
- Edges = Signal dependencies (A -> B means A must run before B)
Supports topological sorting with cycle detection.
◆ AddEdge()
| void icarus::DependencyGraph::AddEdge |
( |
const std::string & | producer, |
|
|
const std::string & | consumer, |
|
|
const std::string & | signal_name = "" ) |
|
inline |
Add a dependency edge: producer must execute before consumer.
- Parameters
-
| producer | Component that produces the signal |
| consumer | Component that consumes the signal |
| signal_name | Signal connecting them (for diagnostics) |
◆ AddNode()
| void icarus::DependencyGraph::AddNode |
( |
const std::string & | component | ) |
|
|
inline |
Add a node without any edges.
Ensures components with no dependencies are included in the graph.
- Parameters
-
◆ DetectCycles()
| std::vector< CycleInfo > icarus::DependencyGraph::DetectCycles |
( |
| ) |
const |
|
inlinenodiscard |
Detect cycles using DFS.
- Returns
- List of cycles found in the graph
◆ Empty()
| bool icarus::DependencyGraph::Empty |
( |
| ) |
const |
|
inlinenodiscard |
◆ GetDependencies()
| std::vector< std::string > icarus::DependencyGraph::GetDependencies |
( |
const std::string & | component | ) |
const |
|
inlinenodiscard |
Get dependencies of a component (what runs before it).
◆ GetDependents()
| std::vector< std::string > icarus::DependencyGraph::GetDependents |
( |
const std::string & | component | ) |
const |
|
inlinenodiscard |
Get dependents of a component (what runs after it).
◆ GetNodes()
| std::vector< std::string > icarus::DependencyGraph::GetNodes |
( |
| ) |
const |
|
inlinenodiscard |
Get all nodes in the graph.
◆ Size()
| size_t icarus::DependencyGraph::Size |
( |
| ) |
const |
|
inlinenodiscard |
◆ TopologicalSort()
Perform topological sort using Kahn's algorithm.
- Returns
- TopologyResult with execution order and cycle info
The documentation for this class was generated from the following file: