1 #ifndef __CPPLUGINS__INTERFACE__OBJECT__H__
2 #define __CPPLUGINS__INTERFACE__OBJECT__H__
5 #include <Pluma/Pluma.hpp>
7 #include <itkObjectFactory.h>
8 #include <cpPlugins/Interface/cpPlugins_Interface_Export.h>
10 // -------------------------------------------------------------------------
11 #define CPPLUGINS_PROVIDER_HEADER_BEGIN( TYPE ) \
12 class cpPlugins_Interface_EXPORT TYPE##Provider \
13 : public pluma::Provider \
16 friend class pluma::Pluma; \
17 static const unsigned int PLUMA_INTERFACE_VERSION; \
18 static const unsigned int PLUMA_INTERFACE_LOWEST_VERSION; \
19 static const std::string PLUMA_PROVIDER_TYPE; \
20 std::string plumaGetType( ) const \
21 { return( PLUMA_PROVIDER_TYPE ); } \
23 unsigned int getVersion( ) const \
24 { return( PLUMA_INTERFACE_VERSION ); }
26 // -------------------------------------------------------------------------
27 #define CPPLUGINS_PROVIDER_HEADER_END };
29 // -------------------------------------------------------------------------
30 #define CPPLUGINS_PROVIDER_HEADER( TYPE ) \
31 CPPLUGINS_PROVIDER_HEADER_BEGIN( TYPE ) \
32 virtual TYPE::Pointer create( ) const = 0; \
33 CPPLUGINS_PROVIDER_HEADER_END
35 // -------------------------------------------------------------------------
36 #define CPPLUGINS_PROVIDER_SOURCE( TYPE, Version, LowestVersion ) \
37 PLUMA_PROVIDER_SOURCE( TYPE, Version, LowestVersion )
39 // -------------------------------------------------------------------------
40 #define CPPLUGINS_INHERIT_PROVIDER( TYPE ) \
41 class TYPE##Provider \
42 : public cpPlugins::Interface::ObjectProvider \
45 cpPlugins::Interface::Object::Pointer create( ) const \
47 TYPE::Pointer a = TYPE::New( ); \
48 cpPlugins::Interface::Object::Pointer b = a.GetPointer( ); \
59 class cpPlugins_Interface_EXPORT Object
64 typedef itk::Object Superclass;
65 typedef itk::SmartPointer< Self > Pointer;
66 typedef itk::SmartPointer< const Self > ConstPointer;
70 itkTypeMacro( Object, itkObject );
73 virtual std::string GetClassName( ) const;
74 virtual std::string GetClassType( ) const;
81 // Purposely not implemented
82 Object( const Self& );
83 Self& operator=( const Self& );
89 CPPLUGINS_PROVIDER_HEADER( Object );
95 #endif // __CPPLUGINS__INTERFACE__OBJECT__H__