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