1 #ifndef __CPPLUGINS__INTERFACE__MACROS__H__
2 #define __CPPLUGINS__INTERFACE__MACROS__H__
4 #include <Pluma/Pluma.hpp>
5 #include <cpPlugins/Interface/cpPlugins_Interface_Export.h>
6 #include <cpPlugins/Interface/Config.h>
8 // -------------------------------------------------------------------------
9 #define cpPlugins_Id_Macro( N, C ) \
11 virtual const char* GetClassName( ) const { return( #N ); } \
12 virtual const char* GetClassCategory( ) const { return( #C ); }
14 // -------------------------------------------------------------------------
15 #define CPPLUGINS_PROVIDER_HEADER_BEGIN( TYPE ) \
16 class cpPlugins_Interface_EXPORT TYPE##Provider \
17 : public pluma::Provider \
20 friend class pluma::Pluma; \
21 static const unsigned int PLUMA_INTERFACE_VERSION; \
22 static const unsigned int PLUMA_INTERFACE_LOWEST_VERSION; \
23 static const std::string PLUMA_PROVIDER_TYPE; \
24 std::string plumaGetType( ) const \
25 { return( PLUMA_PROVIDER_TYPE ); } \
27 unsigned int getVersion( ) const \
28 { return( PLUMA_INTERFACE_VERSION ); }
30 // -------------------------------------------------------------------------
31 #define CPPLUGINS_PROVIDER_HEADER_END };
33 // -------------------------------------------------------------------------
34 #define CPPLUGINS_PROVIDER_HEADER( TYPE ) \
35 CPPLUGINS_PROVIDER_HEADER_BEGIN( TYPE ) \
36 virtual TYPE::Pointer create( ) const = 0; \
37 CPPLUGINS_PROVIDER_HEADER_END
39 // -------------------------------------------------------------------------
40 #define CPPLUGINS_PROVIDER_SOURCE( TYPE, Version, LowestVersion ) \
41 PLUMA_PROVIDER_SOURCE( TYPE, Version, LowestVersion )
43 // -------------------------------------------------------------------------
44 #define CPPLUGINS_INHERIT_PROVIDER( TYPE ) \
45 class TYPE##Provider \
46 : public cpPlugins::Interface::ProcessObjectProvider \
49 cpPlugins::Interface::ProcessObject::Pointer create( ) const \
51 TYPE::Pointer a = TYPE::New( ); \
52 cpPlugins::Interface::ProcessObject::Pointer b = a.GetPointer( ); \
58 * Based upon: http://www.itk.org/Wiki/Proposals:Explicit_Instantiation
60 // -------------------------------------------------------------------------
61 #define cpPlugins_TEMPLATE_1( X1 ) \
63 #define cpPlugins_TEMPLATE_2( X1, X2 ) \
65 #define cpPlugins_TEMPLATE_3( X1, X2, X3 ) \
67 #define cpPlugins_TEMPLATE_4( X1, X2, X3, X4 ) \
69 #define cpPlugins_TEMPLATE_5( X1, X2, X3, X4, X5 ) \
71 #define cpPlugins_TEMPLATE_6( X1, X2, X3, X4, X5, X6 ) \
73 #define cpPlugins_TEMPLATE_7( X1, X2, X3, X4, X5, X6, X7 ) \
75 #define cpPlugins_TEMPLATE_8( X1, X2, X3, X4, X5, X6, X7, X8 ) \
76 X1,X2,X3,X4,X5,X6,X7,X8
77 #define cpPlugins_TEMPLATE_9( X1, X2, X3, X4, X5, X6, X7, X8, X9 ) \
78 X1,X2,X3,X4,X5,X6,X7,X8,X9
80 #define cpPlugins_TEMPLATE_EXPORT( X ) \
81 template cpPlugins_TEMPLATE_##X;
82 #define cpPlugins_TEMPLATE_IMPORT( X ) \
83 extern template cpPlugins_TEMPLATE_##X;
85 #endif // __CPPLUGINS__INTERFACE__MACROS__H__