Skip to content

Commit 16b4708

Browse files
committed
expose the grouped dependency graph from the environment
1 parent 97f9eb1 commit 16b4708

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

include/reactor-cpp/dependency_graph.hh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,11 @@ private:
112112

113113
void clear_all_empty_vertices();
114114

115-
GroupedDependencyGraph() = default;
116-
117115
public:
118116
// TODO: This should be a const reference, but I don't know how to get immutable access to the reaction graph
119117
// properties...
120118
GroupedDependencyGraph(ReactionDependencyGraph& reactionGraph);
119+
GroupedDependencyGraph() = default;
121120

122121
void export_graphviz(const std::string& file_name);
123122

include/reactor-cpp/environment.hh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <string>
1414
#include <vector>
1515

16+
#include "reactor-cpp/dependency_graph.hh"
1617
#include "reactor.hh"
1718
#include "scheduler.hh"
1819

@@ -42,6 +43,8 @@ private:
4243
Phase phase_{Phase::Construction};
4344
TimePoint start_time_{};
4445

46+
GroupedDependencyGraph grouped_graph_{};
47+
4548
void build_dependency_graph(Reactor* reactor);
4649
void calculate_indexes();
4750

@@ -83,6 +86,8 @@ public:
8386
[[nodiscard]] auto fast_fwd_execution() const noexcept -> bool { return fast_fwd_execution_; }
8487
[[nodiscard]] auto run_forever() const noexcept -> bool { return run_forever_; }
8588
[[nodiscard]] auto max_reaction_index() const noexcept -> unsigned int { return max_reaction_index_; }
89+
90+
[[nodiscard]] auto grouped_graph() const noexcept -> const GroupedDependencyGraph& { return grouped_graph_; }
8691
};
8792
} // namespace reactor
8893

lib/environment.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ void Environment::assemble() {
6464

6565
reduced_grouped_graph.group_chains();
6666
reduced_grouped_graph.export_graphviz("grouped_chains_graph.dot");
67+
68+
this->grouped_graph_ = reduced_grouped_graph;
6769
}
6870

6971
void Environment::build_dependency_graph(Reactor* reactor) { // NOLINT

0 commit comments

Comments
 (0)