]> Creatis software - cpPlugins.git/blob - lib/cpPlugins/Interface/Object.h
33cfdd7079cd61ab1e361369a3af305c271d3872
[cpPlugins.git] / lib / cpPlugins / Interface / Object.h
1 #ifndef __CPPLUGINS__INTERFACE__OBJECT__H__
2 #define __CPPLUGINS__INTERFACE__OBJECT__H__
3
4 #include <string>
5 #include <Pluma/Pluma.hpp>
6 #include <itkObject.h>
7 #include <itkObjectFactory.h>
8 #include <cpPlugins/Interface/cpPlugins_Interface_Export.h>
9
10 // -------------------------------------------------------------------------
11 #define PLUMA_PROVIDER_HEADER_CPPLUGINS( TYPE )         \
12   PLUMA_PROVIDER_HEADER_BEGIN( TYPE )                   \
13   virtual TYPE::Pointer create( ) const = 0;            \
14   PLUMA_PROVIDER_HEADER_END
15
16 // -------------------------------------------------------------------------
17 #define PLUMA_INHERIT_PROVIDER_CPPLUGINS( TYPE, SUPER ) \
18   class TYPE##Provider                                  \
19     : public SUPER##Provider                            \
20   {                                                     \
21   public:                                               \
22     SUPER::Pointer create( ) const                      \
23     {                                                   \
24       TYPE::Pointer a = TYPE::New( );                   \
25       SUPER::Pointer b = a.GetPointer( );               \
26       return( b );                                      \
27     }                                                   \
28   };
29
30 namespace cpPlugins
31 {
32   namespace Interface
33   {
34     /**
35      */
36     class cpPlugins_Interface_EXPORT Object
37       : public itk::Object
38     {
39     public:
40       typedef Object                          Self;
41       typedef itk::Object                     Superclass;
42       typedef itk::SmartPointer< Self >       Pointer;
43       typedef itk::SmartPointer< const Self > ConstPointer;
44
45     public:
46       itkNewMacro( Self );
47       itkTypeMacro( Object, itkObject );
48
49     public:
50       virtual std::string GetClassName( ) const;
51       virtual std::string GetClassType( ) const;
52
53     protected:
54       Object( );
55       virtual ~Object( );
56
57     private:
58       // Purposely not implemented
59       Object( const Self& );
60       Self& operator=( const Self& );
61     };
62
63     // TODO: doc
64     PLUMA_PROVIDER_HEADER_CPPLUGINS( Object );
65
66   } // ecapseman
67
68 } // ecapseman
69
70 #endif // __CPPLUGINS__INTERFACE__OBJECT__H__
71
72 // eof - $RCSfile$