21 [[nodiscard]] std::string
39 [[nodiscard]] std::string
56 std::vector<CommandGraph::Node *>
59 std::vector<CommandGraph::Node *> nodes({ &commandGraph.
GetEntryNode() });
60 std::deque<CommandGraph::Node *> to_visit({ &commandGraph.
GetEntryNode() });
61 std::unordered_set<CommandGraph::Node *> visited({ &commandGraph.
GetEntryNode() });
63 while (!to_visit.empty())
65 auto node = to_visit.front();
68 for (
auto & edge : node->OutgoingEdges())
70 if (visited.find(&edge.GetSink()) == visited.end())
72 to_visit.push_back(&edge.GetSink());
73 visited.insert(&edge.GetSink());
74 nodes.push_back(&edge.GetSink());
86 node->GetCommand().Run();
92 : CommandGraph_(commandGraph),
93 Command_(std::move(command))
113 std::unique_ptr<Node> node(
new Node(commandGraph, std::move(command)));
114 return commandGraph.
AddNode(std::move(node));
std::string ToString() const override
void Run() const override