Generated on Wed Apr 29 2015 11:51:40 for GGL-4.1.2 by doxygen 1.8.3.1
RingReporter.hh
Go to the documentation of this file.
1 
2 #ifndef SGM_RINGREPORTER_HH_
3 #define SGM_RINGREPORTER_HH_
4 
5 #include <set>
6 #include <list>
7 
8 #include "sgm/Graph_Interface.hh"
9 
10 namespace sgm {
11 
12  /*! @brief Interface to report found rings
13  *
14  * Abstract class that describes the interface to report rings in graphs.
15  * Thus the interface is used by sgm::RingPerception to report found
16  * rings.
17  *
18  * @author Martin Mann - 2010 - http://www.bioinf.uni-freiburg.de/~mmann/
19  */
20  class RingReporter {
21 
22  public:
23 
24  //! type of a set of node indices that form a ring
25  typedef std::set<size_t> RingNodes;
26  //! type of a list of node indices that form a ring
27  typedef std::list<size_t> RingList;
28 
29  public:
30  //! construction
31  RingReporter();
32  //! destruction
33  virtual ~RingReporter();
34 
35  /*!
36  * Is called to report a ring.
37  * @param graph the graph that contains the ring
38  * @param ringList the ring to report
39  */
40  virtual
41  void
42  reportRing( const Graph_Interface& graph, const RingList & ringList ) = 0;
43 
44  public:
45 
46  /*!
47  * Utility class that converts a RingList, i.e. a list of nodes when
48  * traversing a ring within a graph, into the set of nodes that form
49  * the ring.
50  *
51  * @param graph the graph that contains the ring
52  * @param ringList the ring list to convert
53  * @return the list of nodes traversing the ring
54  */
55  static
56  RingNodes
57  toRing( const Graph_Interface& graph, const RingList& ringList );
58  };
59 
60 } // namespace sgm
61 
62 #endif /* SGM_RINGREPORTER_HH_ */