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