1 #ifndef __CPPLUGINS__INTERFACE__OBJECT__H__
2 #define __CPPLUGINS__INTERFACE__OBJECT__H__
5 #include <Pluma/Pluma.hpp>
6 #include <cpPlugins/Interface/cpPlugins_Interface_Export.h>
9 #include <itkObjectFactory.h>
11 // -------------------------------------------------------------------------
12 #define CPPLUGINS_PROVIDER_HEADER_BEGIN( TYPE ) \
13 class cpPlugins_Interface_EXPORT TYPE##Provider \
14 : public pluma::Provider \
17 friend class pluma::Pluma; \
18 static const unsigned int PLUMA_INTERFACE_VERSION; \
19 static const unsigned int PLUMA_INTERFACE_LOWEST_VERSION; \
20 static const std::string PLUMA_PROVIDER_TYPE; \
21 std::string plumaGetType( ) const \
22 { return( PLUMA_PROVIDER_TYPE ); } \
24 unsigned int getVersion( ) const \
25 { return( PLUMA_INTERFACE_VERSION ); }
27 // -------------------------------------------------------------------------
28 #define CPPLUGINS_PROVIDER_HEADER_END };
30 // -------------------------------------------------------------------------
31 #define CPPLUGINS_PROVIDER_HEADER( TYPE ) \
32 CPPLUGINS_PROVIDER_HEADER_BEGIN( TYPE ) \
33 virtual TYPE::Pointer create( ) const = 0; \
34 CPPLUGINS_PROVIDER_HEADER_END
36 // -------------------------------------------------------------------------
37 #define CPPLUGINS_PROVIDER_SOURCE( TYPE, Version, LowestVersion ) \
38 PLUMA_PROVIDER_SOURCE( TYPE, Version, LowestVersion )
40 // -------------------------------------------------------------------------
41 #define CPPLUGINS_INHERIT_PROVIDER( TYPE ) \
42 class TYPE##Provider \
43 : public cpPlugins::Interface::ObjectProvider \
46 cpPlugins::Interface::Object::Pointer create( ) const \
48 TYPE::Pointer a = TYPE::New( ); \
49 cpPlugins::Interface::Object::Pointer b = a.GetPointer( ); \
60 class cpPlugins_Interface_EXPORT Object
65 typedef itk::Object Superclass;
66 typedef itk::SmartPointer< Self > Pointer;
67 typedef itk::SmartPointer< const Self > ConstPointer;
71 itkTypeMacro( Object, itkObject );
74 itkGetConstMacro( ClassName, std::string );
75 itkGetConstMacro( ClassCategory, std::string );
82 // Purposely not implemented
83 Object( const Self& );
84 Self& operator=( const Self& );
87 std::string m_ClassName;
88 std::string m_ClassCategory;
94 CPPLUGINS_PROVIDER_HEADER( Object );
100 #endif // __CPPLUGINS__INTERFACE__OBJECT__H__