]> Creatis software - cpPlugins.git/blob - lib/cpPlugins/Port.cxx
Code cleaning
[cpPlugins.git] / lib / cpPlugins / Port.cxx
1 #include <cpPlugins/Port.h>
2
3 // -------------------------------------------------------------------------
4 cpPlugins::Port::
5 Port( )
6 {
7   this->m_Data = NULL;
8 }
9
10 // -------------------------------------------------------------------------
11 cpPlugins::Port::
12 ~Port( )
13 {
14 }
15
16 // -------------------------------------------------------------------------
17 cpPlugins::Port::
18 Self& cpPlugins::Port::
19 operator=( DataObject* obj )
20 {
21   this->m_Data = obj;
22   return( *this );
23 }
24
25 // -------------------------------------------------------------------------
26 cpPlugins::Port::
27 Self& cpPlugins::Port::
28 operator=( const Self& other )
29 {
30   this->m_Data = other.m_Data;
31   return( *this );
32 }
33
34 // -------------------------------------------------------------------------
35 bool cpPlugins::Port::
36 IsValid( ) const
37 {
38   return( this->m_Data.IsNotNull( ) );
39 }
40
41 // -------------------------------------------------------------------------
42 cpPlugins::InputPort::
43 InputPort( bool required )
44   : Superclass( ),
45     m_Required( required )
46 {
47 }
48
49 // -------------------------------------------------------------------------
50 cpPlugins::InputPort::
51 ~InputPort( )
52 {
53 }
54       
55 // -------------------------------------------------------------------------
56 cpPlugins::InputPort::
57 Self& cpPlugins::InputPort::
58 operator=( DataObject* obj )
59 {
60   this->Superclass::operator=( obj );
61   return( *this );
62 }
63
64 // -------------------------------------------------------------------------
65 cpPlugins::InputPort::
66 Self& cpPlugins::InputPort::
67 operator=( const Superclass& other )
68 {
69   this->Superclass::operator=( other );
70   auto i = dynamic_cast< const InputPort* >( &other );
71   if( i != NULL )
72     this->m_Required = i->m_Required;
73   return( *this );
74 }
75
76 // -------------------------------------------------------------------------
77 bool cpPlugins::InputPort::
78 IsRequired( ) const
79 {
80   return( this->m_Required );
81 }
82
83 // -------------------------------------------------------------------------
84 void cpPlugins::InputPort::
85 RequiredOn( )
86 {
87   this->SetRequired( true );
88 }
89
90 // -------------------------------------------------------------------------
91 void cpPlugins::InputPort::
92 RequiredOff( )
93 {
94   this->SetRequired( false );
95 }
96
97 // -------------------------------------------------------------------------
98 void cpPlugins::InputPort::
99 SetRequired( bool required )
100 {
101   this->m_Required = required;
102 }
103
104 // -------------------------------------------------------------------------
105 cpPlugins::OutputPort::
106 OutputPort( )
107   : Superclass( )
108 {
109 }
110
111 // -------------------------------------------------------------------------
112 cpPlugins::OutputPort::
113 ~OutputPort( )
114 {
115 }
116
117 // -------------------------------------------------------------------------
118 cpPlugins::OutputPort::
119 Self& cpPlugins::OutputPort::
120 operator=( DataObject* obj )
121 {
122   this->Superclass::operator=( obj );
123   return( *this );
124 }
125
126 // -------------------------------------------------------------------------
127 cpPlugins::OutputPort::
128 Self& cpPlugins::OutputPort::
129 operator=( const Superclass& other )
130 {
131   this->Superclass::operator=( other );
132   return( *this );
133 }
134
135 // eof - $RCSfile$