diff --git a/include/sot/core/derivator-impl.hh b/include/sot/core/derivator-impl.hh new file mode 100644 index 0000000000000000000000000000000000000000..a235a7e9d33b2a3db9281c680d9ed47f2cf44e11 --- /dev/null +++ b/include/sot/core/derivator-impl.hh @@ -0,0 +1,68 @@ +/* + * 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__ diff --git a/src/matrix/derivator.cpp b/src/matrix/derivator.cpp index b95a909c764cd79c075cdaa854f8dc6aa902004e..7fd7d54572470828372bcc4c3016df0099f19ed8 100644 --- a/src/matrix/derivator.cpp +++ b/src/matrix/derivator.cpp @@ -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