]> Creatis software - cpPlugins.git/blob - lib/cpPlugins/Pipeline/Functor.h
96255b7f2b18c2e78777cc056931b0b34059484e
[cpPlugins.git] / lib / cpPlugins / Pipeline / Functor.h
1 #ifndef __cpPlugins__Pipeline__Functor__h__
2 #define __cpPlugins__Pipeline__Functor__h__
3
4 #include <cpPlugins/Pipeline/ProcessObject.h>
5
6 // -------------------------------------------------------------------------
7 namespace cpPlugins
8 {
9   namespace Pipeline
10   {
11     /**
12      */
13     class cpPlugins_EXPORT Functor
14       : public ProcessObject
15     {
16     public:
17       typedef Functor                         Self;
18       typedef ProcessObject                   Superclass;
19       typedef itk::SmartPointer< Self >       Pointer;
20       typedef itk::SmartPointer< const Self > ConstPointer;
21
22     public:
23       itkTypeMacro( Functor, ProcessObject );
24       cpPlugins_Id_Macro( Functor, Object );
25
26     public:
27       virtual void Instantiate( itk::LightObject* filter ) = 0;
28
29       template< class _TFunctor >
30       _TFunctor* GetFunctor( )
31         {
32           return(
33             dynamic_cast< _TFunctor* >( this->m_Functor.GetPointer( ) )
34             );
35         }
36
37       template< class _TFunctor >
38       const _TFunctor* GetFunctor( ) const
39         {
40           return(
41             dynamic_cast< const _TFunctor* >( this->m_Functor.GetPointer( ) )
42             );
43         }
44
45     protected:
46       Functor( );
47       virtual ~Functor( );
48
49     private:
50       // Purposely not implemented
51       Functor( const Self& );
52       Self& operator=( const Self& );
53
54     protected:
55       itk::LightObject::Pointer m_Functor;
56     };
57
58   } // ecapseman
59
60 } // ecapseman
61
62 #endif // __cpPlugins__Pipeline__Functor__h__
63
64 // eof - $RCSfile$