Skip to content
Snippets Groups Projects
Commit 0e4b1846 authored by Enrico Guiraud's avatar Enrico Guiraud
Browse files

[DF] Also loop over all graph edges for SaveGraph(rootnode)

This fixes ROOT-9977, "[DF] SaveGraph produces an empty graph"
parent 5f2fdcf2
Branches
Tags
No related merge requests found
...@@ -179,7 +179,11 @@ public: ...@@ -179,7 +179,11 @@ public:
/// For each booked filter, returns either the name or "Unnamed Filter" /// For each booked filter, returns either the name or "Unnamed Filter"
std::vector<std::string> GetFiltersNames(); std::vector<std::string> GetFiltersNames();
/// For all the actions, either booked or run /// Return all graph edges known to RLoopManager
/// This includes Filters and Ranges but not Defines.
std::vector<RNodeBase *> GetGraphEdges() const;
/// Return all actions, either booked or already run
std::vector<RDFInternal::RActionBase *> GetAllActions(); std::vector<RDFInternal::RActionBase *> GetAllActions();
std::vector<RDFInternal::RActionBase *> GetBookedActions() { return fBookedActions; } std::vector<RDFInternal::RActionBase *> GetBookedActions() { return fBookedActions; }
......
...@@ -61,13 +61,20 @@ std::string GraphCreatorHelper::RepresentGraph(RLoopManager *loopManager) ...@@ -61,13 +61,20 @@ std::string GraphCreatorHelper::RepresentGraph(RLoopManager *loopManager)
{ {
auto actions = loopManager->GetAllActions(); auto actions = loopManager->GetAllActions();
std::vector<std::shared_ptr<GraphNode>> leaves; std::vector<std::shared_ptr<GraphNode>> nodes;
for (auto action : actions) { for (auto action : actions) {
// Triggers the graph construction. When action->GetGraph() will return, the node will be linked to all the branch // Triggers the graph construction. When action->GetGraph() will return, the node will be linked to all the branch
leaves.push_back(action->GetGraph()); nodes.emplace_back(action->GetGraph());
}
auto edges = loopManager->GetGraphEdges();
std::vector<std::shared_ptr<GraphNode>> leaves;
for (auto edge : edges) {
// Triggers the graph construction. When action->GetGraph() will return, the node will be linked to all the branch
nodes.emplace_back(edge->GetGraph());
} }
return FromGraphActionsToDot(leaves); return FromGraphActionsToDot(nodes);
} }
std::shared_ptr<GraphNode> std::shared_ptr<GraphNode>
......
...@@ -688,6 +688,14 @@ std::vector<std::string> RLoopManager::GetFiltersNames() ...@@ -688,6 +688,14 @@ std::vector<std::string> RLoopManager::GetFiltersNames()
return filters; return filters;
} }
std::vector<RNodeBase *> RLoopManager::GetGraphEdges() const
{
std::vector<RNodeBase *> nodes;
nodes.insert(nodes.end(), fBookedFilters.begin(), fBookedFilters.end());
nodes.insert(nodes.end(), fBookedRanges.begin(), fBookedRanges.end());
return nodes;
}
std::vector<RDFInternal::RActionBase *> RLoopManager::GetAllActions() std::vector<RDFInternal::RActionBase *> RLoopManager::GetAllActions()
{ {
std::vector<RDFInternal::RActionBase *> actions; std::vector<RDFInternal::RActionBase *> actions;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment