]> 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(
33       dynamic_cast< const T* >( this->m_Inputs[ idx ].GetPointer( ) )
34       );
35   else
36     return( NULL );
37 }
38
39 // -------------------------------------------------------------------------
40 template< class T >
41 T* cpPlugins::Interface::ProcessObject::
42 _Output( unsigned int idx )
43 {
44   if( idx < this->m_Outputs.size( ) )
45     return( dynamic_cast< T* >( this->m_Outputs[ idx ].GetPointer( ) ) );
46   else
47     return( NULL );
48 }
49
50 // -------------------------------------------------------------------------
51 template< class T >
52 const T* cpPlugins::Interface::ProcessObject::
53 _Output( unsigned int idx ) const
54 {
55   if( idx < this->m_Outputs.size( ) )
56     return(
57       dynamic_cast< const T* >( this->m_Outputs[ idx ].GetPointer( ) )
58       );
59   else
60     return( NULL );
61 }
62
63 #endif // __CPPLUGINS__INTERFACE__PROCESSOBJECT__HXX__
64
65 // eof - $RCSfile$