From 096afcb50341ae3e0b8fccb4ee06881086bc0953 Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Mon, 4 Feb 2013 16:24:21 -0800 Subject: [PATCH] cyclegraph: edit template for addEdge --- cyclegraph.cc | 24 ------------------------ cyclegraph.h | 24 ++++++++++++++++++++++++ 2 files changed, 24 insertions(+), 24 deletions(-) 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__ */ -- 2.34.1