48 #include <type_traits>
58 #define DLL_PUBLIC __attribute__((visibility("default")))
63 #define CLOE_PLUGIN_MANIFEST_VERSION 1
75 #ifndef CLOE_PLUGIN_GLIBC_DLOPEN_MODE
76 #define CLOE_PLUGIN_GLIBC_DLOPEN_MODE 0
90 #define BASE_CLOE_FACTORY(xFactoryType) \
91 std::conditional<std::is_base_of<::cloe::ControllerFactory, xFactoryType>::value, \
92 ::cloe::ControllerFactory, \
93 typename std::conditional< \
94 std::is_base_of<::cloe::SimulatorFactory, xFactoryType>::value, \
95 ::cloe::SimulatorFactory, \
96 typename std::conditional< \
97 std::is_base_of<::cloe::ComponentFactory, xFactoryType>::value, \
98 ::cloe::ComponentFactory, std::false_type>::type>::type>::type
124 #define EXPORT_CLOE_PLUGIN(xFactoryType) \
125 extern "C" DLL_PUBLIC const uint8_t cloe_plugin_manifest_version = CLOE_PLUGIN_MANIFEST_VERSION; \
126 extern "C" DLL_PUBLIC const ::cloe::PluginManifest cloe_plugin_manifest{ \
127 BASE_CLOE_FACTORY(xFactoryType)::PLUGIN_TYPE, \
128 BASE_CLOE_FACTORY(xFactoryType)::PLUGIN_API_VERSION, \
129 "cloe_plugin_create", \
130 CLOE_PLUGIN_GLIBC_DLOPEN_MODE, \
132 extern "C" DLL_PUBLIC ::cloe::ModelFactory* cloe_plugin_create() { return new xFactoryType{}; }
137 class ControllerFactory;
138 class SimulatorFactory;
139 class ComponentFactory;
Definition: plugin.hpp:149
const char * factory_symbol
Definition: plugin.hpp:164
int glibc_dlopen_mode
Definition: plugin.hpp:175
const char * plugin_type
Definition: plugin.hpp:153
const char * plugin_type_version
Definition: plugin.hpp:158