X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpPlugins%2FPipeline%2FFunctor.h;h=96255b7f2b18c2e78777cc056931b0b34059484e;hb=c467ae02a4568c1c245d06ecd5b9ebfd2d0a3b99;hp=bac4523e85c425143527caeb25076672cf6952ec;hpb=9947c770b79585f718013305a956cf9473a4e0b2;p=cpPlugins.git diff --git a/lib/cpPlugins/Pipeline/Functor.h b/lib/cpPlugins/Pipeline/Functor.h index bac4523..96255b7 100644 --- a/lib/cpPlugins/Pipeline/Functor.h +++ b/lib/cpPlugins/Pipeline/Functor.h @@ -23,6 +23,25 @@ namespace cpPlugins itkTypeMacro( Functor, ProcessObject ); cpPlugins_Id_Macro( Functor, Object ); + public: + virtual void Instantiate( itk::LightObject* filter ) = 0; + + template< class _TFunctor > + _TFunctor* GetFunctor( ) + { + return( + dynamic_cast< _TFunctor* >( this->m_Functor.GetPointer( ) ) + ); + } + + template< class _TFunctor > + const _TFunctor* GetFunctor( ) const + { + return( + dynamic_cast< const _TFunctor* >( this->m_Functor.GetPointer( ) ) + ); + } + protected: Functor( ); virtual ~Functor( ); @@ -31,6 +50,9 @@ namespace cpPlugins // Purposely not implemented Functor( const Self& ); Self& operator=( const Self& ); + + protected: + itk::LightObject::Pointer m_Functor; }; } // ecapseman