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( ); \
54 // -------------------------------------------------------------------------
55 #define cpPlugins_Id_Macro( name, category ) \
57 virtual std::string GetClassName( ) { return( #name ); } \
58 virtual std::string GetClassCategory( ) { return( category ); }
66 class cpPlugins_Interface_EXPORT Object
71 typedef itk::Object Superclass;
72 typedef itk::SmartPointer< Self > Pointer;
73 typedef itk::SmartPointer< const Self > ConstPointer;
77 itkTypeMacro( Object, itkObject );
78 cpPlugins_Id_Macro( cpPlugins::Interface::Object, "BaseObject" );
80 itkGetStringMacro( Name );
81 itkSetStringMacro( Name );
88 // Purposely not implemented
89 Object( const Self& );
90 Self& operator=( const Self& );
99 CPPLUGINS_PROVIDER_HEADER( Object );
105 #endif // __CPPLUGINS__INTERFACE__OBJECT__H__