Skip to content
Snippets Groups Projects
Commit 68e0d0a1 authored by Francois Keith's avatar Francois Keith
Browse files

Win32: force the creation of a library for the class derivator

To this purpose, add a specification for the class derivator.
For unix systems, this only comes down to creating a typename.
For win32 systems, the idea is to create a class that will
 inherit the specification and be exported.
parent 8da4668d
No related branches found
No related tags found
No related merge requests found
/*
* Copyright 2010,
* François Bleibel,
* Olivier Stasse,
*
* CNRS/AIST
*
* This file is part of sot-core.
* sot-core is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation, either version 3 of
* the License, or (at your option) any later version.
* sot-core is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details. You should
* have received a copy of the GNU Lesser General Public License along
* with sot-core. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __SOT_DERIVATOR_IMPL_H__
#define __SOT_DERIVATOR_IMPL_H__
#include <sot/core/derivator.hh>
#include <sot/core/vector-quaternion.hh>
/* --------------------------------------------------------------------- */
/* --- API ------------------------------------------------------------- */
/* --------------------------------------------------------------------- */
#if defined (WIN32)
# if defined (derivator_EXPORTS)
# define DERIVATOR_EXPORT __declspec(dllexport)
# else
# define DERIVATOR_EXPORT __declspec(dllimport)
# endif
#else
# define DERIVATOR_EXPORT
#endif
/* --------------------------------------------------------------------- */
/* --- INCLUDE --------------------------------------------------------- */
/* --------------------------------------------------------------------- */
namespace dynamicgraph { namespace sot {
namespace dg = dynamicgraph;
#ifdef WIN32
# define DECLARE_SPECIFICATION(className, sotSigType ) \
class DERIVATOR_EXPORT className : public Derivator<sotSigType> \
{ \
public: \
className( const std::string& name ); \
};
#else
# define DECLARE_SPECIFICATION(, sotSigType) \
typedef Derivator<sotSigType,sotCoefType> className;
#endif
DECLARE_SPECIFICATION(DerivatorDouble,double)
DECLARE_SPECIFICATION(DerivatorVector,ml::Vector)
DECLARE_SPECIFICATION(DerivatorMatrix,ml::Matrix)
DECLARE_SPECIFICATION(DerivatorVectorQuaternion,VectorQuaternion)
} /* namespace sot */} /* namespace dynamicgraph */
#endif // #ifndef __SOT_DERIVATOR_H__
......@@ -74,3 +74,16 @@ namespace dynamicgraph {
} // namespace sot
} // namespace dynamicgraph
#include <sot/core/derivator-impl.hh>
#ifdef WIN32
# define SOT_FACTORY_TEMPLATE_ENTITY_PLUGIN_WIN32(sotClassType,sotType,className) \
sotClassType##sotType##::sotClassType##sotType##(const std::string& name): \
sotClassType<sotType> (name) {}; \
typedef double Double;
SOT_FACTORY_TEMPLATE_ENTITY_PLUGIN_WIN32(Derivator,Double,"Derivator")
SOT_FACTORY_TEMPLATE_ENTITY_PLUGIN_WIN32(Derivator,Vector,"Derivator")
SOT_FACTORY_TEMPLATE_ENTITY_PLUGIN_WIN32(Derivator,Matrix,"Derivator")
SOT_FACTORY_TEMPLATE_ENTITY_PLUGIN_WIN32(Derivator,VectorQuaternion,"Derivator")
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment