cyclegraph: edit template for checkReachable
authorBrian Norris <banorris@uci.edu>
Tue, 5 Feb 2013 00:24:36 +0000 (16:24 -0800)
committerBrian Norris <banorris@uci.edu>
Wed, 6 Feb 2013 21:44:39 +0000 (13:44 -0800)
cyclegraph.cc
cyclegraph.h

index 16990b905bf8a26860bba3e84bd791eddc358ae1..d2a032efde0a2124c6ea5744603d52d27c23c3e1 100644 (file)
@@ -265,24 +265,6 @@ void CycleGraph::dumpGraphToFile(const char *filename) const
 }
 #endif
 
 }
 #endif
 
-/**
- * Checks whether one ModelAction can reach another ModelAction/Promise
- * @param from The ModelAction from which to begin exploration
- * @param to The ModelAction or Promise to reach
- * @return True, @a from can reach @a to; otherwise, false
- */
-template <typename T>
-bool CycleGraph::checkReachable(const ModelAction *from, const T *to) const
-{
-       CycleNode *fromnode = actionToNode.get(from);
-       CycleNode *tonode = actionToNode.get(to);
-
-       if (!fromnode || !tonode)
-               return false;
-
-       return checkReachable(fromnode, tonode);
-}
-
 /**
  * Checks whether one CycleNode can reach another.
  * @param from The CycleNode from which to begin exploration
 /**
  * Checks whether one CycleNode can reach another.
  * @param from The CycleNode from which to begin exploration
index 9fc789c1913edd590f59c497f6cee1ff0b59eff2..83d3db21d77cdfc192f0bd286d21fee188de7fac 100644 (file)
@@ -154,4 +154,22 @@ void CycleGraph::addEdge(const T from, const U to)
        addNodeEdge(fromnode, tonode);
 }
 
        addNodeEdge(fromnode, tonode);
 }
 
+/**
+ * Checks whether one ModelAction can reach another ModelAction/Promise
+ * @param from The ModelAction from which to begin exploration
+ * @param to The ModelAction or Promise to reach
+ * @return True, @a from can reach @a to; otherwise, false
+ */
+template <typename T>
+bool CycleGraph::checkReachable(const ModelAction *from, const T *to) const
+{
+       CycleNode *fromnode = getNode_noCreate(from);
+       CycleNode *tonode = getNode_noCreate(to);
+
+       if (!fromnode || !tonode)
+               return false;
+
+       return checkReachable(fromnode, tonode);
+}
+
 #endif /* __CYCLEGRAPH_H__ */
 #endif /* __CYCLEGRAPH_H__ */