Salome HOME
A special "Loading" state was implemented. It is returned to GUI if the correspondin...
[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       /* commenting out the lines below because it seems to be never executed
180          Editor::_Executing flag is set OFF in Executor::OutNode on execution finished
181          and in CNode_Impl class (also not called probably)
182       // asv: turn off Editor::_Executing flag
183       if ( _DataFlowExecutor->IsDone() ) {
184         _DataFlowEditor->Executing( false );
185       }
186       else 
187       */ 
188       if ( !_DataFlowExecutor->IsDone() ) {
189         RetVal = _DataFlowExecutor->ChangeInputData( _DataFlowNode->Name() ,
190                                                      _DataFlowPort->PortName() ,
191                                                      *anAny ) ;
192       }
193     }
194   }
195   if ( !RetVal ) {
196     MESSAGE( "Port_Impl::Input returns false _InputPort " << _InputPort << " IsEditing "
197              << _DataFlowEditor->IsEditing() << " Executor " << _DataFlowEditor->Executor() ) ;
198   }
199   endService( "Port_Impl::Input" );
200   return RetVal ;
201 }
202
203 char * Port_Impl::Name() {
204 //  beginService( "Port_Impl::Name" ) ;
205   const char * RetVal = _DataFlowPort->PortName() ;
206 //  endService( "Port_Impl::Name" ) ;
207   return CORBA::string_dup( RetVal ) ;
208 }
209
210 char * Port_Impl::Type() {
211 //  beginService( "Port_Impl::Type" ) ;
212   const char * RetVal = _DataFlowPort->PortType() ;
213 //  endService( "Port_Impl::Type" ) ;
214   return CORBA::string_dup( RetVal ) ;
215 }
216
217 SUPERV::CNode_ptr Port_Impl::Node() {
218   bool begin = true ;
219   SUPERV::CNode_var iobject ;
220   if ( _DataFlowNode ) {
221 //    MESSAGE( "Port_Impl::Node " << _DataFlowNode->Name() ) ;
222     iobject = SUPERV::CNode::_narrow( _DataFlowNode->ObjRef() ) ;
223     if ( CORBA::is_nil( iobject ) ) {
224       if ( begin ) {
225         beginService( "Port_Impl::Node" ) ;
226         begin = false ;
227       }
228       PortableServer::ObjectId * id ;
229       CORBA::Object_var obj ;
230       if ( _DataFlowNode->IsComputingNode() ) {
231         CNode_Impl * myNode = NULL ;
232         myNode = new CNode_Impl( _Orb , _Poa , _ContId ,
233                                  instanceName() , interfaceName() ,
234                                  _DataFlowEditor ,
235                                  _DataFlowNode ) ;
236         id = myNode->getId() ;
237         obj = _poa->id_to_reference(*id);
238         iobject = SUPERV::CNode::_narrow( obj ) ;
239         myNode->SetObjRef( SUPERV::CNode::_duplicate( iobject ) ) ;
240       }
241       else if ( _DataFlowNode->IsFactoryNode() ) {
242         FNode_Impl * myNode = NULL ;
243         myNode = new FNode_Impl( _Orb , _Poa , _ContId ,
244                                  instanceName() , interfaceName() ,
245                                  _DataFlowEditor ,
246                                  _DataFlowNode ) ;
247         id = myNode->getId() ;
248         obj = _poa->id_to_reference(*id);
249         SUPERV::FNode_var Fiobject = SUPERV::FNode::_narrow( obj ) ;
250         iobject = SUPERV::CNode::_narrow( Fiobject ) ;
251         myNode->SetObjRef( SUPERV::FNode::_duplicate( Fiobject ) ) ;
252       }
253       else if ( _DataFlowNode->IsInLineNode() ) {
254         INode_Impl * myNode = NULL ;
255         myNode = new INode_Impl( _Orb , _Poa , _ContId ,
256                                  instanceName() , interfaceName() ,
257                                  _DataFlowEditor ,
258                                  _DataFlowNode ) ;
259         id = myNode->getId() ;
260         obj = _poa->id_to_reference(*id);
261         SUPERV::INode_var Iiobject = SUPERV::INode::_narrow( obj ) ;
262         iobject = SUPERV::CNode::_narrow( Iiobject ) ;
263         myNode->SetObjRef( SUPERV::INode::_duplicate( Iiobject ) ) ;
264       }
265       else if ( _DataFlowNode->IsGOTONode() ) {
266         GNode_Impl * myNode = NULL ;
267         myNode = new GNode_Impl( _Orb , _Poa , _ContId ,
268                                  instanceName() , interfaceName() ,
269                                  _DataFlowEditor ,
270                                  _DataFlowNode ) ;
271         id = myNode->getId() ;
272         obj = _poa->id_to_reference(*id);
273         SUPERV::GNode_var Giobject = SUPERV::GNode::_narrow( obj ) ;
274         iobject = SUPERV::CNode::_narrow( Giobject ) ;
275         myNode->SetObjRef( SUPERV::GNode::_duplicate( Giobject ) ) ;
276       }
277       else if ( _DataFlowNode->IsLoopNode() ) {
278         LNode_Impl * myNode = NULL ;
279         myNode = new LNode_Impl( _Orb , _Poa , _ContId ,
280                                  instanceName() , interfaceName() ,
281                                  _DataFlowEditor ,
282                                  _DataFlowNode ) ;
283         id = myNode->getId() ;
284         obj = _poa->id_to_reference(*id);
285         SUPERV::LNode_var Liobject = SUPERV::LNode::_narrow( obj ) ;
286         iobject = SUPERV::CNode::_narrow( Liobject ) ;
287         myNode->SetObjRef( SUPERV::LNode::_duplicate( Liobject ) ) ;
288       }
289       else if ( _DataFlowNode->IsEndLoopNode() ) {
290         ELNode_Impl * myNode = NULL ;
291         myNode = new ELNode_Impl( _Orb , _Poa , _ContId ,
292                                   instanceName() , interfaceName() ,
293                                   _DataFlowEditor ,
294                                   _DataFlowNode ) ;
295         id = myNode->getId() ;
296         obj = _poa->id_to_reference(*id);
297         SUPERV::ELNode_var ELiobject = SUPERV::ELNode::_narrow( obj ) ;
298         iobject = SUPERV::CNode::_narrow( ELiobject ) ;
299         myNode->SetObjRef( SUPERV::ELNode::_duplicate( ELiobject ) ) ;
300       }
301       else if ( _DataFlowNode->IsSwitchNode() ) {
302         SNode_Impl * myNode = NULL ;
303         myNode = new SNode_Impl( _Orb , _Poa , _ContId ,
304                                  instanceName() , interfaceName() ,
305                                  _DataFlowEditor ,
306                                  _DataFlowNode ) ;
307         id = myNode->getId() ;
308         obj = _poa->id_to_reference(*id);
309         SUPERV::SNode_var Siobject = SUPERV::SNode::_narrow( obj ) ;
310         iobject = SUPERV::CNode::_narrow( Siobject ) ;
311         myNode->SetObjRef( SUPERV::SNode::_duplicate( Siobject ) ) ;
312       }
313       else if ( _DataFlowNode->IsEndSwitchNode() ) {
314         ESNode_Impl * myNode = NULL ;
315         myNode = new ESNode_Impl( _Orb , _Poa , _ContId ,
316                                   instanceName() , interfaceName() ,
317                                   _DataFlowEditor ,
318                                   _DataFlowNode ) ;
319         id = myNode->getId() ;
320         obj = _poa->id_to_reference(*id);
321         SUPERV::ESNode_var ESiobject = SUPERV::ESNode::_narrow( obj ) ;
322         iobject = SUPERV::CNode::_narrow( ESiobject ) ;
323         myNode->SetObjRef( SUPERV::ESNode::_duplicate( ESiobject ) ) ;
324       }
325     }
326     else {
327 //      MESSAGE( "Port_Impl::Node known objref " << iobject->Name() ) ;
328     }
329   }
330   else {
331     MESSAGE( "Port_Impl::GraphNode " << _DataFlowEditor->Graph()->Name() ) ;
332     iobject = SUPERV::CNode::_narrow( _DataFlowEditor->Graph()->ObjRef() ) ;
333     if ( CORBA::is_nil( iobject ) ) {
334       MESSAGE( "Port_Impl::GraphNode NilRef" ) ;
335     }
336   }
337   if ( !begin ) {
338     endService( "Port_Impl::Node" ) ;
339   }
340   return SUPERV::CNode::_duplicate( iobject ) ;
341 }
342
343 SUPERV::ListOfLinks * Port_Impl::Links() {
344   beginService( "Port_Impl::Links" ) ;
345   SUPERV::ListOfLinks_var RetVal = new SUPERV::ListOfLinks ;
346   RetVal = _DataFlowEditor->Graph()->ObjImpl()->Links( /*_DataFlowNode->ComputingNode() ,
347                                                          _DataFlowPort->PortName()*/ ) ;
348   MESSAGE( "Links of Node " << _DataFlowNode->ComputingNode()->Name()
349            << " and of Port " << _DataFlowPort->PortName()
350            << " _InputPort " << _InputPort ) ;
351   int i ;
352   for ( i = 0 ; i < (int ) RetVal->length() ; i++ ) {
353     MESSAGE( "Link " << RetVal[i]->OutPort()->Node()->Name() << "("
354              << RetVal[i]->OutPort()->Name() << ") --> "
355              << RetVal[i]->InPort()->Node()->Name() << "("
356              << RetVal[i]->InPort()->Name() << ")" ) ;
357   }
358   endService( "Port_Impl::Links" ) ;
359   return ( RetVal._retn() ) ;
360 }
361
362 SUPERV::Link_ptr Port_Impl::Link() {
363   bool begin = true ;
364   SUPERV::Link_var iobject = SUPERV::Link::_nil() ;
365   if ( _DataFlowNode->IsEndSwitchNode() ) {
366     beginService( "Port_Impl::Link" ) ;
367     begin = false ;
368     SUPERV::ListOfLinks_var Links = new SUPERV::ListOfLinks ;
369 //    cout << "Port_Impl::Link " << _DataFlowNode->Name() << " "
370 //         << _DataFlowPort->PortName() << endl ;
371     Links = _DataFlowEditor->Graph()->ObjImpl()->Links( /*_DataFlowNode->ComputingNode() ,
372                                                           _DataFlowPort->PortName()*/ ) ;
373     if ( Links->length() ) {
374       iobject = Links[ 0 ] ;
375     }
376   }
377   else {
378     char * FromNodeName = NULL ;
379     char * FromServiceParameterName = NULL ;
380     bool status = _DataFlowEditor->GetLink( _DataFlowNode->Name() ,
381                                             _DataFlowPort->PortName() ,
382                                             & FromNodeName ,
383                                             & FromServiceParameterName ) ;
384     if ( status ) {
385 //      cout << "Port_Impl::Link " << FromNodeName << "("
386 //           << FromServiceParameterName << ") --> " << _DataFlowNode->Name()
387 //           << "(" << _DataFlowPort->PortName() << ")" << endl ;
388 //      SUPERV::Port_ptr theOutPort = Port( FromServiceParameterName ) ;
389
390       GraphBase::InPort * anInPort = _DataFlowNode->GetChangeInPort( _DataFlowPort->PortName() ) ;
391       if ( anInPort->GetOutPort() ) {
392         GraphBase::OutPort * anOutPort = anInPort->GetOutPort() ;
393         if ( _DataFlowNode->IsEndLoopNode() && !strcmp( _DataFlowNode->CoupledNode()->Name() ,
394                                                         anOutPort->NodeName() ) ) {
395 //          MESSAGE( "Link " << anOutPort->NodeName() << "("
396 //                  << anOutPort->PortName() << ") --> " << _DataFlowNode->Name() << "("
397 //                  << anInPort->PortName() << ")" << " ignored" ) ;
398         }
399         else if ( CORBA::is_nil( anOutPort->InPortObjRef( anInPort ) ) ) {
400           if ( begin ) {
401             beginService( "Port_Impl::Link" ) ;
402             begin = false ;
403           }
404           bool Success ;
405           Link_Impl * myLink = new Link_Impl( _Orb , _Poa , _ContId ,
406                                     instanceName() , interfaceName() ,
407                                     _DataFlowEditor ,
408                                     _DataFlowNode ,
409                                     _DataFlowPort->PortName() ,
410                                     (GraphEditor::InNode * ) _DataFlowEditor->Graph()->GetChangeGraphNode( FromNodeName )->GetInNode() ,
411                                     FromServiceParameterName ,
412                                     false , true , Success ) ;
413           if ( Success ) {
414             PortableServer::ObjectId * id = myLink->getId() ;
415             CORBA::Object_var obj = _poa->id_to_reference(*id);
416             iobject = SUPERV::Link::_narrow(obj) ;
417             anOutPort->AddInPortObjRef( anInPort , SUPERV::Link::_duplicate( iobject ) ) ;
418           }
419         }
420         else {
421           iobject = anOutPort->InPortObjRef( anInPort ) ;
422         }
423       }
424     }
425   }
426   if ( !begin ) {
427     MESSAGE( "Link " << iobject->OutPort()->Node()->Name() << "( " << iobject->OutPort()->Name() << " ) --> "
428              << iobject->InPort()->Node()->Name() << "( " << iobject->InPort()->Name() << " ) " ) ;
429     endService( "Port_Impl::Link" ) ;
430   }
431   return SUPERV::Link::_duplicate( iobject ) ;
432 }
433
434 bool Port_Impl::IsInput() {
435 //  beginService( "Port_Impl::IsInput" ) ;
436   bool RetVal = _InputPort ;
437 //  MESSAGE( Name() << "IsInput() " << _InputPort ) ;
438 //  endService( "Port_Impl::IsInput" ) ;
439   return RetVal ;
440 }
441
442 bool Port_Impl::IsLinked() {
443 //  beginService( "Port_Impl::IsLinked" ) ;
444   bool RetVal = false ;
445   if ( _DataFlowNode ) {
446     GraphBase::InPort * anInPort = _DataFlowNode->GetChangeInPort( _DataFlowPort->PortName() ) ;
447     GraphBase::OutPort * anOutPort = NULL ;
448     if ( anInPort) {
449       anOutPort = anInPort->GetOutPort() ;
450     }
451     if ( _DataFlowNode->IsEndLoopNode() && anOutPort &&
452          !strcmp( _DataFlowNode->CoupledNode()->Name() , anOutPort->NodeName() ) ) {
453 //      MESSAGE( "Link " << anOutPort->NodeName() << "("
454 //              << anOutPort->PortName() << ") --> " << _DataFlowNode->Name() << "("
455 //              << anInPort->PortName() << ")" << " ignored" ) ;
456     }
457     else {
458       RetVal = _DataFlowNode->IsLinked( _DataFlowPort->PortName() ) ;
459     }
460   }
461 //  endService( "Port_Impl::IsLinked" ) ;
462   return RetVal ;
463 }
464
465 SUPERV::KindOfPort Port_Impl::Kind() {
466 //  beginService( "Port_Impl::Kind" ) ;
467   SUPERV::KindOfPort RetVal = _DataFlowPort->Kind() ;
468 //  endService( "Port_Impl::Kind" ) ;
469   return RetVal ;
470 }
471
472 void Port_Impl::SetKind( SUPERV::KindOfPort aKindOfPort ) {
473 //  beginService( "Port_Impl::SetKind" ) ;
474   _DataFlowPort->Kind( aKindOfPort ) ;
475 //  endService( "Port_Impl::SetKind" ) ;
476 }
477
478 bool Port_Impl::IsParam() {
479 //  beginService( "Port_Impl::IsParam" ) ;
480   bool RetVal = _DataFlowPort->IsParam() ;
481 //  endService( "Port_Impl::IsParam" ) ;
482   return RetVal ;
483 }
484
485 bool Port_Impl::IsGate() {
486 //  beginService( "Port_Impl::IsGate" ) ;
487   bool RetVal = _DataFlowPort->IsGate() ;
488 //  endService( "Port_Impl::IsGate" ) ;
489   return RetVal ;
490 }
491
492 bool Port_Impl::IsInLine() {
493 //  beginService( "Port_Impl::IsInLine" ) ;
494 //  bool RetVal = _DataFlowPort->IsBus() ;
495   bool RetVal = _DataFlowPort->IsInLine() ;
496 //  endService( "Port_Impl::IsInLine" ) ;
497   return RetVal ;
498 }
499
500 bool Port_Impl::IsLoop() {
501 //  beginService( "Port_Impl::IsLoop" ) ;
502   bool RetVal = _DataFlowPort->IsLoop() ;
503 //  endService( "Port_Impl::IsLoop" ) ;
504   return RetVal ;
505 }
506
507 bool Port_Impl::IsSwitch() {
508 //  beginService( "Port_Impl::IsSwitch" ) ;
509   bool RetVal = _DataFlowPort->IsSwitch() ;
510 //  endService( "Port_Impl::IsSwitch" ) ;
511   return RetVal ;
512 }
513
514 bool Port_Impl::IsEndSwitch() {
515 //  beginService( "Port_Impl::IsEndSwitch" ) ;
516   bool RetVal = _DataFlowPort->IsEndSwitch() ;
517 //  endService( "Port_Impl::IsEndSwitch" ) ;
518   return RetVal ;
519 }
520
521 bool Port_Impl::IsDataStream() {
522 //  beginService( "Port_Impl::IsDataStream" ) ;
523   bool RetVal = _DataFlowPort->IsDataStream() ;
524 //  endService( "Port_Impl::IsDataStream" ) ;
525   return RetVal ;
526 }
527
528 bool Port_Impl::HasInput() {
529 //  beginService( "Port_Impl::" ) ;
530   bool RetVal = false ;
531   if ( _DataFlowNode ) {
532     RetVal = _DataFlowNode->HasInput( _DataFlowPort->PortName() ) ;
533 //    cout << "Port_Impl::HasInput " << RetVal << " NodeName " << _DataFlowPort->NodeName() << " PortName "
534 //         << _DataFlowPort->PortName() << endl ;
535   }
536 //  endService( "Port_Impl::" ) ;
537   return RetVal ;
538 }
539
540 SUPERV::GraphState Port_Impl::State() {
541 //  beginService( "Port_Impl::State" );
542   SUPERV::GraphState RetVal = SUPERV::EditingState ;
543   if ( _DataFlowEditor ) {
544     GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
545     if ( _DataFlowExecutor ) {
546       RetVal = _DataFlowExecutor->State( _DataFlowPort->NodeName() ,
547                                          _DataFlowPort->PortName() ) ;
548     }
549   }
550 //  endService( "Port_Impl::State" );
551   return RetVal ;
552 }
553
554 bool Port_Impl::IsDone() {
555 //  beginService( "Port_Impl::IsDone" );
556   bool RetVal = false ;
557   if ( _DataFlowEditor ) {
558     GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
559     if ( _DataFlowExecutor ) {
560       RetVal = _DataFlowExecutor->IsDone( _DataFlowPort->NodeName() ,
561                                           _DataFlowPort->PortName() ) ;
562     }
563   }
564 //  endService( "Port_Impl::IsDone" );
565   return RetVal ;
566 }
567