From 4bf3ca566d60123f277a10d074750e20b9a01d55 Mon Sep 17 00:00:00 2001 From: Pierre Gergondet <pierre.gergondet@gmail.com> Date: Wed, 23 Jul 2014 01:31:30 +0900 Subject: [PATCH] Fix some issues with the export - No need to export template functions - Expose some template instantiations --- include/dynamic-graph/command-getter.h | 2 +- include/dynamic-graph/command-setter.h | 2 +- include/dynamic-graph/signal-cast-helper.h | 3 +-- include/dynamic-graph/value.h | 9 +++++++++ src/command/value.cpp | 10 ---------- 5 files changed, 12 insertions(+), 14 deletions(-) diff --git a/include/dynamic-graph/command-getter.h b/include/dynamic-graph/command-getter.h index a76de22..9c60a23 100644 --- a/include/dynamic-graph/command-getter.h +++ b/include/dynamic-graph/command-getter.h @@ -53,7 +53,7 @@ namespace dynamicgraph { /// \li prototype of E::getParameter should be exactly as specified in this /// example. template <class E, typename T> - class DYNAMIC_GRAPH_DLLAPI Getter : public Command { + class Getter : public Command { public: /// Pointer to method that sets paramter of type T typedef T (E::*GetterMethod) () const; diff --git a/include/dynamic-graph/command-setter.h b/include/dynamic-graph/command-setter.h index ad198f6..cc88593 100644 --- a/include/dynamic-graph/command-setter.h +++ b/include/dynamic-graph/command-setter.h @@ -53,7 +53,7 @@ namespace dynamicgraph { /// \li prototype of E::setParameter should be exactly as specified in this /// example. template <class E, typename T> - class DYNAMIC_GRAPH_DLLAPI Setter : public Command { + class Setter : public Command { public: /// Pointer to method that sets paramter of type T typedef void (E::*SetterMethod) (const T&); diff --git a/include/dynamic-graph/signal-cast-helper.h b/include/dynamic-graph/signal-cast-helper.h index 62e4ff6..a07738c 100644 --- a/include/dynamic-graph/signal-cast-helper.h +++ b/include/dynamic-graph/signal-cast-helper.h @@ -48,8 +48,7 @@ namespace dynamicgraph : SignalCastRegisterer (typeid(T), disp, cast, trace) {} - DYNAMIC_GRAPH_DLLAPI - static boost::any cast (std::istringstream& iss); + static boost::any cast (std::istringstream& iss); DYNAMIC_GRAPH_DLLAPI static void disp (const boost::any& object, std::ostream& os) diff --git a/include/dynamic-graph/value.h b/include/dynamic-graph/value.h index d31a711..8e9bd1a 100644 --- a/include/dynamic-graph/value.h +++ b/include/dynamic-graph/value.h @@ -115,6 +115,15 @@ namespace dynamicgraph { static const Value::Type TypeID; }; + template<> const Value::Type ValueHelper<bool>::TypeID = Value::BOOL; + template<> const Value::Type ValueHelper<unsigned>::TypeID = Value::UNSIGNED; + template<> const Value::Type ValueHelper<int>::TypeID = Value::INT; + template<> const Value::Type ValueHelper<float>::TypeID = Value::FLOAT; + template<> const Value::Type ValueHelper<double>::TypeID = Value::DOUBLE; + template<> const Value::Type ValueHelper<std::string>::TypeID = Value::STRING; + template<> const Value::Type ValueHelper<Vector>::TypeID = Value::VECTOR; + template<> const Value::Type ValueHelper<Matrix>::TypeID = Value::MATRIX; + } // namespace command } //namespace dynamicgraph diff --git a/src/command/value.cpp b/src/command/value.cpp index 68ff3a3..ee8cd41 100644 --- a/src/command/value.cpp +++ b/src/command/value.cpp @@ -330,15 +330,5 @@ namespace dynamicgraph { return os; } - /* ---- HELPER ---------------------------------------------------------- */ - template<> const Value::Type ValueHelper<bool>::TypeID = Value::BOOL; - template<> const Value::Type ValueHelper<unsigned>::TypeID = Value::UNSIGNED; - template<> const Value::Type ValueHelper<int>::TypeID = Value::INT; - template<> const Value::Type ValueHelper<float>::TypeID = Value::FLOAT; - template<> const Value::Type ValueHelper<double>::TypeID = Value::DOUBLE; - template<> const Value::Type ValueHelper<std::string>::TypeID = Value::STRING; - template<> const Value::Type ValueHelper<Vector>::TypeID = Value::VECTOR; - template<> const Value::Type ValueHelper<Matrix>::TypeID = Value::MATRIX; - } // namespace command } //namespace dynamicgraph -- GitLab