1 #ifndef __CPPLUGINS__INTERFACE__OBJECT__H__
2 #define __CPPLUGINS__INTERFACE__OBJECT__H__
5 #include <Pluma/Pluma.hpp>
6 #include <cpPlugins/cpPlugins_Export.h>
8 #define ITK_MANUAL_INSTANTIATION
10 #include <itkObjectFactory.h>
12 // -------------------------------------------------------------------------
13 #define CPPLUGINS_PROVIDER_HEADER_BEGIN( TYPE ) \
14 class cpPlugins_EXPORT TYPE##Provider \
15 : public pluma::Provider \
18 friend class pluma::Pluma; \
19 static const unsigned int PLUMA_INTERFACE_VERSION; \
20 static const unsigned int PLUMA_INTERFACE_LOWEST_VERSION; \
21 static const std::string PLUMA_PROVIDER_TYPE; \
22 std::string plumaGetType( ) const \
23 { return( PLUMA_PROVIDER_TYPE ); } \
25 unsigned int getVersion( ) const \
26 { return( PLUMA_INTERFACE_VERSION ); }
28 // -------------------------------------------------------------------------
29 #define CPPLUGINS_PROVIDER_HEADER_END };
31 // -------------------------------------------------------------------------
32 #define CPPLUGINS_PROVIDER_HEADER( TYPE ) \
33 CPPLUGINS_PROVIDER_HEADER_BEGIN( TYPE ) \
34 virtual TYPE::Pointer create( ) const = 0; \
35 CPPLUGINS_PROVIDER_HEADER_END
37 // -------------------------------------------------------------------------
38 #define CPPLUGINS_PROVIDER_SOURCE( TYPE, Version, LowestVersion ) \
39 PLUMA_PROVIDER_SOURCE( TYPE, Version, LowestVersion )
41 // -------------------------------------------------------------------------
42 #define CPPLUGINS_INHERIT_PROVIDER( TYPE ) \
43 class TYPE##Provider \
44 : public cpPlugins::Interface::ObjectProvider \
47 cpPlugins::Interface::Object::Pointer create( ) const \
49 TYPE::Pointer a = TYPE::New( ); \
50 cpPlugins::Interface::Object::Pointer b = a.GetPointer( ); \
61 class cpPlugins_EXPORT Object
66 typedef itk::Object Superclass;
67 typedef itk::SmartPointer< Self > Pointer;
68 typedef itk::SmartPointer< const Self > ConstPointer;
72 itkTypeMacro( Object, itkObject );
75 itkGetConstMacro( ClassName, std::string );
76 itkGetConstMacro( ClassCategory, std::string );
83 // Purposely not implemented
84 Object( const Self& );
85 Self& operator=( const Self& );
88 std::string m_ClassName;
89 std::string m_ClassCategory;
95 CPPLUGINS_PROVIDER_HEADER( Object );
101 #endif // __CPPLUGINS__INTERFACE__OBJECT__H__