aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/rfnoc/graph.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'host/lib/rfnoc/graph.cpp')
-rw-r--r--host/lib/rfnoc/graph.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/host/lib/rfnoc/graph.cpp b/host/lib/rfnoc/graph.cpp
index cbb7ab140..174d72389 100644
--- a/host/lib/rfnoc/graph.cpp
+++ b/host/lib/rfnoc/graph.cpp
@@ -189,6 +189,20 @@ void graph_t::release()
_release_count++;
}
+std::vector<graph_t::graph_edge_t> graph_t::enumerate_edges()
+{
+ auto e_iterators = boost::edges(_graph);
+ std::vector<graph_edge_t> result;
+ for (auto e_it = e_iterators.first; e_it != e_iterators.second; ++e_it) {
+ graph_edge_t edge_info = boost::get(edge_property_t(), _graph, *e_it);
+ // This is probably the dumbest way to make sure that the in- and out-
+ // edges don't both get stashed, but it works for now
+ if (std::find(result.begin(), result.end(), edge_info) == result.end()) {
+ result.push_back(boost::get(edge_property_t(), _graph, *e_it));
+ }
+ }
+ return result;
+}
/******************************************************************************
* Private methods to be called by friends