Generated on Wed Apr 29 2015 11:51:40 for GGL-4.1.2 by doxygen 1.8.3.1
MR_ApplyRule.hh
Go to the documentation of this file.
1 #ifndef GGL_MR_APPLYRULE_HH_
2 #define GGL_MR_APPLYRULE_HH_
3 
4 #include "sgm/Match_Reporter.hh"
5 #include "ggl/Graph_Storage.hh"
6 
7 #include "ggl/Graph.hh"
8 #include "ggl/RuleGraph.hh"
9 
10 
11 
12 #include <climits>
13 
14 namespace ggl {
15 
16 
17  /*! @brief Graph Grammar Rule application for each reported match
18  *
19  * A sgm::Match_Reporter implementation that applies a graph grammar ggl::Rule
20  * to a graph and generates the resulting graph. The new graph is added
21  * to a specified container for further handling like storage or output.
22  * The pattern graph has to be an instance of ggl::LeftSidePattern.
23  *
24  * @author Martin Mann (c) 2008 http://www.bioinf.uni-freiburg.de/~mmann/
25  *
26  */
28 
29  protected:
30 
31  //! the storage to that "reportHit(..)" adds the resulting graphs
32  //! after the application of a rule to a matched target graph.
34 
35  //! we apply undirected rules or not
36  const bool undirectedRule;
37 
38 
39  /*! if set to true, than all components of the Rules LeftSidePattern
40  * are matched to an own target graph copy if two components map to
41  * the same target graph.
42  */
43  const bool addEachComponent;
44 
45  public:
46 
47  /*! Construction of a MR_ApplyRule object that adds the resulting
48  * graphs to the given Graph_Storage object.
49  * @param storage the Graph_Storage object to add the results to
50  * @param addEachComponent if set to true, than all components of the
51  * Rules LeftSidePattern are matched to an own target graph
52  * copy if two components map to the same target graph.
53  * NOTE: only important for rules with multi-component
54  * LeftSidePattern!
55  */
57  , const bool addEachComponent = false );
58 
59  virtual
60  ~MR_ApplyRule();
61 
62 
63  //! Applies the Rule represented by the pattern onto the matched
64  //! subgraph of target and adds the resulting graph to the internal
65  //! Graph_Storage object.
66  //! NOTE: It is assumed that pattern is an instance of
67  //! ggl::LeftSidePattern!
68  //! @param pattern the pattern graph that was searched for
69  //! @param target the graph the pattern was found within
70  //! @param match contains the indices of the matched pattern nodes in
71  //! the target graph. match[i] corresponds to the mapping of the i-th
72  //! vertex in the pattern graph.
73  virtual
74  void
75  reportHit ( const sgm::Pattern_Interface & pattern,
76  const sgm::Graph_Interface & target,
77  const sgm::Match & match );
78 
79  };
80 
81 
82 ////////////////////////////////////////////////////////////////////////////////
83 
84 } // namespace ggl
85 
86 #include "ggl/MR_ApplyRule.icc"
87 
88 #endif /*MR_APPLYRULE_HH_*/