ADTF
plugin_macros.h
Go to the documentation of this file.
1 
7 #ifndef _PLUGIN_MACROS_HEADER_
8 #define _PLUGIN_MACROS_HEADER_
9 
10 namespace adtf
11 {
12 namespace ucom
13 {
14 
16 #define UCOM_PLUGIN_DEFINE_DEFAULT_METHODS(__plugin_label, __plugin_version_type, ...)\
17 std::function<tResult(adtf::ucom::iobject_ptr<adtf::ucom::IPlugin>&)> _plugin_initialization = [](adtf::ucom::iobject_ptr<adtf::ucom::IPlugin>& pPlugin)\
18 {\
19  return pPlugin.Reset(adtf::ucom::plugin_initializer<adtf::ucom::plugin_template<__plugin_version_type, __VA_ARGS__>>::Get(__plugin_label));\
20 };\
21 std::function<void()> _plugin_deinitialization = []\
22 {\
23 };
24 
26 #ifdef WIN32
27 #define UCOM_PLUGIN_MAIN_METHOD() \
28 int __stdcall DllMain(void* /* hModule */, unsigned long /* ul_reason_for_call */, void* /* lpReserved */) \
29 {\
30  return 1;\
31 }
32 #else
33 #define UCOM_PLUGIN_MAIN_METHOD()
34 #endif
35 
37 #define UCOM_PLUGIN(__plugin_label, __plugin_version_type, ...) \
38  UCOM_PLUGIN_DEFINE_DEFAULT_METHODS(__plugin_label, __plugin_version_type, __VA_ARGS__)\
39  UCOM_PLUGIN_MAIN_METHOD()
40 
41 } // namespace ucom
42 }
43 
44 //*************************************************************************************************
45 #endif // _PLUGIN_MACROS_HEADER_
Namespace for entire ADTF SDK.