X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=sidebyside;f=lib%2FcpPlugins%2FInterface%2FProcessObject.h;h=d201a6c84c09ac57782062d14178420412d206e0;hb=a3f2018cdd92e865082fed86673f10207c21ec51;hp=a9779282c8a59e37973504e1ec04730a4bf2a5ae;hpb=d33ff8f25fd903eca28c2f088adc8f68e7738135;p=cpPlugins.git diff --git a/lib/cpPlugins/Interface/ProcessObject.h b/lib/cpPlugins/Interface/ProcessObject.h index a977928..d201a6c 100644 --- a/lib/cpPlugins/Interface/ProcessObject.h +++ b/lib/cpPlugins/Interface/ProcessObject.h @@ -1,12 +1,13 @@ #ifndef __CPPLUGINS__INTERFACE__PROCESSOBJECT__H__ #define __CPPLUGINS__INTERFACE__PROCESSOBJECT__H__ -#include #include #include #include #include +#include + namespace cpPlugins { namespace Interface @@ -26,8 +27,6 @@ namespace cpPlugins itkTypeMacro( ProcessObject, Object ); public: - virtual std::string GetClassName( ) const; - virtual std::string GetClassType( ) const; virtual const Parameters& GetDefaultParameters( ) const; virtual void SetParameters( const Parameters& params ); @@ -38,26 +37,28 @@ namespace cpPlugins virtual void SetNumberOfOutputs( unsigned int n ); virtual void SetInput( unsigned int idx, DataObject* dobj ); - virtual DataObject* GetOutput( unsigned int idx ); virtual std::string Update( ); virtual void DisconnectOutputs( ); + template< class T > + inline T* GetInput( unsigned int idx ); + + template< class T > + inline const T* GetInput( unsigned int idx ) const; + + template< class T > + inline T* GetOutput( unsigned int idx ); + + template< class T > + inline const T* GetOutput( unsigned int idx ) const; + protected: ProcessObject( ); virtual ~ProcessObject( ); - virtual itk::DataObject* _GetInput( unsigned int idx ); - virtual void _SetOutput( unsigned int idx, itk::DataObject* dobj ); - template< class O > - void _MakeOutput( unsigned int idx ) - { - if( idx >= this->m_Outputs.size( ) ) - return; - this->m_Outputs[ idx ] = O::New( ); - this->m_Outputs[ idx ]->SetSource( this ); - } + inline void _MakeOutput( unsigned int idx ); virtual std::string _GenerateData( ) = 0; @@ -79,6 +80,8 @@ namespace cpPlugins } // ecapseman +#include + #endif // __CPPLUGINS__INTERFACE__PROCESSOBJECT__H__ // eof - $RCSfile$