]> Creatis software - cpPlugins.git/blob - lib/cpPlugins/Interface/ProcessObjectProvider.h
...
[cpPlugins.git] / lib / cpPlugins / Interface / ProcessObjectProvider.h
1 #ifndef __CPPLUGINS__INTERFACE__PROCESSOBJECTPROVIDER__H__
2 #define __CPPLUGINS__INTERFACE__PROCESSOBJECTPROVIDER__H__
3
4 #include <Pluma/Pluma.hpp>
5 #include <cpPlugins/Interface/cpPlugins_Interface_Export.h>
6 #include <cpPlugins/Interface/Config.h>
7 #include <cpPlugins/Interface/ProcessObject.h>
8
9 // -------------------------------------------------------------------------
10 #define CPPLUGINS_INHERIT_PROVIDER( T )                                 \
11   class T##Provider                                                     \
12     : public cpPlugins::Interface::ProcessObjectProvider                \
13   {                                                                     \
14   public:                                                               \
15     cpPlugins::Interface::ProcessObject::Pointer create( ) const        \
16     {                                                                   \
17       T::Pointer a = T::New( );                                      \
18       cpPlugins::Interface::ProcessObject::Pointer b = a.GetPointer( ); \
19       return( b );                                                      \
20     }                                                                   \
21   };
22
23 // -------------------------------------------------------------------------
24 namespace cpPlugins
25 {
26   namespace Interface
27   {
28     /**
29      */
30     class cpPlugins_Interface_EXPORT ProcessObjectProvider
31       : public pluma::Provider
32     {
33       friend class pluma::Pluma;
34
35     private:
36       static const unsigned int PLUMA_INTERFACE_VERSION;
37       static const unsigned int PLUMA_INTERFACE_LOWEST_VERSION;
38       static const std::string  PLUMA_PROVIDER_TYPE;
39       std::string plumaGetType( ) const
40       { return( PLUMA_PROVIDER_TYPE ); }
41
42     public:
43       unsigned int getVersion( ) const
44       { return( PLUMA_INTERFACE_VERSION ); }
45
46       virtual ProcessObject::Pointer create( ) const = 0;
47     };
48
49   } // ecapseman
50
51 } // ecapseman
52
53 #endif // __CPPLUGINS__INTERFACE__PROCESSOBJECTPROVIDER__H__
54
55 // eof - $RCSfile$