From: Brian Norris Date: Tue, 5 Feb 2013 00:24:21 +0000 (-0800) Subject: cyclegraph: edit template for addEdge X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=096afcb50341ae3e0b8fccb4ee06881086bc0953;p=cdsspec-compiler.git cyclegraph: edit template for addEdge --- diff --git a/cyclegraph.cc b/cyclegraph.cc index 2c3a593..16990b9 100644 --- a/cyclegraph.cc +++ b/cyclegraph.cc @@ -81,30 +81,6 @@ CycleNode * CycleGraph::getNode(const Promise *promise) return node; } -/* - * @brief Adds an edge between objects - * - * This function will add an edge between any two objects which can be - * associated with a CycleNode. That is, if they have a CycleGraph::getNode - * implementation. - * - * The object to is ordered after the object from. - * - * @param to The edge points to this object, of type T - * @param from The edge comes from this object, of type U - */ -template -void CycleGraph::addEdge(const T from, const U to) -{ - ASSERT(from); - ASSERT(to); - - CycleNode *fromnode = getNode(from); - CycleNode *tonode = getNode(to); - - addNodeEdge(fromnode, tonode); -} - /** * @return false if the resolution results in a cycle; true otherwise */ diff --git a/cyclegraph.h b/cyclegraph.h index f03c4ec..9fc789c 100644 --- a/cyclegraph.h +++ b/cyclegraph.h @@ -130,4 +130,28 @@ class CycleNode { CycleNode *hasRMW; }; +/* + * @brief Adds an edge between objects + * + * This function will add an edge between any two objects which can be + * associated with a CycleNode. That is, if they have a CycleGraph::getNode + * implementation. + * + * The object to is ordered after the object from. + * + * @param to The edge points to this object, of type T + * @param from The edge comes from this object, of type U + */ +template +void CycleGraph::addEdge(const T from, const U to) +{ + ASSERT(from); + ASSERT(to); + + CycleNode *fromnode = getNode(from); + CycleNode *tonode = getNode(to); + + addNodeEdge(fromnode, tonode); +} + #endif /* __CYCLEGRAPH_H__ */