]> SALOME platform Git repositories - modules/superv.git/blob - src/Supervision/Port_Impl.cxx
Salome HOME
Merge with version on tag OCC-V2_1_0d
[modules/superv.git] / src / Supervision / Port_Impl.cxx
1 //  SUPERV Supervision : contains the implementation of interfaces of SuperVision described in SUPERV.idl
2 //
3 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
5 // 
6 //  This library is free software; you can redistribute it and/or 
7 //  modify it under the terms of the GNU Lesser General Public 
8 //  License as published by the Free Software Foundation; either 
9 //  version 2.1 of the License. 
10 // 
11 //  This library is distributed in the hope that it will be useful, 
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of 
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
14 //  Lesser General Public License for more details. 
15 // 
16 //  You should have received a copy of the GNU Lesser General Public 
17 //  License along with this library; if not, write to the Free Software 
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
19 // 
20 //  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
21 //
22 //
23 //
24 //  File   : Port_Impl.cxx
25 //  Author : Jean Rahuel
26 //  Module : SUPERV
27 //  $Header: 
28
29 using namespace std;
30 #include <stdio.h>
31 #include <fstream>
32 //#include <sstream>
33 #include <string>
34
35 //#include "utilities.h"
36
37 #include "Graph_Impl.hxx"
38 #include "Port_Impl.hxx"
39
40 Port_Impl::Port_Impl( CORBA::ORB_ptr orb ,
41                       PortableServer::POA_ptr poa ,
42                       PortableServer::ObjectId * contId , 
43                       const char *instanceName ,
44                       const char *interfaceName ,
45                       GraphEditor::DataFlow * DataFlowEditor ,
46                       GraphEditor::InNode * DataFlowNode ,
47                       GraphBase::Port * DataFlowPort ,
48                       bool InputPort ,
49                       const CORBA::Any * anAny ) :
50   Value_Impl(orb, poa, contId, instanceName, interfaceName,
51              DataFlowEditor , DataFlowNode , DataFlowPort->PortName(), anAny ,
52              false ) {
53 //  MESSAGE("Port_Impl::Port_Impl activate object instanceName("
54 //          << instanceName << ") interfaceName(" << interfaceName
55 //          << ") IsDataStream " << DataFlowPort->IsDataStream() )
56   _Orb = CORBA::ORB::_duplicate(orb);
57   _Poa = poa ;
58   _ContId = contId ;
59   if ( !DataFlowPort->IsDataStream() ) {
60     _thisObj = this ;
61     _id = _poa->activate_object(_thisObj) ;
62   }
63   _DataFlowEditor = DataFlowEditor ;
64   _DataFlowNode = DataFlowNode ;
65   _DataFlowPort = DataFlowPort ;
66   _InputPort = InputPort ;
67   InPort( _InputPort ) ;
68 }
69
70 Port_Impl::Port_Impl( CORBA::ORB_ptr orb ,
71                       PortableServer::POA_ptr poa ,
72                       PortableServer::ObjectId * contId , 
73                       const char *instanceName ,
74                       const char *interfaceName ,
75                       GraphEditor::DataFlow * DataFlowEditor ,
76                       GraphEditor::InNode * DataFlowNode ,
77                       GraphBase::Port * DataFlowPort ,
78                       bool InputPort ) :
79   Value_Impl(orb, poa, contId, instanceName, interfaceName,
80              DataFlowEditor , DataFlowNode , DataFlowPort->PortName() , false ) {
81   char * nodename = DataFlowEditor->Graph()->Name() ;
82   if ( DataFlowNode ) {
83     nodename = DataFlowNode->Name() ;
84   }
85 //  MESSAGE("Port_Impl::Port_Impl activate object instanceName("
86 //          << instanceName << ") interfaceName(" << interfaceName
87 //          << ") " << nodename << "(" << DataFlowPort->PortName()
88 //          << ") IsDataStream " << DataFlowPort->IsDataStream() ) ;
89   _Orb = CORBA::ORB::_duplicate(orb);
90   _Poa = poa ;
91   _ContId = contId ;
92   if ( !DataFlowPort->IsDataStream() ) {
93     _thisObj = this ;
94     _id = _poa->activate_object(_thisObj) ;
95   }
96   _DataFlowEditor = DataFlowEditor ;
97   _DataFlowNode = DataFlowNode ;
98   _DataFlowPort = DataFlowPort ;
99   _InputPort = InputPort ;
100   InPort( _InputPort ) ;
101 }
102
103 Port_Impl::Port_Impl() {
104 }
105
106 Port_Impl::~Port_Impl() {
107   beginService( "Port_Impl::~Port_Impl" );
108   endService( "Port_Impl::~Port_Impl" );
109 }
110
111 void Port_Impl::destroy() {
112   beginService( "Port_Impl::destroy" );
113   bool destroyed = false ;
114   if ( _DataFlowNode->IsOneOfInLineNodes() ) {
115     if ( _InputPort ) {
116       GraphBase::InPort * anInPort = (GraphBase::InPort * ) _DataFlowPort ;
117       if ( anInPort->GetOutPort() ) {
118         anInPort->GetOutPort()->RemoveInPort( anInPort ) ;
119       }
120       if ( _DataFlowNode->IsOneOfInLineNodes() ) {
121         _DataFlowNode->DelInPort( _DataFlowPort->PortName() ) ;
122         if ( _DataFlowNode->IsLoopNode() ) {
123           _DataFlowNode->DelOutPort( _DataFlowPort->PortName() ) ;
124           _DataFlowNode->CoupledNode()->DelInPort( _DataFlowPort->PortName() ) ;
125           _DataFlowNode->CoupledNode()->DelOutPort( _DataFlowPort->PortName() ) ;
126         }
127       }
128       else {
129       }
130       destroyed = true ;
131     }
132     else if ( _DataFlowNode->IsOneOfInLineNodes() && !_DataFlowNode->IsLoopNode() ) {
133       _DataFlowNode->DelOutPort( _DataFlowPort->PortName() ) ;
134       destroyed = true ;
135     }
136     else {
137       destroyed = true ;
138     }
139     if ( destroyed ) {
140       _DataFlowEditor->UnValid() ;
141     }
142   }
143   if ( destroyed ) {
144     _poa->deactivate_object(*_id) ;
145     CORBA::release(_poa) ;
146     delete(_id) ;
147     _thisObj->_remove_ref();
148   }
149   endService( "Port_Impl::destroy" );
150 }
151
152 void Port_Impl::Remove() {
153   beginService( "Port_Impl::Remove" );
154   _poa->deactivate_object(*_id) ;
155   CORBA::release(_poa) ;
156   delete(_id) ;
157   _thisObj->_remove_ref();
158   endService( "Port_Impl::Remove" );
159 }
160
161 bool Port_Impl::Input( const SUPERV::Value_ptr aValue ) {
162   return Input( aValue->ToAny() ) ;
163 }
164
165 bool Port_Impl::Input( const CORBA::Any * anAny ) {
166   beginService( "Port_Impl::Input" );
167   bool RetVal = false ;
168   if ( _DataFlowEditor->Graph()->GraphMacroLevel() == 0 ) {
169     if ( _InputPort && _DataFlowEditor->IsEditing() ) {
170       RetVal = true ;
171       Value_Impl::Input( anAny ) ;
172       RetVal = _DataFlowEditor->AddInputData( _DataFlowNode->Name() ,
173                                               _DataFlowPort->PortName() ,
174                                               *anAny ) ;
175     }
176     else if ( _DataFlowEditor->IsExecuting() ) {
177       GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
178       
179       // asv: turn off Editor::_Executing flag
180       if ( _DataFlowExecutor->IsDone() ) {
181         _DataFlowEditor->Executing( false );
182       }
183       else {
184         RetVal = _DataFlowExecutor->ChangeInputData( _DataFlowNode->Name() ,
185                                                      _DataFlowPort->PortName() ,
186                                                      *anAny ) ;
187       }
188     }
189   }
190   if ( !RetVal ) {
191     MESSAGE( "Port_Impl::Input returns false _InputPort " << _InputPort << " IsEditing "
192              << _DataFlowEditor->IsEditing() << " Executor " << _DataFlowEditor->Executor() ) ;
193   }
194   endService( "Port_Impl::Input" );
195   return RetVal ;
196 }
197
198 char * Port_Impl::Name() {
199 //  beginService( "Port_Impl::Name" ) ;
200   const char * RetVal = _DataFlowPort->PortName() ;
201 //  endService( "Port_Impl::Name" ) ;
202   return CORBA::string_dup( RetVal ) ;
203 }
204
205 char * Port_Impl::Type() {
206 //  beginService( "Port_Impl::Type" ) ;
207   const char * RetVal = _DataFlowPort->PortType() ;
208 //  endService( "Port_Impl::Type" ) ;
209   return CORBA::string_dup( RetVal ) ;
210 }
211
212 SUPERV::CNode_ptr Port_Impl::Node() {
213   bool begin = true ;
214   SUPERV::CNode_var iobject ;
215   if ( _DataFlowNode ) {
216 //    MESSAGE( "Port_Impl::Node " << _DataFlowNode->Name() ) ;
217     iobject = SUPERV::CNode::_narrow( _DataFlowNode->ObjRef() ) ;
218     if ( CORBA::is_nil( iobject ) ) {
219       if ( begin ) {
220         beginService( "Port_Impl::Node" ) ;
221         begin = false ;
222       }
223       PortableServer::ObjectId * id ;
224       CORBA::Object_var obj ;
225       if ( _DataFlowNode->IsComputingNode() ) {
226         CNode_Impl * myNode = NULL ;
227         myNode = new CNode_Impl( _Orb , _Poa , _ContId ,
228                                  instanceName() , interfaceName() ,
229                                  _DataFlowEditor ,
230                                  _DataFlowNode ) ;
231         id = myNode->getId() ;
232         obj = _poa->id_to_reference(*id);
233         iobject = SUPERV::CNode::_narrow( obj ) ;
234         myNode->SetObjRef( SUPERV::CNode::_duplicate( iobject ) ) ;
235       }
236       else if ( _DataFlowNode->IsFactoryNode() ) {
237         FNode_Impl * myNode = NULL ;
238         myNode = new FNode_Impl( _Orb , _Poa , _ContId ,
239                                  instanceName() , interfaceName() ,
240                                  _DataFlowEditor ,
241                                  _DataFlowNode ) ;
242         id = myNode->getId() ;
243         obj = _poa->id_to_reference(*id);
244         SUPERV::FNode_var Fiobject = SUPERV::FNode::_narrow( obj ) ;
245         iobject = SUPERV::CNode::_narrow( Fiobject ) ;
246         myNode->SetObjRef( SUPERV::FNode::_duplicate( Fiobject ) ) ;
247       }
248       else if ( _DataFlowNode->IsInLineNode() ) {
249         INode_Impl * myNode = NULL ;
250         myNode = new INode_Impl( _Orb , _Poa , _ContId ,
251                                  instanceName() , interfaceName() ,
252                                  _DataFlowEditor ,
253                                  _DataFlowNode ) ;
254         id = myNode->getId() ;
255         obj = _poa->id_to_reference(*id);
256         SUPERV::INode_var Iiobject = SUPERV::INode::_narrow( obj ) ;
257         iobject = SUPERV::CNode::_narrow( Iiobject ) ;
258         myNode->SetObjRef( SUPERV::INode::_duplicate( Iiobject ) ) ;
259       }
260       else if ( _DataFlowNode->IsGOTONode() ) {
261         GNode_Impl * myNode = NULL ;
262         myNode = new GNode_Impl( _Orb , _Poa , _ContId ,
263                                  instanceName() , interfaceName() ,
264                                  _DataFlowEditor ,
265                                  _DataFlowNode ) ;
266         id = myNode->getId() ;
267         obj = _poa->id_to_reference(*id);
268         SUPERV::GNode_var Giobject = SUPERV::GNode::_narrow( obj ) ;
269         iobject = SUPERV::CNode::_narrow( Giobject ) ;
270         myNode->SetObjRef( SUPERV::GNode::_duplicate( Giobject ) ) ;
271       }
272       else if ( _DataFlowNode->IsLoopNode() ) {
273         LNode_Impl * myNode = NULL ;
274         myNode = new LNode_Impl( _Orb , _Poa , _ContId ,
275                                  instanceName() , interfaceName() ,
276                                  _DataFlowEditor ,
277                                  _DataFlowNode ) ;
278         id = myNode->getId() ;
279         obj = _poa->id_to_reference(*id);
280         SUPERV::LNode_var Liobject = SUPERV::LNode::_narrow( obj ) ;
281         iobject = SUPERV::CNode::_narrow( Liobject ) ;
282         myNode->SetObjRef( SUPERV::LNode::_duplicate( Liobject ) ) ;
283       }
284       else if ( _DataFlowNode->IsEndLoopNode() ) {
285         ELNode_Impl * myNode = NULL ;
286         myNode = new ELNode_Impl( _Orb , _Poa , _ContId ,
287                                   instanceName() , interfaceName() ,
288                                   _DataFlowEditor ,
289                                   _DataFlowNode ) ;
290         id = myNode->getId() ;
291         obj = _poa->id_to_reference(*id);
292         SUPERV::ELNode_var ELiobject = SUPERV::ELNode::_narrow( obj ) ;
293         iobject = SUPERV::CNode::_narrow( ELiobject ) ;
294         myNode->SetObjRef( SUPERV::ELNode::_duplicate( ELiobject ) ) ;
295       }
296       else if ( _DataFlowNode->IsSwitchNode() ) {
297         SNode_Impl * myNode = NULL ;
298         myNode = new SNode_Impl( _Orb , _Poa , _ContId ,
299                                  instanceName() , interfaceName() ,
300                                  _DataFlowEditor ,
301                                  _DataFlowNode ) ;
302         id = myNode->getId() ;
303         obj = _poa->id_to_reference(*id);
304         SUPERV::SNode_var Siobject = SUPERV::SNode::_narrow( obj ) ;
305         iobject = SUPERV::CNode::_narrow( Siobject ) ;
306         myNode->SetObjRef( SUPERV::SNode::_duplicate( Siobject ) ) ;
307       }
308       else if ( _DataFlowNode->IsEndSwitchNode() ) {
309         ESNode_Impl * myNode = NULL ;
310         myNode = new ESNode_Impl( _Orb , _Poa , _ContId ,
311                                   instanceName() , interfaceName() ,
312                                   _DataFlowEditor ,
313                                   _DataFlowNode ) ;
314         id = myNode->getId() ;
315         obj = _poa->id_to_reference(*id);
316         SUPERV::ESNode_var ESiobject = SUPERV::ESNode::_narrow( obj ) ;
317         iobject = SUPERV::CNode::_narrow( ESiobject ) ;
318         myNode->SetObjRef( SUPERV::ESNode::_duplicate( ESiobject ) ) ;
319       }
320     }
321     else {
322 //      MESSAGE( "Port_Impl::Node known objref " << iobject->Name() ) ;
323     }
324   }
325   else {
326     MESSAGE( "Port_Impl::GraphNode " << _DataFlowEditor->Graph()->Name() ) ;
327     iobject = SUPERV::CNode::_narrow( _DataFlowEditor->Graph()->ObjRef() ) ;
328     if ( CORBA::is_nil( iobject ) ) {
329       MESSAGE( "Port_Impl::GraphNode NilRef" ) ;
330     }
331   }
332   if ( !begin ) {
333     endService( "Port_Impl::Node" ) ;
334   }
335   return SUPERV::CNode::_duplicate( iobject ) ;
336 }
337
338 SUPERV::ListOfLinks * Port_Impl::Links() {
339   beginService( "Port_Impl::Links" ) ;
340   SUPERV::ListOfLinks_var RetVal = new SUPERV::ListOfLinks ;
341   RetVal = _DataFlowEditor->Graph()->ObjImpl()->Links( /*_DataFlowNode->ComputingNode() ,
342                                                          _DataFlowPort->PortName()*/ ) ;
343   MESSAGE( "Links of Node " << _DataFlowNode->ComputingNode()->Name()
344            << " and of Port " << _DataFlowPort->PortName()
345            << " _InputPort " << _InputPort ) ;
346   int i ;
347   for ( i = 0 ; i < (int ) RetVal->length() ; i++ ) {
348     MESSAGE( "Link " << RetVal[i]->OutPort()->Node()->Name() << "("
349              << RetVal[i]->OutPort()->Name() << ") --> "
350              << RetVal[i]->InPort()->Node()->Name() << "("
351              << RetVal[i]->InPort()->Name() << ")" ) ;
352   }
353   endService( "Port_Impl::Links" ) ;
354   return ( RetVal._retn() ) ;
355 }
356
357 SUPERV::Link_ptr Port_Impl::Link() {
358   bool begin = true ;
359   SUPERV::Link_var iobject = SUPERV::Link::_nil() ;
360   if ( _DataFlowNode->IsEndSwitchNode() ) {
361     beginService( "Port_Impl::Link" ) ;
362     begin = false ;
363     SUPERV::ListOfLinks_var Links = new SUPERV::ListOfLinks ;
364 //    cout << "Port_Impl::Link " << _DataFlowNode->Name() << " "
365 //         << _DataFlowPort->PortName() << endl ;
366     Links = _DataFlowEditor->Graph()->ObjImpl()->Links( /*_DataFlowNode->ComputingNode() ,
367                                                           _DataFlowPort->PortName()*/ ) ;
368     if ( Links->length() ) {
369       iobject = Links[ 0 ] ;
370     }
371   }
372   else {
373     char * FromNodeName = NULL ;
374     char * FromServiceParameterName = NULL ;
375     bool status = _DataFlowEditor->GetLink( _DataFlowNode->Name() ,
376                                             _DataFlowPort->PortName() ,
377                                             & FromNodeName ,
378                                             & FromServiceParameterName ) ;
379     if ( status ) {
380 //      cout << "Port_Impl::Link " << FromNodeName << "("
381 //           << FromServiceParameterName << ") --> " << _DataFlowNode->Name()
382 //           << "(" << _DataFlowPort->PortName() << ")" << endl ;
383 //      SUPERV::Port_ptr theOutPort = Port( FromServiceParameterName ) ;
384
385       GraphBase::InPort * anInPort = _DataFlowNode->GetChangeInPort( _DataFlowPort->PortName() ) ;
386       if ( anInPort->GetOutPort() ) {
387         GraphBase::OutPort * anOutPort = anInPort->GetOutPort() ;
388         if ( _DataFlowNode->IsEndLoopNode() && !strcmp( _DataFlowNode->CoupledNode()->Name() ,
389                                                         anOutPort->NodeName() ) ) {
390 //          MESSAGE( "Link " << anOutPort->NodeName() << "("
391 //                  << anOutPort->PortName() << ") --> " << _DataFlowNode->Name() << "("
392 //                  << anInPort->PortName() << ")" << " ignored" ) ;
393         }
394         else if ( CORBA::is_nil( anOutPort->InPortObjRef( anInPort ) ) ) {
395           if ( begin ) {
396             beginService( "Port_Impl::Link" ) ;
397             begin = false ;
398           }
399           bool Success ;
400           Link_Impl * myLink = new Link_Impl( _Orb , _Poa , _ContId ,
401                                     instanceName() , interfaceName() ,
402                                     _DataFlowEditor ,
403                                     _DataFlowNode ,
404                                     _DataFlowPort->PortName() ,
405                                     (GraphEditor::InNode * ) _DataFlowEditor->Graph()->GetChangeGraphNode( FromNodeName )->GetInNode() ,
406                                     FromServiceParameterName ,
407                                     false , true , Success ) ;
408           if ( Success ) {
409             PortableServer::ObjectId * id = myLink->getId() ;
410             CORBA::Object_var obj = _poa->id_to_reference(*id);
411             iobject = SUPERV::Link::_narrow(obj) ;
412             anOutPort->AddInPortObjRef( anInPort , SUPERV::Link::_duplicate( iobject ) ) ;
413           }
414         }
415         else {
416           iobject = anOutPort->InPortObjRef( anInPort ) ;
417         }
418       }
419     }
420   }
421   if ( !begin ) {
422     MESSAGE( "Link " << iobject->OutPort()->Node()->Name() << "( " << iobject->OutPort()->Name() << " ) --> "
423              << iobject->InPort()->Node()->Name() << "( " << iobject->InPort()->Name() << " ) " ) ;
424     endService( "Port_Impl::Link" ) ;
425   }
426   return SUPERV::Link::_duplicate( iobject ) ;
427 }
428
429 bool Port_Impl::IsInput() {
430 //  beginService( "Port_Impl::IsInput" ) ;
431   bool RetVal = _InputPort ;
432 //  MESSAGE( Name() << "IsInput() " << _InputPort ) ;
433 //  endService( "Port_Impl::IsInput" ) ;
434   return RetVal ;
435 }
436
437 bool Port_Impl::IsLinked() {
438 //  beginService( "Port_Impl::IsLinked" ) ;
439   bool RetVal = false ;
440   if ( _DataFlowNode ) {
441     GraphBase::InPort * anInPort = _DataFlowNode->GetChangeInPort( _DataFlowPort->PortName() ) ;
442     GraphBase::OutPort * anOutPort = NULL ;
443     if ( anInPort) {
444       anOutPort = anInPort->GetOutPort() ;
445     }
446     if ( _DataFlowNode->IsEndLoopNode() && anOutPort &&
447          !strcmp( _DataFlowNode->CoupledNode()->Name() , anOutPort->NodeName() ) ) {
448 //      MESSAGE( "Link " << anOutPort->NodeName() << "("
449 //              << anOutPort->PortName() << ") --> " << _DataFlowNode->Name() << "("
450 //              << anInPort->PortName() << ")" << " ignored" ) ;
451     }
452     else {
453       RetVal = _DataFlowNode->IsLinked( _DataFlowPort->PortName() ) ;
454     }
455   }
456 //  endService( "Port_Impl::IsLinked" ) ;
457   return RetVal ;
458 }
459
460 SUPERV::KindOfPort Port_Impl::Kind() {
461 //  beginService( "Port_Impl::Kind" ) ;
462   SUPERV::KindOfPort RetVal = _DataFlowPort->Kind() ;
463 //  endService( "Port_Impl::Kind" ) ;
464   return RetVal ;
465 }
466
467 void Port_Impl::SetKind( SUPERV::KindOfPort aKindOfPort ) {
468 //  beginService( "Port_Impl::SetKind" ) ;
469   _DataFlowPort->Kind( aKindOfPort ) ;
470 //  endService( "Port_Impl::SetKind" ) ;
471 }
472
473 bool Port_Impl::IsParam() {
474 //  beginService( "Port_Impl::IsParam" ) ;
475   bool RetVal = _DataFlowPort->IsParam() ;
476 //  endService( "Port_Impl::IsParam" ) ;
477   return RetVal ;
478 }
479
480 bool Port_Impl::IsGate() {
481 //  beginService( "Port_Impl::IsGate" ) ;
482   bool RetVal = _DataFlowPort->IsGate() ;
483 //  endService( "Port_Impl::IsGate" ) ;
484   return RetVal ;
485 }
486
487 bool Port_Impl::IsInLine() {
488 //  beginService( "Port_Impl::IsInLine" ) ;
489 //  bool RetVal = _DataFlowPort->IsBus() ;
490   bool RetVal = _DataFlowPort->IsInLine() ;
491 //  endService( "Port_Impl::IsInLine" ) ;
492   return RetVal ;
493 }
494
495 bool Port_Impl::IsLoop() {
496 //  beginService( "Port_Impl::IsLoop" ) ;
497   bool RetVal = _DataFlowPort->IsLoop() ;
498 //  endService( "Port_Impl::IsLoop" ) ;
499   return RetVal ;
500 }
501
502 bool Port_Impl::IsSwitch() {
503 //  beginService( "Port_Impl::IsSwitch" ) ;
504   bool RetVal = _DataFlowPort->IsSwitch() ;
505 //  endService( "Port_Impl::IsSwitch" ) ;
506   return RetVal ;
507 }
508
509 bool Port_Impl::IsEndSwitch() {
510 //  beginService( "Port_Impl::IsEndSwitch" ) ;
511   bool RetVal = _DataFlowPort->IsEndSwitch() ;
512 //  endService( "Port_Impl::IsEndSwitch" ) ;
513   return RetVal ;
514 }
515
516 bool Port_Impl::IsDataStream() {
517 //  beginService( "Port_Impl::IsDataStream" ) ;
518   bool RetVal = _DataFlowPort->IsDataStream() ;
519 //  endService( "Port_Impl::IsDataStream" ) ;
520   return RetVal ;
521 }
522
523 bool Port_Impl::HasInput() {
524 //  beginService( "Port_Impl::" ) ;
525   bool RetVal = false ;
526   if ( _DataFlowNode ) {
527     RetVal = _DataFlowNode->HasInput( _DataFlowPort->PortName() ) ;
528 //    cout << "Port_Impl::HasInput " << RetVal << " NodeName " << _DataFlowPort->NodeName() << " PortName "
529 //         << _DataFlowPort->PortName() << endl ;
530   }
531 //  endService( "Port_Impl::" ) ;
532   return RetVal ;
533 }
534
535 SUPERV::GraphState Port_Impl::State() {
536 //  beginService( "Port_Impl::State" );
537   SUPERV::GraphState RetVal = SUPERV::EditingState ;
538   if ( _DataFlowEditor ) {
539     GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
540     if ( _DataFlowExecutor ) {
541       RetVal = _DataFlowExecutor->State( _DataFlowPort->NodeName() ,
542                                          _DataFlowPort->PortName() ) ;
543     }
544   }
545 //  endService( "Port_Impl::State" );
546   return RetVal ;
547 }
548
549 bool Port_Impl::IsDone() {
550 //  beginService( "Port_Impl::IsDone" );
551   bool RetVal = false ;
552   if ( _DataFlowEditor ) {
553     GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
554     if ( _DataFlowExecutor ) {
555       RetVal = _DataFlowExecutor->IsDone( _DataFlowPort->NodeName() ,
556                                           _DataFlowPort->PortName() ) ;
557     }
558   }
559 //  endService( "Port_Impl::IsDone" );
560   return RetVal ;
561 }
562