]> Creatis software - cpPlugins.git/blob - lib/cpPlugins/Interface/ProcessObject.hxx
...
[cpPlugins.git] / lib / cpPlugins / Interface / ProcessObject.hxx
1 #ifndef __CPPLUGINS__INTERFACE__PROCESSOBJECT__HXX__
2 #define __CPPLUGINS__INTERFACE__PROCESSOBJECT__HXX__
3
4 // -------------------------------------------------------------------------
5 template< class O >
6 void cpPlugins::Interface::ProcessObject::
7 _MakeOutput( unsigned int idx )
8 {
9   if( idx >= this->m_Outputs.size( ) )
10     return;
11   this->m_Outputs[ idx ] = O::New( );
12   this->m_Outputs[ idx ]->SetSource( this );
13 }
14
15 // -------------------------------------------------------------------------
16 template< class T >
17 T* cpPlugins::Interface::ProcessObject::
18 _Input( unsigned int idx )
19 {
20   if( idx < this->m_Inputs.size( ) )
21     return( dynamic_cast< T* >( this->m_Inputs[ idx ].GetPointer( ) ) );
22   else
23     return( NULL );
24 }
25
26 // -------------------------------------------------------------------------
27 template< class T >
28 const T* cpPlugins::Interface::ProcessObject::
29 _Input( unsigned int idx ) const
30 {
31   if( idx < this->m_Inputs.size( ) )
32     return( dynamic_cast< const T* >( this->m_Inputs[ idx ].GetPointer( ) ) );
33   else
34     return( NULL );
35 }
36
37 // -------------------------------------------------------------------------
38 template< class T >
39 T* cpPlugins::Interface::ProcessObject::
40 _Output( unsigned int idx )
41 {
42   if( idx < this->m_Outputs.size( ) )
43     return( dynamic_cast< T* >( this->m_Outputs[ idx ].GetPointer( ) ) );
44   else
45     return( NULL );
46 }
47
48 // -------------------------------------------------------------------------
49 template< class T >
50 const T* cpPlugins::Interface::ProcessObject::
51 _Output( unsigned int idx ) const
52 {
53   if( idx < this->m_Outputs.size( ) )
54     return( dynamic_cast< const T* >( this->m_Outputs[ idx ].GetPointer( ) ) );
55   else
56     return( NULL );
57 }
58
59 #endif // __CPPLUGINS__INTERFACE__PROCESSOBJECT__HXX__
60
61 // eof - $RCSfile$