SubgraphOrderingGraphDFSVisitor.h 901 B

123456789101112131415161718192021222324252627
  1. #ifndef SUBGRAPHORDERINGGRAPHDFSVISITOR_H
  2. #define SUBGRAPHORDERINGGRAPHDFSVISITOR_H
  3. #include <HierarchicalLayoutGenerator/SubgraphOrderingGraphType.h>
  4. #include <boost/graph/depth_first_search.hpp>
  5. /*! Custom DFS Visitor for back edges recording for cycle detection */
  6. class SubgraphOrderingGraphBackEdgeRecorder : public default_dfs_visitor
  7. {
  8. public:
  9. SubgraphOrderingGraphBackEdgeRecorder(VectorSubgraphOrderingGraphEdgeDescriptor& vecBackEdge)
  10. : vecRecordBackEdge(&vecBackEdge)
  11. {}
  12. void back_edge(SubgraphOrderingGraphEdgeDescriptor eBackEdge , SubgraphOrderingGraphType gGraph)
  13. {
  14. Q_UNUSED(gGraph);
  15. vecRecordBackEdge->push_back(eBackEdge);
  16. }
  17. private:
  18. VectorSubgraphOrderingGraphEdgeDescriptor *vecRecordBackEdge; /*!< vector of back edges recording for cycle detection */
  19. };
  20. #endif // SUBGRAPHORDERINGGRAPHDFSVISITOR_H