From 56456371fa1cb0ae13f3e2d4f71d6ae243cad1ec Mon Sep 17 00:00:00 2001
From: Joseph Mirabel <jmirabel@laas.fr>
Date: Fri, 25 Jul 2014 10:45:52 +0200
Subject: [PATCH] Change static to extern in insertListIn<T>,
 buildConfigProjector and buildConstraintSet

---
 include/hpp/manipulation/graph/node.hh | 27 ++++----------------------
 src/graph/node.cc                      | 23 ++++++++++++++++++++++
 2 files changed, 27 insertions(+), 23 deletions(-)

diff --git a/include/hpp/manipulation/graph/node.hh b/include/hpp/manipulation/graph/node.hh
index 7e21f24..feb3ade 100644
--- a/include/hpp/manipulation/graph/node.hh
+++ b/include/hpp/manipulation/graph/node.hh
@@ -98,40 +98,21 @@ namespace hpp {
       }; // class Node
 
       template <typename T>
-        static inline void insertListIn (const T& l, ConstraintSetPtr_t cs)
+        extern inline void insertListIn (const T& l, ConstraintSetPtr_t cs)
       {
         typename T::const_iterator it;
         for (it = l.begin(); it != l.end(); it++)
           cs->addConstraint (HPP_DYNAMIC_PTR_CAST(Constraint, *it));
       }
       template <typename T>
-        static inline void insertListIn (const T& l, ConfigProjectorPtr_t cs)
+        extern inline void insertListIn (const T& l, ConfigProjectorPtr_t cs)
       {
         typename T::const_iterator it;
         for (it = l.begin(); it != l.end(); it++)
           cs->addConstraint (*it);
       }
-      static ConfigProjectorPtr_t buildConfigProjector (GraphWkPtr_t graph, const std::string& name)
-      {
-        GraphPtr_t g = graph.lock ();
-        if (!g) {
-          HPP_THROW_EXCEPTION(Bad_function_call, "Invalid weak_ptr to the Graph.");
-        }
-
-        ConfigProjectorPtr_t ret = ConfigProjector::
-          create(g->robot(), name, g->errorThreshold(), g->maxIterations());
-        return ret;
-      }
-      static ConstraintSetPtr_t buildConstraintSet (GraphWkPtr_t graph, const std::string& name)
-      {
-        GraphPtr_t g = graph.lock ();
-        if (!g) {
-          HPP_THROW_EXCEPTION(Bad_function_call, "Invalid weak_ptr to the Graph.");
-        }
-
-        ConstraintSetPtr_t ret = ConstraintSet::create(g->robot(), name);
-        return ret;
-      }
+      extern ConfigProjectorPtr_t buildConfigProjector (GraphWkPtr_t graph, const std::string& name);
+      extern ConstraintSetPtr_t buildConstraintSet (GraphWkPtr_t graph, const std::string& name);
     } // namespace graph
   } // namespace manipulation
 } // namespace hpp
diff --git a/src/graph/node.cc b/src/graph/node.cc
index 70a205d..f51b478 100644
--- a/src/graph/node.cc
+++ b/src/graph/node.cc
@@ -19,6 +19,29 @@
 namespace hpp {
   namespace manipulation {
     namespace graph {
+      ConfigProjectorPtr_t buildConfigProjector (GraphWkPtr_t graph, const std::string& name)
+      {
+        GraphPtr_t g = graph.lock ();
+        if (!g) {
+          HPP_THROW_EXCEPTION(Bad_function_call, "Invalid weak_ptr to the Graph.");
+        }
+
+        ConfigProjectorPtr_t ret = ConfigProjector::
+          create(g->robot(), name, g->errorThreshold(), g->maxIterations());
+        return ret;
+      }
+
+      ConstraintSetPtr_t buildConstraintSet (GraphWkPtr_t graph, const std::string& name)
+      {
+        GraphPtr_t g = graph.lock ();
+        if (!g) {
+          HPP_THROW_EXCEPTION(Bad_function_call, "Invalid weak_ptr to the Graph.");
+        }
+
+        ConstraintSetPtr_t ret = ConstraintSet::create(g->robot(), name);
+        return ret;
+      }
+
       NodePtr_t Node::create ()
       {
         Node* node = new Node;
-- 
GitLab