Salome HOME
*** empty log message ***
[modules/superv.git] / src / Supervision / CNode_Impl.cxx
1 //  SUPERV Supervision : contains the implementation of interfaces of SuperVision described in SUPERV.idl
2 //
3 //  Copyright (C) 2003  CEA/DEN, EDF R&D
4 //
5 //
6 //
7 //  File   : CNode_Impl.cxx
8 //  Author : Jean Rahuel
9 //  Module : SUPERV
10 //  $Header: 
11
12 using namespace std;
13 #include <stdio.h>
14 #include <fstream>
15 //#include <sstream>
16 #include <string>
17
18 //#include "utilities.h"
19
20 #include "StreamGraph_Impl.hxx"
21
22 #include "CNode_Impl.hxx"
23
24 #include "StreamPort_Impl.hxx"
25
26 CNode_Impl::CNode_Impl( CORBA::ORB_ptr orb ,
27                         PortableServer::POA_ptr poa ,
28                         PortableServer::ObjectId * contId , 
29                         const char *instanceName ,
30                         const char *interfaceName ,
31                         const char *aDataFlowName ) :
32   Engines_Component_i(orb, poa, contId, instanceName, interfaceName, false, false) {
33 //  MESSAGE("CNode_Impl::CNode_Impl activate object instanceName("
34 //          << instanceName << ") interfaceName(" << interfaceName << ") --> "
35 //          << hex << (void *) this << dec )
36 //  _thisObj = this ;
37 //  _id = _poa->activate_object(_thisObj);
38 //  MESSAGE( "CNode_Impl::CNode_Impl " << aDataFlowName << " " );
39   beginService( "CNode_Impl::CNode_Impl" );
40   _Orb = CORBA::ORB::_duplicate(orb);
41   _Poa = poa ;
42   _ContId = contId ;
43   _DataFlowNode = NULL ;
44   _IsNode = false ;
45   endService( "CNode_Impl::CNode_Impl" );  
46 }
47
48 CNode_Impl::CNode_Impl() {
49 }
50
51 CNode_Impl::CNode_Impl( CORBA::ORB_ptr orb ,
52                         PortableServer::POA_ptr poa ,
53                         PortableServer::ObjectId * contId , 
54                         const char *instanceName ,
55                         const char *interfaceName ,
56                         GraphEditor::DataFlow * DataFlowEditor ,
57                         const SALOME_ModuleCatalog::Service &NodeService ,
58                         const char * NodeName ,
59                         const SUPERV::KindOfNode NodeKindOfNode ,
60                         const char * FuncName  ,
61                         const SUPERV::ListOfStrings & PythonFunction ) :
62   Engines_Component_i(orb, poa, contId, instanceName, interfaceName, false, false) {
63   beginService( "CNode_Impl::CNode_Impl" );
64 //  cout << "CNode_Impl::CNode_Impl -->" << endl ;
65 //  if ( FuncName && NodeName ) {
66 //    cout << "CNode_Impl::CNode_Impl " << (void *) NodeName << " " << NodeName
67 //         << " " << strlen(NodeName) << " " << (void *) FuncName << " " << FuncName
68 //         << " " << strlen( FuncName ) << endl ;
69 //  }
70   if ( NodeKindOfNode == SUPERV::ComputingNode ) {
71     MESSAGE( "CNode_Impl::CNode_Impl " << FuncName << " _poa->activate_object" );
72     _thisObj = this ;
73     _id = _poa->activate_object(_thisObj);
74   }
75   _Orb = CORBA::ORB::_duplicate(orb);
76   _Poa = poa ;
77   _ContId = contId ;
78   _DataFlowEditor = DataFlowEditor ;
79   GraphBase::ListOfFuncName aFuncName ;
80   GraphBase::ListOfPythonFunctions aPythonFunction ;
81   if ( FuncName ) {
82     aFuncName.resize(1) ;
83     aFuncName[0] = my_strdup( FuncName ) ;
84     aPythonFunction.resize(1) ;
85     aPythonFunction[0] = &PythonFunction ;
86   }
87   _DataFlowNode = _DataFlowEditor->AddNode( NodeService , "" , "" , NodeName ,
88                                             NodeKindOfNode ,
89                                             aFuncName ,
90                                             aPythonFunction ) ;
91   _IsNode = true ;
92   endService( "CNode_Impl::CNode_Impl" );  
93 //  cout << "<-- CNode_Impl::CNode_Impl" << endl ;
94 }
95
96 CNode_Impl::CNode_Impl( CORBA::ORB_ptr orb ,
97                         PortableServer::POA_ptr poa ,
98                         PortableServer::ObjectId * contId , 
99                         const char *instanceName ,
100                         const char *interfaceName ,
101                         GraphEditor::DataFlow * DataFlowEditor ,
102                         const SALOME_ModuleCatalog::Service &NodeService ,
103                         const char * NodeName ,
104                         const SUPERV::KindOfNode NodeKindOfNode ,
105                         const GraphBase::ListOfFuncName & aFuncName  ,
106                         const GraphBase::ListOfPythonFunctions & aPythonFunction ) :
107   Engines_Component_i(orb, poa, contId, instanceName, interfaceName, false, false) {
108   MESSAGE( NodeName << " " );
109   beginService( "CNode_Impl::CNode_Impl" );
110   if ( NodeName ) {
111     MESSAGE("CNode_Impl::CNode_Impl " << NodeName << " " << strlen( NodeName ) ) ;
112   }
113   if ( NodeKindOfNode == SUPERV::ComputingNode ) {
114     MESSAGE( "CNode_Impl::CNode_Impl " << aFuncName[0] << " _poa->activate_object" );
115     _thisObj = this ;
116     _id = _poa->activate_object(_thisObj);
117   }
118   _Orb = CORBA::ORB::_duplicate(orb);
119   _Poa = poa ;
120   _ContId = contId ;
121   _DataFlowEditor = DataFlowEditor ;
122   _DataFlowNode = _DataFlowEditor->AddNode( NodeService , "" , "" , NodeName ,
123                                             NodeKindOfNode ,
124                                             aFuncName ,
125                                             aPythonFunction ) ;
126   _IsNode = true ;
127   endService( "CNode_Impl::CNode_Impl" );  
128 }
129
130 CNode_Impl::CNode_Impl( CORBA::ORB_ptr orb ,
131                         PortableServer::POA_ptr poa ,
132                         PortableServer::ObjectId * contId , 
133                         const char *instanceName ,
134                         const char *interfaceName ,
135                         GraphEditor::DataFlow * DataFlowEditor ,
136                         GraphEditor::InNode * DataFlowNode ) :
137   Engines_Component_i(orb, poa, contId, instanceName, interfaceName, false, false) {
138   MESSAGE( DataFlowNode->Name() << " " );
139   beginService( "CNode_Impl::CNode_Impl" );
140   if ( DataFlowNode->IsComputingNode() ) {
141     MESSAGE( "CNode_Impl::CNode_Impl _poa->activate_object" );
142     _thisObj = this ;
143     _id = _poa->activate_object(_thisObj);
144   }
145   else {
146     MESSAGE( "CNode_Impl::CNode_Impl NO _poa->activate_object " );
147   }
148   _Orb = CORBA::ORB::_duplicate(orb);
149   _Poa = poa ;
150   _ContId = contId ;
151   _DataFlowEditor = DataFlowEditor ;
152   _DataFlowNode = DataFlowNode ;
153   _IsNode = true ;
154   endService( "CNode_Impl::CNode_Impl" );  
155 }
156
157 CNode_Impl::~CNode_Impl() {
158   beginService( "CNode_Impl::~CNode_Impl" );
159   endService( "CNode_Impl::~CNode_Impl" );
160 }
161
162 void CNode_Impl::destroy() {
163   beginService( "CNode_Impl::Destroy" );
164   if ( _DataFlowEditor->IsEditing() ) {
165     if ( Delete() ) {
166       _DataFlowNode = NULL ;
167       _poa->deactivate_object(*_id) ;
168       CORBA::release(_poa) ;
169       delete(_id) ;
170       _thisObj->_remove_ref();
171     }
172   }
173 //  endService( "CNode_Impl::Destroy" );
174 }
175
176 bool CNode_Impl::Delete() {
177   beginService( "CNode_Impl::Delete" );
178   bool RetVal = false ;
179   if ( _DataFlowEditor->IsEditing() ) {
180     RetVal = _DataFlowEditor->RemoveNode( Name() ) ;
181     if ( RetVal ) {
182       RetVal = _DataFlowEditor->IsValid() ;
183     }
184   }
185   endService( "CNode_Impl::Delete" );
186   return RetVal ;
187 }
188
189 SALOME_ModuleCatalog::Service * CNode_Impl::Service() {
190 //  beginService( "CNode_Impl::Service" );
191   SALOME_ModuleCatalog::Service * RetVal ;
192   if ( _IsNode ) {
193     RetVal = new SALOME_ModuleCatalog::Service( *_DataFlowNode->GetService() ) ;
194   }
195   else {
196     RetVal = new SALOME_ModuleCatalog::Service( *_DataFlowEditor->GetService() ) ;
197   }
198 //  endService( "CNode_Impl::Service" );
199   return RetVal ;
200 }
201
202 char * CNode_Impl::Name() {
203 //  beginService( "CNode_Impl::Name" );
204   char * RetVal = NULL ;
205   if ( _IsNode ) {
206     RetVal = _DataFlowNode->Name() ;
207   }
208   else {
209     RetVal = _DataFlowEditor->Graph()->Name() ;
210   }
211 //  endService( "CNode_Impl::Name" );
212   return CORBA::string_dup( RetVal );
213 }
214 bool CNode_Impl::SetName( const char * aDataFlowName ) {
215 //  beginService( "CNode_Impl::SetName" );
216   bool RetVal = false ;
217   if ( _DataFlowEditor->IsEditing() ) {
218     if ( _IsNode ) {
219       RetVal = _DataFlowEditor->ReNameNode( _DataFlowNode->Name() ,
220                                             aDataFlowName ) ;
221     }
222     else {
223       RetVal = _DataFlowEditor->Graph()->Name( aDataFlowName ) ;
224     }
225   }
226 //  endService( "CNode_Impl::SetName" );
227   return RetVal ;
228 }
229 SUPERV::KindOfNode CNode_Impl::Kind() {
230 //  beginService( "CNode_Impl::Kind" );
231   SUPERV::KindOfNode RetVal = SUPERV::UnknownNode ;
232   if ( _IsNode ) {
233     RetVal = _DataFlowNode->Kind() ;
234   }
235   else {
236     RetVal = _DataFlowEditor->Graph()->Kind() ;
237   }
238 //  endService( "CNode_Impl::Kind" );
239   return RetVal ;
240 }
241 bool CNode_Impl::IsGraph() {
242 //  beginService( "CNode_Impl::IsGraph" );
243   bool RetVal = false ;
244   if ( _IsNode ) {
245     RetVal = _DataFlowNode->IsDataFlowNode() ;
246   }
247   else {
248     RetVal = _DataFlowEditor->Graph()->IsDataFlowNode() ;
249   }
250 //  endService( "CNode_Impl::IsGraph" );
251   return RetVal ;
252 }
253 bool CNode_Impl::IsStreamGraph() {
254 //  beginService( "CNode_Impl::IsStreamGraph" );
255   bool RetVal = false ;
256   if ( _IsNode ) {
257     RetVal = _DataFlowNode->IsDataStreamNode() ;
258   }
259   else {
260     RetVal = _DataFlowEditor->Graph()->IsDataStreamNode() ;
261   }
262 //  endService( "CNode_Impl::IsStreamGraph" );
263   return RetVal ;
264 }
265 bool CNode_Impl::IsComputing() {
266 //  beginService( "CNode_Impl::IsComputing" );
267   bool RetVal = SUPERV::UnknownNode ;
268   if ( _IsNode ) {
269     RetVal = _DataFlowNode->IsComputingNode() ;
270   }
271   else {
272     RetVal = _DataFlowEditor->Graph()->IsComputingNode() ;
273   }
274 //  endService( "CNode_Impl::IsComputing" );
275   return RetVal ;
276 }
277 bool CNode_Impl::IsFactory() {
278 //  beginService( "CNode_Impl::IsFactory" );
279   bool RetVal = SUPERV::UnknownNode ;
280   if ( _IsNode ) {
281     RetVal = _DataFlowNode->IsFactoryNode() ;
282   }
283   else {
284     RetVal = _DataFlowEditor->Graph()->IsFactoryNode() ;
285   }
286 //  endService( "CNode_Impl::IsFactory" );
287   return RetVal ;
288 }
289 bool CNode_Impl::IsInLine() {
290 //  beginService( "CNode_Impl::IsInLine" );
291   bool RetVal = SUPERV::UnknownNode ;
292   if ( _IsNode ) {
293     RetVal = _DataFlowNode->IsInLineNode() ;
294   }
295   else {
296     RetVal = _DataFlowEditor->Graph()->IsInLineNode() ;
297   }
298 //  endService( "CNode_Impl::IsInLine" );
299   return RetVal ;
300 }
301 bool CNode_Impl::IsGOTO() {
302 //  beginService( "CNode_Impl::IsGOTO" );
303   bool RetVal = SUPERV::UnknownNode ;
304   if ( _IsNode ) {
305     RetVal = _DataFlowNode->IsGOTONode() ;
306   }
307   else {
308     RetVal = _DataFlowEditor->Graph()->IsGOTONode() ;
309   }
310 //  endService( "CNode_Impl::IsGOTO" );
311   return RetVal ;
312 }
313 bool CNode_Impl::IsLoop() {
314 //  beginService( "CNode_Impl::IsLoop" );
315   bool RetVal = SUPERV::UnknownNode ;
316   if ( _IsNode ) {
317     RetVal = _DataFlowNode->IsLoopNode() ;
318   }
319   else {
320     RetVal = _DataFlowEditor->Graph()->IsLoopNode() ;
321   }
322 //  endService( "CNode_Impl::IsLoop" );
323   return RetVal ;
324 }
325 bool CNode_Impl::IsEndLoop() {
326 //  beginService( "CNode_Impl::IsEndLoop" );
327   bool RetVal = SUPERV::UnknownNode ;
328   if ( _IsNode ) {
329     RetVal = _DataFlowNode->IsEndLoopNode() ;
330   }
331   else {
332     RetVal = _DataFlowEditor->Graph()->IsEndLoopNode() ;
333   }
334 //  endService( "CNode_Impl::IsEndLoop" );
335   return RetVal ;
336 }
337 bool CNode_Impl::IsSwitch() {
338 //  beginService( "CNode_Impl::IsSwitch" );
339   bool RetVal = SUPERV::UnknownNode ;
340   if ( _IsNode ) {
341     RetVal = _DataFlowNode->IsSwitchNode() ;
342   }
343   else {
344     RetVal = _DataFlowEditor->Graph()->IsSwitchNode() ;
345   }
346 //  endService( "CNode_Impl::IsSwitch" );
347   return RetVal ;
348 }
349 bool CNode_Impl::IsEndSwitch() {
350 //  beginService( "CNode_Impl::IsEndSwitch" );
351   bool RetVal = SUPERV::UnknownNode ;
352   if ( _IsNode ) {
353     RetVal = _DataFlowNode->IsEndSwitchNode() ;
354   }
355   else {
356     RetVal = _DataFlowEditor->Graph()->IsEndSwitchNode() ;
357   }
358 //  endService( "CNode_Impl::IsEndSwitch" );
359   return RetVal ;
360 }
361
362 SUPERV::SDate CNode_Impl::CreationDate() {
363 //  beginService( "CNode_Impl::CreationDate" );
364   SUPERV::SDate_var RetVal ;
365   if ( _IsNode ) {
366     RetVal = new SUPERV::SDate( _DataFlowNode->FirstCreation() ) ;
367   }
368   else {
369 //    cout << " CNode_Impl::CreationDate " << _DataFlowEditor->FirstCreation()
370 //         << endl ;
371     RetVal = new SUPERV::SDate( _DataFlowEditor->Graph()->FirstCreation() ) ;
372   }
373 //  endService( "CNode_Impl::CreationDate" );
374   return (RetVal._retn()) ;
375 }
376 SUPERV::SDate CNode_Impl::LastUpdateDate() {
377 //  beginService( "CNode_Impl::LastUpdateDate" );
378   SUPERV::SDate_var RetVal ;
379   if ( _IsNode ) {
380     RetVal = new SUPERV::SDate( _DataFlowNode->LastModification() ) ;
381   }
382   else {
383     RetVal = new SUPERV::SDate( _DataFlowEditor->Graph()->LastModification() ) ;
384   }
385 //  endService( "CNode_Impl::LastUpdateDate" );
386   return  (RetVal._retn()) ;
387 }
388 char * CNode_Impl::Version() {
389 //  beginService( "CNode_Impl::Version" );
390   char * RetVal ;
391   if ( _IsNode ) {
392     RetVal = _DataFlowNode->EditorRelease() ;
393   }
394   else {
395     RetVal = _DataFlowEditor->Graph()->EditorRelease() ;
396   }
397 //  endService( "CNode_Impl::Version" );
398   return CORBA::string_dup( RetVal ) ;
399 }
400 char * CNode_Impl::Author() {
401 //  beginService( "CNode_Impl::Author" );
402   char * RetVal ;
403   if ( _IsNode ) {
404     RetVal = _DataFlowNode->Author() ;
405   }
406   else {
407     RetVal = _DataFlowEditor->Graph()->Author() ;
408   }
409 //  endService( "CNode_Impl::Author" );
410   return CORBA::string_dup( RetVal ) ;
411 }
412 bool CNode_Impl::SetAuthor( const char * aDataFlowAuthor ) {
413 //  beginService( "CNode_Impl::SetAuthor" );
414   bool RetVal = false ;
415   if ( _DataFlowEditor->IsEditing() ) {
416     if ( _IsNode ) {
417       RetVal = _DataFlowNode->Author( aDataFlowAuthor ) ;
418     }
419     else {
420       RetVal = _DataFlowEditor->Graph()->Author( aDataFlowAuthor ) ;
421     }
422   }
423 //  endService( "CNode_Impl::SetAuthor" );
424   return RetVal ;
425 }
426 char * CNode_Impl::Comment() {
427 //  beginService( "CNode_Impl::Comment" );
428   char * RetVal ;
429   if ( _IsNode ) {
430     RetVal = _DataFlowNode->Comment() ;
431   }
432   else {
433     RetVal = _DataFlowEditor->Graph()->Comment() ;
434   }
435 //  endService( "CNode_Impl::Comment" );
436   return CORBA::string_dup( RetVal ) ;
437 }
438 bool CNode_Impl::SetComment( const char * aDataFlowComment ) {
439 //  beginService( "CNode_Impl::SetComment" );
440   bool RetVal = false ;
441   if ( _DataFlowEditor->IsEditing() ) {
442     if ( _IsNode ) {
443       RetVal = _DataFlowNode->Comment( aDataFlowComment ) ;
444     }
445     else {
446       RetVal = _DataFlowEditor->Graph()->Comment( aDataFlowComment ) ;
447     }
448   }
449 //  endService( "CNode_Impl::SetComment" );
450   return RetVal ;
451 }
452
453 void CNode_Impl::Coords(long X , long Y ) {
454 //  beginService( "CNode_Impl::Coords" );
455   if ( _DataFlowEditor->IsEditing() ) {
456     if ( _IsNode ) {
457       ((GraphEditor::InNode *) _DataFlowNode)->Coordinates( X , Y ) ;
458     }
459     else {
460       _DataFlowEditor->Graph()->Coordinates( X , Y ) ;
461     }
462   }
463 //  endService( "CNode_Impl::Coords" );
464 }
465 long CNode_Impl::X() {
466 //  beginService( "CNode_Impl::X" );
467   long RetVal ;
468   if ( _IsNode ) {
469     RetVal = _DataFlowNode->XCoordinate() ;
470   }
471   else {
472     RetVal = _DataFlowEditor->Graph()->XCoordinate() ;
473   }
474 //  endService( "CNode_Impl::X" );
475   return RetVal ;
476 }
477 long CNode_Impl::Y() {
478 //  beginService( "CNode_Impl::Y" );
479   long RetVal ;
480   if ( _IsNode ) {
481     RetVal = _DataFlowNode->YCoordinate() ;
482   }
483   else {
484     RetVal = _DataFlowEditor->Graph()->YCoordinate() ;
485   }
486 //  endService( "CNode_Impl::Y" );
487   return RetVal ;
488 }
489
490 SUPERV::Port_ptr CNode_Impl::Port( const char * ServiceParameterName ) {
491   bool begin = true ;
492   Port_Impl * myPort = NULL ;
493   SUPERV::Port_var iobject = SUPERV::Port::_nil() ;
494   bool aninport ;
495   if ( _IsNode ) {
496     aninport = _DataFlowNode->GetInPort( ServiceParameterName ) ;
497   }
498   else {
499     aninport = _DataFlowEditor->GetInPort( ServiceParameterName ) ;
500   }  
501   bool anoutport ;
502   if ( _IsNode ) {
503     anoutport = _DataFlowNode->GetOutPort( ServiceParameterName ) ;
504   }
505   else {
506     anoutport = _DataFlowEditor->GetOutPort( ServiceParameterName ) ;
507   }
508   if ( aninport ) {
509     GraphBase::InPort * anInPort ;
510     if ( _IsNode ) {
511       anInPort = _DataFlowNode->GetChangeInPort( ServiceParameterName ) ;
512     }
513     else {
514       anInPort = _DataFlowEditor->GetChangeInPort( ServiceParameterName ) ;
515     }
516     if ( anInPort->IsDataStream() ) {
517       MESSAGE( "CNode_Impl::Port ERROR IsDataStream " ) ;
518     }
519     else if ( CORBA::is_nil( anInPort->ObjRef() ) ) {
520       if ( begin ) {
521         beginService( "CNode_Impl::Port" );
522         begin = false ;
523       }
524       bool hasinput ;
525       if ( _IsNode ) {
526         hasinput = _DataFlowNode->HasInput( anInPort->PortName() ) ;
527       }
528       else {
529         hasinput = _DataFlowEditor->HasInput( anInPort->PortName() ) ;
530       }
531       if ( hasinput ) {
532         const CORBA::Any * anAny = anInPort->GetOutPort()->Value() ;
533         myPort = new Port_Impl( _Orb , _Poa , _ContId ,
534                                 instanceName() , interfaceName() ,
535                                 _DataFlowEditor ,
536                                 _DataFlowNode ,
537 //                                ServiceParameterName ,
538                                 (GraphBase::Port * ) anInPort ,
539                                 true ,
540                                 anAny ) ;
541       }
542       else {
543         myPort = new Port_Impl( _Orb , _Poa , _ContId ,
544                                 instanceName() , interfaceName() ,
545                                 _DataFlowEditor ,
546                                 _DataFlowNode ,
547 //                                ServiceParameterName ) ;
548                                 (GraphBase::Port * ) anInPort ,
549                                 true ) ;
550       }
551       PortableServer::ObjectId * id = myPort->getId() ;
552       CORBA::Object_var obj = _poa->id_to_reference(*id);
553       iobject = SUPERV::Port::_narrow(obj) ;
554       anInPort->ObjRef( SUPERV::Port::_duplicate( iobject ) ) ;
555     }
556     else {
557       iobject = anInPort->ObjRef() ;
558     }
559   }
560   else if ( anoutport ) {
561     GraphBase::OutPort * anOutPort ;
562     if ( _IsNode ) {
563       anOutPort = _DataFlowNode->GetChangeOutPort( ServiceParameterName ) ;
564     }
565     else {
566       anOutPort = _DataFlowEditor->GetChangeOutPort( ServiceParameterName ) ;
567     }
568     if ( anOutPort->IsDataStream() ) {
569       MESSAGE( "CNode_Impl::Port ERROR IsDataStream " ) ;
570     }
571     else if ( CORBA::is_nil( anOutPort->ObjRef() ) ) {
572       if ( begin ) {
573         beginService( "CNode_Impl::Port" );
574         begin = false ;
575       }
576       const CORBA::Any * anAny = anOutPort->Value() ;
577       myPort = new Port_Impl( _Orb , _Poa , _ContId ,
578                               instanceName() , interfaceName() ,
579                               _DataFlowEditor ,
580                               _DataFlowNode ,
581 //                              ServiceParameterName ,
582                               (GraphBase::Port * ) anOutPort ,
583                               false ,
584                               anAny ) ;
585       PortableServer::ObjectId * id = myPort->getId() ;
586       CORBA::Object_var obj = _poa->id_to_reference(*id);
587       iobject = SUPERV::Port::_narrow(obj) ;
588       anOutPort->ObjRef( SUPERV::Port::_duplicate( iobject ) ) ;
589     }
590     else {
591       iobject = anOutPort->ObjRef() ;
592     }
593   }
594   if ( !begin ) {
595     endService( "CNode_Impl::Port" );
596   }
597   return SUPERV::Port::_duplicate( iobject ) ;
598 }
599
600 SUPERV::Port_ptr CNode_Impl::Input( const char * ToServiceParameterName ,
601                                     const SUPERV::Value_ptr aValue ) {
602   bool begin = true ;
603   SUPERV::Port_var iobject = SUPERV::Port::_nil() ;
604   GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
605   bool sts = false ;
606   GraphBase::InPort * anInPort = NULL ;
607   if ( _DataFlowEditor->IsEditing() ) {
608     if ( _IsNode ) {
609       sts = _DataFlowEditor->AddInputData( _DataFlowNode->Name() ,
610                                            ToServiceParameterName ,
611                                            *aValue->ToAny() ) ;
612       anInPort = _DataFlowNode->GetChangeInPort( ToServiceParameterName ) ;
613     }
614     else {
615       sts = _DataFlowEditor->AddInputData( _DataFlowEditor->Graph()->Name() ,
616                                            ToServiceParameterName ,
617                                            *aValue->ToAny() ) ;
618       anInPort = _DataFlowEditor->Graph()->GetChangeInPort( ToServiceParameterName ) ;
619     }
620     if ( sts && anInPort ) {
621       if ( CORBA::is_nil( anInPort->ObjRef() ) ) {
622         if ( begin ) {
623           beginService( "CNode_Impl::Input" );
624           begin = false ;
625         }
626         Port_Impl * myPort ;
627         myPort = new Port_Impl( _Orb , _Poa , _ContId ,
628                                 instanceName() , interfaceName() ,
629                                 _DataFlowEditor ,
630                                 _DataFlowNode ,
631 //                                ToServiceParameterName ,
632                                 (GraphBase::Port * ) anInPort ,
633                                 true ,
634                                 aValue->ToAny() ) ;
635         PortableServer::ObjectId * id = myPort->getId() ;
636         CORBA::Object_var obj = _poa->id_to_reference(*id);
637         iobject = SUPERV::Port::_narrow(obj) ;
638         anInPort->ObjRef( SUPERV::Port::_duplicate( iobject ) ) ;
639       }
640       else {
641         iobject = anInPort->ObjRef() ;
642       }
643     }
644   }
645   else if ( _DataFlowExecutor ) {
646     if ( _IsNode ) {
647       sts = _DataFlowExecutor->ChangeInputData( _DataFlowNode->Name() ,
648                                                 ToServiceParameterName ,
649                                                 *aValue->ToAny() ) ;
650       anInPort = _DataFlowNode->GetChangeInPort( ToServiceParameterName ) ;
651     }
652     else {
653       sts = _DataFlowExecutor->ChangeInputData( _DataFlowEditor->Graph()->Name() ,
654                                                 ToServiceParameterName ,
655                                                 *aValue->ToAny() ) ;
656       anInPort = _DataFlowEditor->Graph()->GetChangeInPort( ToServiceParameterName ) ;
657     }
658     if ( sts && anInPort ) {
659       if ( CORBA::is_nil( anInPort->ObjRef() ) ) {
660         if ( begin ) {
661           beginService( "CNode_Impl::Input" );
662           begin = false ;
663         }
664         Port_Impl * myPort ;
665         myPort = new Port_Impl( _Orb , _Poa , _ContId ,
666                                 instanceName() , interfaceName() ,
667                                 _DataFlowEditor ,
668                                 _DataFlowNode ,
669 //                                ToServiceParameterName ,
670                                 (GraphBase::Port * ) anInPort ,
671                                 true ,
672                                 aValue->ToAny() ) ;
673         PortableServer::ObjectId * id = myPort->getId() ;
674         CORBA::Object_var obj = _poa->id_to_reference(*id);
675         iobject = SUPERV::Port::_narrow(obj) ;
676         anInPort->ObjRef( SUPERV::Port::_duplicate( iobject ) ) ;
677       }
678       else {
679         iobject = anInPort->ObjRef() ;
680       }
681     }
682   }
683   if ( !begin ) {
684     endService( "CNode_Impl::Input" );
685   }
686   if ( CORBA::is_nil( iobject ) ) {
687     MESSAGE( "CNode_Impl::Input returns nil object _IsNode " << _IsNode << " sts " << sts << " anInPort "
688              << anInPort ) ;
689   }
690   return SUPERV::Port::_duplicate( iobject ) ;
691 }
692
693 SUPERV::Port_ptr CNode_Impl::GetInPort( const char *aParameterName ) {
694   SUPERV::Port_ptr Inobject = SUPERV::Port::_nil() ;
695   Port_Impl * myInPort = NULL ;
696   GraphBase::InPort * anInPort = DataFlowNode()->GetChangeInPort( aParameterName ) ;
697   if ( anInPort && !anInPort->IsDataStream() ) {
698     Inobject = anInPort->ObjRef() ;
699     if ( CORBA::is_nil( Inobject ) ) {
700       myInPort = new Port_Impl( _Orb , _Poa , _ContId ,
701                                 instanceName() , interfaceName() ,
702                                 DataFlowEditor() ,
703                                 DataFlowNode() ,
704                                 (GraphBase::Port * ) anInPort ,
705                                 true ) ;
706       if ( myInPort ) {
707         PortableServer::ObjectId * id = myInPort->getId() ;
708         CORBA::Object_var obj = _poa->id_to_reference(*id) ;
709         Inobject = SUPERV::Port::_narrow(obj) ;
710         anInPort->ObjRef( SUPERV::Port::_duplicate( Inobject ) ) ;
711       }
712     }
713   }
714   return SUPERV::Port::_duplicate( Inobject ) ;
715 }
716
717 SUPERV::Port_ptr CNode_Impl::GetOutPort( const char *aParameterName ) {
718   Port_Impl * myOutPort = NULL ;
719   SUPERV::Port_ptr Outobject = SUPERV::Port::_nil() ;
720   GraphBase::OutPort * anOutPort = DataFlowNode()->GetChangeOutPort( aParameterName ) ;
721   if ( anOutPort && !anOutPort->IsDataStream() ) {
722     Outobject = anOutPort->ObjRef() ;
723     if ( CORBA::is_nil( Outobject ) ) {
724       const CORBA::Any * anAny = anOutPort->Value() ;
725       myOutPort = new Port_Impl( _Orb , _Poa , _ContId ,
726                                  instanceName() , interfaceName() ,
727                                  DataFlowEditor() ,
728                                  DataFlowNode() ,
729                                  (GraphBase::Port * ) anOutPort ,
730                                  false ,
731                                  anAny ) ;
732       if ( myOutPort ) {
733         PortableServer::ObjectId * id = myOutPort->getId() ;
734         CORBA::Object_var obj = _poa->id_to_reference(*id) ;
735         Outobject = SUPERV::Port::_narrow(obj) ;
736         anOutPort->ObjRef( SUPERV::Port::_duplicate( Outobject ) ) ;
737       }
738     }
739   }
740   return SUPERV::Port::_duplicate( Outobject );
741 }
742
743 SUPERV::StreamPort_ptr CNode_Impl::GetInStreamPort( const char *aParameterName ) {
744   SUPERV::StreamPort_ptr Inobject = SUPERV::StreamPort::_nil() ;
745   if ( DataFlowEditor()->Graph()->IsDataStreamNode() ) {
746     StreamPort_Impl * myInStreamPort = NULL ;
747     GraphBase::InPort * anInPort = DataFlowNode()->GetChangeInPort( aParameterName ) ;
748     if ( anInPort && anInPort->IsDataStream() ) {
749       Inobject = SUPERV::StreamPort::_narrow( anInPort->ObjRef() ) ;
750       if ( CORBA::is_nil( Inobject ) ) {
751         myInStreamPort = new StreamPort_Impl( _Orb , _Poa , _ContId ,
752                                 instanceName() , interfaceName() ,
753                                 DataFlowEditor() ,
754                                 DataFlowNode() ,
755                                 (GraphBase::Port * ) anInPort ,
756                                 true ) ;
757         if ( myInStreamPort ) {
758           PortableServer::ObjectId * id = myInStreamPort->getId() ;
759           CORBA::Object_var obj = _poa->id_to_reference(*id) ;
760           Inobject = SUPERV::StreamPort::_narrow(obj) ;
761           anInPort->ObjRef( SUPERV::StreamPort::_duplicate( Inobject ) ) ;
762         }
763       }      
764     }
765   }
766   return SUPERV::StreamPort::_duplicate( Inobject ) ;
767 }
768
769 SUPERV::StreamPort_ptr CNode_Impl::GetOutStreamPort( const char *aParameterName ) {
770   StreamPort_Impl * myOutStreamPort = NULL ;
771   SUPERV::StreamPort_ptr Outobject = SUPERV::StreamPort::_nil() ;
772   if ( DataFlowEditor()->Graph()->IsDataStreamNode() ) {
773     GraphBase::OutPort * anOutPort = DataFlowNode()->GetChangeOutPort( aParameterName ) ;
774     if ( anOutPort && anOutPort->IsDataStream() ) {
775       Outobject = SUPERV::StreamPort::_narrow( anOutPort->ObjRef() ) ;
776       if ( CORBA::is_nil( Outobject ) ) {
777         const CORBA::Any * anAny = anOutPort->Value() ;
778         myOutStreamPort = new StreamPort_Impl( _Orb , _Poa , _ContId ,
779                                  instanceName() , interfaceName() ,
780                                  DataFlowEditor() ,
781                                  DataFlowNode() ,
782                                  (GraphBase::Port * ) anOutPort ,
783                                  false ,
784                                  anAny ) ;
785         if ( myOutStreamPort ) {
786           PortableServer::ObjectId * id = myOutStreamPort->getId() ;
787           CORBA::Object_var obj = _poa->id_to_reference(*id) ;
788           Outobject = SUPERV::StreamPort::_narrow(obj) ;
789           anOutPort->ObjRef( SUPERV::StreamPort::_duplicate( Outobject ) ) ;
790         }
791       }
792     }
793   }
794   return SUPERV::StreamPort::_duplicate( Outobject );
795 }
796
797 SUPERV::Link_ptr CNode_Impl::GetLink(const char * ToServiceParameterName ) {
798   bool begin = true ;
799   SUPERV::Link_var iobject = SUPERV::Link::_nil() ;
800   char* FromNodeName ;
801   char* FromServiceParameterName ;
802   bool status = _DataFlowEditor->GetLink( _DataFlowNode->Name() ,
803                                           ToServiceParameterName ,
804                                           & FromNodeName ,
805                                           & FromServiceParameterName ) ;
806   if ( status ) {
807     GraphBase::InPort * anInPort = _DataFlowNode->GetChangeInPort( ToServiceParameterName ) ;
808     if ( !anInPort->IsDataStream() && anInPort->GetOutPort() ) {
809       GraphBase::OutPort * anOutPort = anInPort->GetOutPort() ;
810       if ( CORBA::is_nil( anOutPort->InPortObjRef( anInPort ) ) ) {
811         if ( begin ) {
812           beginService( "CNode_Impl::GetLink" );
813           begin = false ;
814         }
815         bool Success ;
816         Link_Impl * myLink = new Link_Impl( _Orb , _Poa , _ContId ,
817                                             instanceName() , interfaceName() ,
818                                             _DataFlowEditor ,
819                                             _DataFlowNode ,
820                                             ToServiceParameterName ,
821                                             (GraphEditor::InNode *) _DataFlowEditor->Graph()->GetChangeGraphNode( FromNodeName )->GetInNode() ,
822                                             FromServiceParameterName ,
823                                             true , false , Success ) ;
824         if ( Success ) {
825           PortableServer::ObjectId * id = myLink->getId() ;
826           CORBA::Object_var obj = _poa->id_to_reference(*id);
827           iobject = SUPERV::Link::_narrow(obj) ;
828           anOutPort->AddInPortObjRef( anInPort , SUPERV::Link::_duplicate( iobject ) ) ;
829         }
830       }
831       else {
832         iobject = anOutPort->InPortObjRef( anInPort ) ;
833       }
834     }
835   }
836   if ( !begin ) {
837     endService( "CNode_Impl::GetLink" );
838   }
839   return SUPERV::Link::_duplicate( iobject ) ;
840 }
841
842 SUPERV::StreamLink_ptr CNode_Impl::GetStreamLink(const char * ToServiceParameterName ) {
843   bool begin = true ;
844   SUPERV::StreamLink_var iobject = SUPERV::StreamLink::_nil() ;
845   char* FromNodeName ;
846   char* FromServiceParameterName ;
847   if ( DataFlowEditor()->Graph()->IsDataStreamNode() ) {
848     bool status = _DataFlowEditor->GetLink( _DataFlowNode->Name() ,
849                                             ToServiceParameterName ,
850                                             & FromNodeName ,
851                                             & FromServiceParameterName ) ;
852     if ( status ) {
853       GraphBase::InPort * anInPort = _DataFlowNode->GetChangeInPort( ToServiceParameterName ) ;
854       if ( anInPort->IsDataStream() && anInPort->GetOutPort() ) {
855         GraphBase::OutPort * anOutPort = anInPort->GetOutPort() ;
856         if ( CORBA::is_nil( anOutPort->InPortObjRef( anInPort ) ) ) {
857           if ( begin ) {
858             beginService( "CNode_Impl::GetLink" );
859             begin = false ;
860           }
861           bool Success ;
862           StreamLink_Impl * myStreamLink = new StreamLink_Impl(
863                                             _Orb , _Poa , _ContId ,
864                                             instanceName() , interfaceName() ,
865                                             _DataFlowEditor ,
866                                             _DataFlowNode ,
867                                             ToServiceParameterName ,
868                                             (GraphEditor::InNode *) _DataFlowEditor->Graph()->GetChangeGraphNode( FromNodeName )->GetInNode() ,
869                                             FromServiceParameterName ,
870                                             true , Success ) ;
871           if ( Success ) {
872             PortableServer::ObjectId * id = myStreamLink->getId() ;
873             CORBA::Object_var obj = _poa->id_to_reference(*id);
874             iobject = SUPERV::StreamLink::_narrow(obj) ;
875             anOutPort->AddInPortObjRef( anInPort , SUPERV::StreamLink::_duplicate( iobject ) ) ;
876           }
877         }
878         else {
879           iobject = SUPERV::StreamLink::_narrow( anOutPort->InPortObjRef( anInPort ) ) ;
880         }
881       }
882     }
883   }
884   if ( !begin ) {
885     endService( "CNode_Impl::GetLink" );
886   }
887   return SUPERV::StreamLink::_duplicate( iobject ) ;
888 }
889
890 SUPERV::ListOfPorts * CNode_Impl::Ports() {
891   bool begin = true ;
892   int i , j ;
893   int PortCount = 0 ;
894   SUPERV::ListOfPorts_var RetVal = new SUPERV::ListOfPorts ;
895   if ( _IsNode ) {
896 //    RetVal->length( _DataFlowNode->GetNodeInPortsSize() +
897 //                    _DataFlowNode->GetNodeOutPortsSize() ) ;
898     for ( i = 0 ; i < _DataFlowNode->GetNodeInPortsSize() ; i++ ) {
899       GraphBase::InPort * anInPort = _DataFlowNode->GetChangeNodeInPort( i ) ;
900       if ( !anInPort->IsDataStream() ) {
901         if ( begin ) {
902           beginService( "CNode_Impl::Ports" );
903           begin = false ;
904         }
905         if ( anInPort->IsLoop() || ( anInPort->IsGate() && !anInPort->IsConnected() && 
906                                      ( _DataFlowEditor->IsExecuting() || _DataFlowEditor->IsReadOnly() ) ) ) {
907           MESSAGE( "InPort " << i << " " << anInPort->PortName() << " of Node " << Name() << " ignored" ) ;
908 //          RetVal[ i ] = SUPERV::Port::_duplicate( SUPERV::Port::_narrow( CORBA::Object::_nil() ) ) ;
909         }
910         else if ( CORBA::is_nil( anInPort->ObjRef() ) ) {
911           MESSAGE( "InPort " << i << " " << anInPort->PortName() << " of Node " << Name() << " IsExecuting "
912                    << _DataFlowEditor->IsExecuting() << " IsGate/IsConnected " << anInPort->IsGate()
913                    << "/" << anInPort->IsConnected() ) ;
914           Port_Impl * myPort ;
915           if ( _DataFlowNode->HasInput( anInPort->PortName() ) ) {
916             const CORBA::Any * anAny = anInPort->GetOutPort()->Value() ;
917             myPort = new Port_Impl( _Orb , _Poa , _ContId ,
918                                     instanceName() , interfaceName() ,
919                                     _DataFlowEditor ,
920                                     _DataFlowNode ,
921                                     (GraphBase::Port * ) anInPort ,
922                                     true ,
923                                     anAny ) ;
924           }
925           else {
926             myPort = new Port_Impl( _Orb , _Poa , _ContId ,
927                                     instanceName() , interfaceName() ,
928                                     _DataFlowEditor ,
929                                     _DataFlowNode ,
930                                     (GraphBase::Port * ) anInPort ,
931                                     true ) ;
932           }
933           PortableServer::ObjectId * id = myPort->getId() ;
934           CORBA::Object_var obj = _poa->id_to_reference(*id);
935           SUPERV::Port_var iobject ;
936           iobject = SUPERV::Port::_narrow(obj) ;
937           PortCount += 1 ;
938           RetVal->length( PortCount ) ;
939           RetVal[ PortCount - 1 ] = SUPERV::Port::_duplicate( iobject ) ;
940           anInPort->ObjRef( SUPERV::Port::_duplicate( iobject ) ) ;
941         }
942         else {
943           MESSAGE( "InPort " << i << " " << anInPort->PortName() << " of Node " << Name() ) ;
944           PortCount += 1 ;
945           RetVal->length( PortCount ) ;
946           RetVal[ PortCount - 1 ] = SUPERV::Port::_duplicate( anInPort->ObjRef() ) ;
947         }
948       }
949       else {
950         MESSAGE( "InPort " << i << " " << anInPort->PortName() << " of Node " << Name() << " IsDataStream" ) ;
951 //        RetVal[ i ] = SUPERV::Port::_duplicate( SUPERV::Port::_narrow( CORBA::Object::_nil() ) ) ;
952       }
953     }
954     for ( i = 0 ; i < _DataFlowNode->GetNodeOutPortsSize() ; i++ ) {
955       GraphBase::OutPort * anOutPort = _DataFlowNode->GetChangeNodeOutPort( i ) ;
956       if ( !anOutPort->IsDataStream() ) {
957         if ( begin ) {
958           beginService( "CNode_Impl::Ports" );
959           begin = false ;
960         }
961         if ( anOutPort->IsLoop() || ( anOutPort->IsGate() && !anOutPort->IsConnected() &&
962                                       ( _DataFlowEditor->IsExecuting() || _DataFlowEditor->IsReadOnly() ) ) ) {
963           MESSAGE( "OutPort " << i << " " << anOutPort->PortName() << " of Node " << Name() << " ignored" ) ;
964 //          RetVal[ _DataFlowNode->GetNodeInPortsSize() + i ] = SUPERV::Port::_duplicate( SUPERV::Port::_narrow( CORBA::Object::_nil() ) ) ;
965         }
966         else if ( CORBA::is_nil( anOutPort->ObjRef() ) ) {
967           MESSAGE( "OutPort " << i << " " << anOutPort->PortName() << " of Node " << Name() ) ;
968           const CORBA::Any * anAny = anOutPort->Value() ;
969           Port_Impl * myPort = new Port_Impl( _Orb , _Poa , _ContId ,
970                                               instanceName() , interfaceName() ,
971                                               _DataFlowEditor ,
972                                               _DataFlowNode ,
973                                               (GraphBase::Port * ) anOutPort ,
974                                               false ,
975                                               anAny ) ;
976           PortableServer::ObjectId * id = myPort->getId() ;
977           CORBA::Object_var obj = _poa->id_to_reference(*id);
978           SUPERV::Port_var iobject ;
979           iobject = SUPERV::Port::_narrow(obj) ;
980           PortCount += 1 ;
981           RetVal->length( PortCount ) ;
982           RetVal[ PortCount - 1 ] = SUPERV::Port::_duplicate( iobject ) ;
983           anOutPort->ObjRef( SUPERV::Port::_duplicate( iobject ) ) ;
984         }
985         else {
986           MESSAGE( "OutPort " << i << " " << anOutPort->PortName() << " of Node " << Name() ) ;
987           PortCount += 1 ;
988           RetVal->length( PortCount ) ;
989           RetVal[ PortCount - 1 ] = SUPERV::Port::_duplicate( anOutPort->ObjRef() ) ;
990         }
991       }
992       else {
993         MESSAGE( "OutPort " << i << " " << anOutPort->PortName() << " of Node " << Name() << " IsDataStream" ) ;
994 //        RetVal[  _DataFlowNode->GetNodeInPortsSize() + i ] = SUPERV::Port::_duplicate( SUPERV::Port::_narrow( CORBA::Object::_nil() ) ) ;
995       }
996     }
997   }
998   else {
999     if ( _DataFlowEditor->IsValid() ) {
1000       RetVal->length( _DataFlowEditor->Graph()->GetNodeInDataNodePortsSize() +
1001                       _DataFlowEditor->Graph()->GetNodeOutDataNodePortsSize() ) ;
1002       for ( i = 0 ; i < _DataFlowEditor->Graph()->GetNodeInDataNodePortsSize() ; i++ ) {
1003         GraphBase::OutPort * anOutPort = _DataFlowEditor->Graph()->GetChangeNodeInDataNodePort(i) ;
1004         if ( !anOutPort->IsDataStream() ) {
1005           if ( CORBA::is_nil( anOutPort->ObjRef() ) ) {
1006             if ( begin ) {
1007               beginService( "CNode_Impl::Ports" );
1008               begin = false ;
1009             }
1010             Port_Impl * myPort ;
1011             if ( anOutPort->IsDataConnected() ) {
1012               const CORBA::Any * anAny = anOutPort->Value() ;
1013               myPort = new Port_Impl( _Orb , _Poa , _ContId ,
1014                                       instanceName() , interfaceName() ,
1015                                       _DataFlowEditor ,
1016                                       _DataFlowNode ,
1017                                       (GraphBase::Port * ) anOutPort ,
1018                                       true ,
1019                                       anAny ) ;
1020             }
1021             else {
1022               myPort = new Port_Impl( _Orb , _Poa , _ContId ,
1023                                       instanceName() , interfaceName() ,
1024                                       _DataFlowEditor ,
1025                                       _DataFlowNode ,
1026                                       (GraphBase::Port * ) anOutPort ,
1027                                       true ) ;
1028             }
1029             PortableServer::ObjectId * id = myPort->getId() ;
1030             CORBA::Object_var obj = _poa->id_to_reference(*id);
1031             SUPERV::Port_var iobject ;
1032             iobject = SUPERV::Port::_narrow(obj) ;
1033             PortCount += 1 ;
1034             RetVal->length( PortCount ) ;
1035             RetVal[ PortCount - 1 ] = SUPERV::Port::_duplicate( iobject ) ;
1036             anOutPort->ObjRef( SUPERV::Port::_duplicate( iobject ) ) ;
1037           }
1038           else {
1039             PortCount += 1 ;
1040             RetVal->length( PortCount ) ;
1041             RetVal[ PortCount - 1 ] = SUPERV::Port::_duplicate( anOutPort->ObjRef() ) ;
1042           }
1043         }
1044         else {
1045 //          RetVal[ i ] = SUPERV::Port::_duplicate( SUPERV::Port::_narrow( CORBA::Object::_nil() ) ) ;
1046         }
1047       }
1048       j = _DataFlowEditor->Graph()->GetNodeInDataNodePortsSize() ;
1049       for ( i = 0 ; i < _DataFlowEditor->Graph()->GetNodeOutDataNodePortsSize() ; i++ ) {
1050         GraphBase::InPort * anInPort = _DataFlowEditor->Graph()->GetChangeNodeOutDataNodePort(i) ;
1051         if ( !anInPort->IsDataStream() ) {
1052           if ( CORBA::is_nil( anInPort->ObjRef() ) ) {
1053             if ( begin ) {
1054               beginService( "CNode_Impl::Ports" );
1055               begin = false ;
1056             }
1057             Port_Impl * myPort ;
1058             if ( anInPort->IsDataConnected() ) {
1059               const CORBA::Any * anAny = anInPort->GetOutPort()->Value() ;
1060               myPort = new Port_Impl( _Orb , _Poa , _ContId ,
1061                                       instanceName() , interfaceName() ,
1062                                       _DataFlowEditor ,
1063                                       _DataFlowNode ,
1064                                       (GraphBase::Port * ) anInPort ,
1065                                       false ,
1066                                       anAny ) ;
1067             }
1068             else {
1069               myPort = new Port_Impl( _Orb , _Poa , _ContId ,
1070                                       instanceName() , interfaceName() ,
1071                                       _DataFlowEditor ,
1072                                       _DataFlowNode ,
1073                                       anInPort ,
1074                                       false ) ;
1075             }
1076             PortableServer::ObjectId * id = myPort->getId() ;
1077             CORBA::Object_var obj = _poa->id_to_reference(*id);
1078             SUPERV::Port_var iobject ;
1079             iobject = SUPERV::Port::_narrow(obj) ;
1080             PortCount += 1 ;
1081             RetVal->length( PortCount ) ;
1082             RetVal[ PortCount - 1 ] = SUPERV::Port::_duplicate( iobject ) ;
1083             anInPort->ObjRef( SUPERV::Port::_duplicate( iobject ) ) ;
1084           }
1085           else {
1086             PortCount += 1 ;
1087             RetVal->length( PortCount ) ;
1088             RetVal[ PortCount - 1 ] = SUPERV::Port::_duplicate( anInPort->ObjRef() ) ;
1089           }
1090         }
1091         else {
1092 //          RetVal[ j + i ] = SUPERV::Port::_duplicate( SUPERV::Port::_narrow( CORBA::Object::_nil() ) ) ;
1093         }
1094       }
1095     }
1096   }
1097 //  int RetVallength = (unsigned int ) RetVal->length() ;
1098 //  for ( i = 0 ; i < RetVallength ; i++ ) {
1099 //    MESSAGE( "Port " << i << " " <<  RetVal[i]->Name() << " of Node " << Name() ) ;
1100 //  }
1101   if ( !begin ) {
1102     endService( "CNode_Impl::Ports " ) ;
1103   }
1104   return ( RetVal._retn() ) ;
1105 }
1106
1107 SUPERV::ListOfStreamPorts * CNode_Impl::StreamPorts() {
1108   bool begin = true ;
1109   int i , j ;
1110   int PortCount = 0 ;
1111   SUPERV::ListOfStreamPorts_var RetVal = new SUPERV::ListOfStreamPorts ;
1112   if ( !DataFlowEditor()->Graph()->IsDataStreamNode() ) {
1113 //    MESSAGE("CNode_Impl::StreamPorts NOT a DataStreamNode" ) ;
1114   }
1115   else if ( _IsNode ) {
1116 //    RetVal->length( _DataFlowNode->GetNodeInPortsSize() +
1117 //                    _DataFlowNode->GetNodeOutPortsSize() ) ;
1118     for ( i = 0 ; i < _DataFlowNode->GetNodeInPortsSize() ; i++ ) {
1119       GraphBase::InPort * anInPort = _DataFlowNode->GetChangeNodeInPort( i ) ;
1120       if ( anInPort->IsDataStream() ) {
1121         if ( begin ) {
1122           beginService( "CNode_Impl::StreamPorts" );
1123           begin = false ;
1124         }
1125         if ( anInPort->IsLoop() || ( anInPort->IsGate() && !anInPort->IsConnected() && 
1126                                      ( _DataFlowEditor->IsExecuting() || _DataFlowEditor->IsReadOnly() ) ) ) {
1127           MESSAGE( "InStreamPort " << i << " " << anInPort->PortName() << " of Node " << Name() << " ignored" ) ;
1128 //          RetVal[ i ] = SUPERV::StreamPort::_duplicate( SUPERV::StreamPort::_narrow( CORBA::Object::_nil() ) ) ;
1129         }
1130         else if ( CORBA::is_nil( anInPort->ObjRef() ) ) {
1131           MESSAGE( "InStreamPort " << i << " " << anInPort->PortName() << " of Node " << Name() << " IsExecuting "
1132                    << _DataFlowEditor->IsExecuting() << " IsGate/IsConnected " << anInPort->IsGate()
1133                    << "/" << anInPort->IsConnected() ) ;
1134           StreamPort_Impl * myStreamPort ;
1135           if ( _DataFlowNode->HasInput( anInPort->PortName() ) ) {
1136             const CORBA::Any * anAny = anInPort->GetOutPort()->Value() ;
1137             myStreamPort = new StreamPort_Impl( _Orb , _Poa , _ContId ,
1138                                     instanceName() , interfaceName() ,
1139                                     _DataFlowEditor ,
1140                                     _DataFlowNode ,
1141                                     (GraphBase::Port * ) anInPort ,
1142                                     true ,
1143                                     anAny ) ;
1144           }
1145           else {
1146             myStreamPort = new StreamPort_Impl( _Orb , _Poa , _ContId ,
1147                                     instanceName() , interfaceName() ,
1148                                     _DataFlowEditor ,
1149                                     _DataFlowNode ,
1150                                     (GraphBase::Port * ) anInPort ,
1151                                     true ) ;
1152           }
1153           PortableServer::ObjectId * id = myStreamPort->getId() ;
1154           CORBA::Object_var obj = _poa->id_to_reference(*id);
1155           SUPERV::StreamPort_var iobject ;
1156           iobject = SUPERV::StreamPort::_narrow(obj) ;
1157           PortCount += 1 ;
1158           RetVal->length( PortCount ) ;
1159           RetVal[ PortCount - 1 ] = SUPERV::StreamPort::_duplicate( iobject ) ;
1160           anInPort->ObjRef( SUPERV::StreamPort::_duplicate( iobject ) ) ;
1161         }
1162         else {
1163           MESSAGE( "InStreamPort " << i << " " << anInPort->PortName() << " of Node " << Name() ) ;
1164           PortCount += 1 ;
1165           RetVal->length( PortCount ) ;
1166           RetVal[ PortCount - 1 ] = SUPERV::StreamPort::_duplicate( SUPERV::StreamPort::_narrow( anInPort->ObjRef() ) ) ;
1167         }
1168       }
1169       else {
1170 //        RetVal[ i ] = SUPERV::StreamPort::_duplicate( SUPERV::StreamPort::_narrow( CORBA::Object::_nil() ) ) ;
1171       }
1172     }
1173     for ( i = 0 ; i < _DataFlowNode->GetNodeOutPortsSize() ; i++ ) {
1174       GraphBase::OutPort * anOutPort = _DataFlowNode->GetChangeNodeOutPort( i ) ;
1175       if ( anOutPort->IsDataStream() ) {
1176         if ( begin ) {
1177           beginService( "CNode_Impl::StreamPorts" );
1178           begin = false ;
1179         }
1180         if ( anOutPort->IsLoop() || ( anOutPort->IsGate() && !anOutPort->IsConnected() &&
1181                                       ( _DataFlowEditor->IsExecuting() || _DataFlowEditor->IsReadOnly() ) ) ) {
1182           MESSAGE( "OutStreamPort " << i << " " << anOutPort->PortName() << " of Node " << Name() << " ignored" ) ;
1183 //          RetVal[ _DataFlowNode->GetNodeInPortsSize() + i ] = SUPERV::StreamPort::_duplicate( SUPERV::StreamPort::_narrow( CORBA::Object::_nil() ) ) ;
1184         }
1185         else if ( CORBA::is_nil( anOutPort->ObjRef() ) ) {
1186           MESSAGE( "OutStreamPort " << i << " " << anOutPort->PortName() << " of Node " << Name() ) ;
1187           const CORBA::Any * anAny = anOutPort->Value() ;
1188           StreamPort_Impl * myStreamPort = new StreamPort_Impl( _Orb , _Poa , _ContId ,
1189                                               instanceName() , interfaceName() ,
1190                                               _DataFlowEditor ,
1191                                               _DataFlowNode ,
1192                                               (GraphBase::Port * ) anOutPort ,
1193                                               false ,
1194                                               anAny ) ;
1195           PortableServer::ObjectId * id = myStreamPort->getId() ;
1196           CORBA::Object_var obj = _poa->id_to_reference(*id);
1197           SUPERV::StreamPort_var iobject ;
1198           iobject = SUPERV::StreamPort::_narrow(obj) ;
1199           PortCount += 1 ;
1200           RetVal->length( PortCount ) ;
1201           RetVal[ PortCount - 1 ] = SUPERV::StreamPort::_duplicate( iobject ) ;
1202           anOutPort->ObjRef( SUPERV::StreamPort::_duplicate( iobject ) ) ;
1203         }
1204         else {
1205           MESSAGE( "OutStreamPort " << i << " " << anOutPort->PortName() << " of Node " << Name() ) ;
1206           PortCount += 1 ;
1207           RetVal->length( PortCount ) ;
1208           RetVal[ PortCount - 1 ] = SUPERV::StreamPort::_duplicate( SUPERV::StreamPort::_narrow( anOutPort->ObjRef() ) ) ;
1209         }
1210       }
1211       else {
1212 //        RetVal[ i ] = SUPERV::StreamPort::_duplicate( SUPERV::StreamPort::_narrow( CORBA::Object::_nil() ) ) ;
1213       }
1214     }
1215   }
1216   else {
1217     if ( _DataFlowEditor->IsValid() ) {
1218 //      RetVal->length( _DataFlowEditor->Graph()->GetNodeInDataNodePortsSize() +
1219 //                      _DataFlowEditor->Graph()->GetNodeOutDataNodePortsSize() ) ;
1220       for ( i = 0 ; i < _DataFlowEditor->Graph()->GetNodeInDataNodePortsSize() ; i++ ) {
1221         GraphBase::OutPort * anOutPort = _DataFlowEditor->Graph()->GetChangeNodeInDataNodePort(i) ;
1222         if ( anOutPort->IsDataStream() ) {
1223           if ( CORBA::is_nil( anOutPort->ObjRef() ) ) {
1224             if ( begin ) {
1225               beginService( "CNode_Impl::StreamPorts" );
1226               begin = false ;
1227             }
1228             StreamPort_Impl * myStreamPort ;
1229             if ( anOutPort->IsDataConnected() ) {
1230               const CORBA::Any * anAny = anOutPort->Value() ;
1231               myStreamPort = new StreamPort_Impl( _Orb , _Poa , _ContId ,
1232                                       instanceName() , interfaceName() ,
1233                                       _DataFlowEditor ,
1234                                       _DataFlowNode ,
1235                                       (GraphBase::Port * ) anOutPort ,
1236                                       true ,
1237                                       anAny ) ;
1238             }
1239             else {
1240               myStreamPort = new StreamPort_Impl( _Orb , _Poa , _ContId ,
1241                                       instanceName() , interfaceName() ,
1242                                       _DataFlowEditor ,
1243                                       _DataFlowNode ,
1244                                       (GraphBase::Port * ) anOutPort ,
1245                                       true ) ;
1246             }
1247             PortableServer::ObjectId * id = myStreamPort->getId() ;
1248             CORBA::Object_var obj = _poa->id_to_reference(*id);
1249             SUPERV::StreamPort_var iobject ;
1250             iobject = SUPERV::StreamPort::_narrow(obj) ;
1251             PortCount += 1 ;
1252             RetVal->length( PortCount ) ;
1253             RetVal[ PortCount - 1 ] = SUPERV::StreamPort::_duplicate( iobject ) ;
1254             anOutPort->ObjRef( SUPERV::StreamPort::_duplicate( iobject ) ) ;
1255           }
1256           else {
1257             PortCount += 1 ;
1258             RetVal->length( PortCount ) ;
1259             RetVal[ PortCount - 1 ] = SUPERV::StreamPort::_duplicate( SUPERV::StreamPort::_narrow( anOutPort->ObjRef() ) ) ;
1260           }
1261         }
1262         else {
1263 //          RetVal[ i ] = SUPERV::StreamPort::_duplicate( SUPERV::StreamPort::_narrow( CORBA::Object::_nil() ) ) ;
1264         }
1265       }
1266       j = _DataFlowEditor->Graph()->GetNodeInDataNodePortsSize() ;
1267       for ( i = 0 ; i < _DataFlowEditor->Graph()->GetNodeOutDataNodePortsSize() ; i++ ) {
1268         GraphBase::InPort * anInPort = _DataFlowEditor->Graph()->GetChangeNodeOutDataNodePort(i) ;
1269         if ( anInPort->IsDataStream() ) {
1270           if ( CORBA::is_nil( anInPort->ObjRef() ) ) {
1271             if ( begin ) {
1272               beginService( "CNode_Impl::StreamPorts" );
1273               begin = false ;
1274             }
1275             StreamPort_Impl * myStreamPort ;
1276             if ( anInPort->IsDataConnected() ) {
1277               const CORBA::Any * anAny = anInPort->GetOutPort()->Value() ;
1278               myStreamPort = new StreamPort_Impl( _Orb , _Poa , _ContId ,
1279                                       instanceName() , interfaceName() ,
1280                                       _DataFlowEditor ,
1281                                       _DataFlowNode ,
1282                                       (GraphBase::Port * ) anInPort ,
1283                                       false ,
1284                                       anAny ) ;
1285             }
1286             else {
1287               myStreamPort = new StreamPort_Impl( _Orb , _Poa , _ContId ,
1288                                       instanceName() , interfaceName() ,
1289                                       _DataFlowEditor ,
1290                                       _DataFlowNode ,
1291                                       anInPort ,
1292                                       false ) ;
1293             }
1294             PortableServer::ObjectId * id = myStreamPort->getId() ;
1295             CORBA::Object_var obj = _poa->id_to_reference(*id);
1296             SUPERV::StreamPort_var iobject ;
1297             iobject = SUPERV::StreamPort::_narrow(obj) ;
1298             PortCount += 1 ;
1299             RetVal->length( PortCount ) ;
1300             RetVal[ PortCount - 1 ] = SUPERV::StreamPort::_duplicate( iobject ) ;
1301             anInPort->ObjRef( SUPERV::StreamPort::_duplicate( iobject ) ) ;
1302           }
1303           else {
1304             PortCount += 1 ;
1305             RetVal->length( PortCount ) ;
1306             RetVal[ PortCount - 1 ] = SUPERV::StreamPort::_duplicate( SUPERV::StreamPort::_narrow( anInPort->ObjRef() ) ) ;
1307           }
1308         }
1309         else {
1310 //          RetVal[ i ] = SUPERV::StreamPort::_duplicate( SUPERV::StreamPort::_narrow( CORBA::Object::_nil() ) ) ;
1311         }
1312       }
1313     }
1314   }
1315 //  int RetVallength = (unsigned int ) RetVal->length() ;
1316 //  for ( i = 0 ; i < RetVallength ; i++ ) {
1317 //    MESSAGE( "StreamPort " << i << " " <<  RetVal[i]->Name() << " of Node " << Name() ) ;
1318 //  }
1319   if ( !begin ) {
1320     endService( "CNode_Impl::StreamPorts " ) ;
1321   }
1322   return ( RetVal._retn() ) ;
1323 }
1324
1325 SUPERV::ListOfLinks * CNode_Impl::Links() {
1326   beginService( "CNode_Impl::Links" ) ;
1327   SUPERV::ListOfLinks_var RetVal = new SUPERV::ListOfLinks ;
1328   if ( _DataFlowNode ) {
1329     RetVal = DataFlowEditor()->Graph()->ObjImpl()->Links( _DataFlowNode->ComputingNode() , NULL ) ;
1330   }
1331   else {
1332     RetVal = DataFlowEditor()->Graph()->ObjImpl()->Links( NULL , NULL ) ;
1333   }
1334   MESSAGE( "CNode_Impl::Links " << RetVal->length() << " Links" ) ;
1335   endService( "CNode_Impl::Links" ) ;
1336   return ( RetVal._retn() ) ;
1337 }
1338
1339 SUPERV::ListOfStreamLinks * CNode_Impl::StreamLinks() {
1340   beginService( "CNode_Impl::StreamLinks" ) ;
1341   SUPERV::ListOfStreamLinks_var RetVal = new SUPERV::ListOfStreamLinks ;
1342   if ( _DataFlowNode && DataFlowEditor()->Graph()->IsDataStreamNode() ) {
1343     RetVal = ((StreamGraph_Impl *) (DataFlowEditor()->StreamGraph()->ObjImpl()))->StreamLinks( _DataFlowNode->ComputingNode() , NULL ) ;
1344   }
1345   else if ( DataFlowEditor()->Graph()->IsDataStreamNode() ) {
1346     RetVal = ((StreamGraph_Impl *) (DataFlowEditor()->StreamGraph()->ObjImpl()))->StreamLinks( NULL , NULL ) ;
1347   }
1348   MESSAGE( "CNode_Impl::StreamLinks " << RetVal->length() << " StreamLinks" ) ;
1349   endService( "CNode_Impl::StreamLinks" ) ;
1350   return ( RetVal._retn() ) ;
1351 }
1352
1353 long CNode_Impl::SubGraph() {
1354 //  beginService( "CNode_Impl::SubGraph" );
1355   long RetVal = 0 ;
1356   if ( _IsNode ) {
1357     RetVal = _DataFlowNode->SubGraph() ;
1358   }
1359 //  endService( "CNode_Impl::SubGraph" );
1360   return RetVal ;
1361 }
1362
1363 long CNode_Impl::SubStreamGraph() {
1364 //  beginService( "CNode_Impl::SubStreamGraph" );
1365   long RetVal = 0 ;
1366   if ( _IsNode ) {
1367     RetVal = _DataFlowNode->SubStreamGraph() ;
1368   }
1369 //  endService( "CNode_Impl::SubStreamGraph" );
1370   return RetVal ;
1371 }
1372
1373 bool CNode_Impl::IsLinked(const char * ServiceParameterName ) {
1374   beginService( "CNode_Impl::IsLinked" );
1375   bool RetVal = _DataFlowNode->IsLinked( ServiceParameterName ) ;
1376   MESSAGE( Name() << "->IsLinked( '" << ServiceParameterName << "' )" ) ;
1377   endService( "CNode_Impl::IsLinked" );
1378   return RetVal ;
1379 }
1380
1381 bool CNode_Impl::HasInput(const char * ServiceParameterName ) {
1382 //  beginService( "CNode_Impl::HasInput" );
1383   bool RetVal = _DataFlowNode->HasInput( ServiceParameterName ) ;
1384 //  endService( "CNode_Impl::HasInput" );
1385   return RetVal ;
1386 }
1387
1388 SUPERV::GraphState CNode_Impl::State() {
1389 //  beginService( "CNode_Impl::State" );
1390   SUPERV::GraphState RetVal = SUPERV::EditingState ;
1391   GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1392   if ( _DataFlowExecutor && !_DataFlowEditor->EditedAfterExecution() ) {
1393     //JR : 12/06/03  if ( _DataFlowExecutor ) {
1394     if ( _IsNode ) {
1395       RetVal = _DataFlowExecutor->State( Name() ) ;
1396     }
1397     else {
1398       RetVal = _DataFlowExecutor->State() ;
1399     }
1400   }
1401 //  endService( "CNode_Impl::State" );
1402   return RetVal ;
1403 }
1404 long CNode_Impl::Thread() {
1405 //  beginService( "CNode_Impl::Thread" );
1406   long RetVal = 0 ;
1407   GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1408   if ( _DataFlowExecutor ) {
1409     if ( _IsNode ) {
1410       RetVal = _DataFlowExecutor->Thread( Name() ) ;
1411     }
1412     else {
1413       RetVal = _DataFlowExecutor->Thread() ;
1414     }
1415   }
1416 //  endService( "CNode_Impl::Thread" );
1417   return RetVal ;
1418 }
1419 SUPERV::AutomatonState CNode_Impl::AutoState() {
1420 //  beginService( "CNode_Impl::AutoState" );
1421   SUPERV::AutomatonState RetVal = SUPERV::UnKnownState ;
1422   GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1423   if ( _DataFlowExecutor ) {
1424     if ( _IsNode ) {
1425       RetVal = _DataFlowExecutor->AutomatonState( Name() ) ;
1426     }
1427     else {
1428       RetVal = _DataFlowExecutor->AutomatonState() ;
1429     }
1430   }
1431 //  endService( "CNode_Impl::AutoState" );
1432   return RetVal ;
1433 }
1434 SUPERV::ControlState CNode_Impl::Control() {
1435 //  beginService( "CNode_Impl::Control" );
1436   SUPERV::ControlState RetVal = SUPERV::VoidState ;
1437   GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1438   if ( _DataFlowExecutor ) {
1439     if ( _IsNode ) {
1440       RetVal = _DataFlowExecutor->ControlState( Name() ) ;
1441     }
1442     else {
1443       RetVal = _DataFlowExecutor->ControlState() ;
1444     }
1445   }
1446 //  endService( "CNode_Impl::Control" );
1447   return RetVal ;
1448 }
1449 void CNode_Impl::ControlClear() {
1450 //  beginService( "CNode_Impl::ControlClear" );
1451 //  SUPERV::ControlState RetVal = SUPERV::VoidState ;
1452   GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1453   if ( _DataFlowExecutor ) {
1454     if ( _IsNode ) {
1455       _DataFlowExecutor->ControlClear( Name() ) ;
1456     }
1457     else {
1458       _DataFlowExecutor->ControlClear() ;
1459     }
1460   }
1461 //  endService( "CNode_Impl::ControlClear" );
1462   return ;
1463 }
1464
1465 bool CNode_Impl::IsReady() {
1466 //  beginService( "CNode_Impl::IsReady" );
1467   bool RetVal = false ;
1468   GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1469   if ( _DataFlowExecutor ) {
1470     if ( _IsNode ) {
1471       RetVal = _DataFlowExecutor->IsReady( Name() ) ;
1472     }
1473     else {
1474       RetVal = _DataFlowExecutor->IsReady() ;
1475     }
1476   }
1477 //  endService( "CNode_Impl::IsReady" );
1478   return RetVal ;
1479 }
1480
1481 bool CNode_Impl::IsWaiting() {
1482 //  beginService( "CNode_Impl::IsWaiting" );
1483   bool RetVal = false ;
1484   GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1485   if ( _DataFlowExecutor ) {
1486     if ( _IsNode ) {
1487       RetVal = _DataFlowExecutor->IsWaiting( Name() ) ;
1488     }
1489     else {
1490       RetVal = _DataFlowExecutor->IsWaiting() ;
1491     }
1492   }
1493 //  endService( "CNode_Impl::IsWaiting" );
1494   return RetVal ;
1495 }
1496
1497 bool CNode_Impl::IsRunning() {
1498 //  beginService( "CNode_Impl::IsRunning" );
1499   bool RetVal = false ;
1500   GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1501   if ( _DataFlowExecutor ) {
1502     if ( _IsNode ) {
1503       RetVal = _DataFlowExecutor->IsRunning( Name() ) ;
1504     }
1505     else {
1506       RetVal = _DataFlowExecutor->IsRunning() ;
1507     }
1508   }
1509 //  endService( "CNode_Impl::IsRunning" );
1510   return RetVal ;
1511 }
1512
1513 bool CNode_Impl::IsDone() {
1514 //  beginService( "CNode_Impl::IsDone" );
1515   bool RetVal = false ;
1516   GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1517   if ( _DataFlowExecutor ) {
1518     if ( _IsNode ) {
1519       RetVal = _DataFlowExecutor->IsDone( Name() ) ;
1520     }
1521     else {
1522       RetVal = _DataFlowExecutor->IsDone() ;
1523     }
1524   }
1525 //  endService( "CNode_Impl::IsDone" );
1526   return RetVal ;
1527 }
1528
1529 bool CNode_Impl::IsSuspended() {
1530 //  beginService( "CNode_Impl::IsSuspended" );
1531   bool RetVal = false ;
1532   GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1533   if ( _DataFlowExecutor ) {
1534     if ( _IsNode ) {
1535       RetVal = _DataFlowExecutor->IsSuspended( Name() ) ;
1536     }
1537     else {
1538       RetVal = _DataFlowExecutor->IsSuspended() ;
1539     }
1540   }
1541 //  endService( "CNode_Impl::IsSuspended" );
1542   return RetVal ;
1543 }
1544
1545 bool CNode_Impl::ReadyW() {
1546 //  beginService( "CNode_Impl::ReadyW" );
1547   bool RetVal = false ;
1548   GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1549   if ( _DataFlowExecutor ) {
1550     if ( _IsNode ) {
1551       RetVal = _DataFlowExecutor->ReadyWait( Name() ) ;
1552     }
1553     else {
1554       RetVal = _DataFlowExecutor->ReadyWait() ;
1555     }
1556   }
1557 //  endService( "CNode_Impl::ReadyW" );
1558   return RetVal ;
1559 }
1560
1561 bool CNode_Impl::RunningW() {
1562 //  beginService( "CNode_Impl::RunningW" );
1563   bool RetVal = false ;
1564   GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1565   if ( _DataFlowExecutor ) {
1566     if ( _IsNode ) {
1567       RetVal = _DataFlowExecutor->RunningWait( Name() ) ;
1568     }
1569     else {
1570       RetVal = _DataFlowExecutor->RunningWait() ;
1571     }
1572   }
1573 //  endService( "CNode_Impl::RunningW" );
1574   return RetVal ;
1575 }
1576
1577 bool CNode_Impl::DoneW() {
1578 //  beginService( "CNode_Impl::DoneW" );
1579   bool RetVal = false ;
1580   GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1581   if ( _DataFlowExecutor ) {
1582     if ( _IsNode ) {
1583       RetVal = _DataFlowExecutor->DoneWait( Name() ) ;
1584     }
1585     else {
1586       RetVal = _DataFlowExecutor->DoneWait() ;
1587     }
1588   }
1589 //  endService( "CNode_Impl::DoneW" );
1590   return RetVal ;
1591 }
1592
1593 bool CNode_Impl::SuspendedW() {
1594 //  beginService( "CNode_Impl::SuspendedW" );
1595   bool RetVal = false ;
1596   GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1597   if ( _DataFlowExecutor ) {
1598     if ( _IsNode ) {
1599       RetVal = _DataFlowExecutor->SuspendedWait( Name() ) ;
1600     }
1601     else {
1602       RetVal = _DataFlowExecutor->SuspendedWait() ;
1603     }
1604   }
1605 //  endService( "CNode_Impl::SuspendedW" );
1606   return RetVal ;
1607 }
1608
1609 void CNode_Impl::ping() {
1610 //  beginService( "CNode_Impl::ping" );
1611   bool RetVal = false ;
1612   GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1613   if ( _DataFlowExecutor ) {
1614     if ( _IsNode ) {
1615       RetVal = _DataFlowExecutor->Ping( Name() ) ;
1616     }
1617     else {
1618       RetVal = false ;
1619     }
1620   }
1621 //  endService( "CNode_Impl::ping" );
1622   return ;
1623 }
1624
1625 bool CNode_Impl::ContainerKill() {
1626   beginService( "CNode_Impl::ContainerKill" );
1627   bool RetVal = false ;
1628   GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1629   if ( _DataFlowExecutor && _DataFlowEditor->IsExecuting() ) {
1630     if ( _IsNode ) {
1631       RetVal = _DataFlowExecutor->ContainerKill( Name() ) ;
1632     }
1633     else {
1634       RetVal = _DataFlowExecutor->ContainerKill() ;
1635     }
1636   }
1637   endService( "CNode_Impl::ContainerKill" );
1638   return RetVal ;
1639 }
1640 bool CNode_Impl::Kill() {
1641 //  beginService( "CNode_Impl::Kill" );
1642   bool RetVal = false ;
1643   GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1644   if ( _DataFlowExecutor ) {
1645     if ( _IsNode ) {
1646       RetVal = _DataFlowExecutor->Kill( Name() ) ;
1647     }
1648     else {
1649       RetVal = _DataFlowExecutor->Kill() ;
1650     }
1651   }
1652 //  endService( "CNode_Impl::Kill" );
1653   return RetVal ;
1654 }
1655 bool CNode_Impl::KillDone() {
1656 //  beginService( "CNode_Impl::KillDone" );
1657   bool RetVal = false ;
1658   GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1659   if ( _DataFlowExecutor ) {
1660     if ( _IsNode ) {
1661       RetVal = _DataFlowExecutor->KillDone( Name() ) ;
1662     }
1663   }
1664 //  endService( "CNode_Impl::KillDone" );
1665   return RetVal ;
1666 }
1667 bool CNode_Impl::Stop() {
1668 //  beginService( "CNode_Impl::Stop" );
1669   bool RetVal ; // = _DataFlowExecutor->Stop() ;
1670 //  endService( "CNode_Impl::Stop" );
1671   return RetVal ;
1672 }
1673 bool CNode_Impl::Suspend() {
1674 //  beginService( "CNode_Impl::Suspend" );
1675   bool RetVal = false ;
1676   GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1677   if ( _DataFlowExecutor ) {
1678     if ( _IsNode ) {
1679       RetVal = _DataFlowExecutor->Suspend( Name() ) ;
1680     }
1681     else {
1682       RetVal = _DataFlowExecutor->Suspend() ;
1683     }
1684   }
1685 //  endService( "CNode_Impl::Suspend" );
1686   return RetVal ;
1687 }
1688 bool CNode_Impl::SuspendDone() {
1689 //  beginService( "CNode_Impl::SuspendDone" );
1690   bool RetVal = false ;
1691   GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1692   if ( _DataFlowExecutor ) {
1693     if ( _IsNode ) {
1694       RetVal = _DataFlowExecutor->SuspendDone( Name() ) ;
1695     }
1696     else {
1697       RetVal = _DataFlowExecutor->SuspendDone() ;
1698     }
1699   }
1700 //  endService( "CNode_Impl::SuspendDone" );
1701   return RetVal ;
1702 }
1703 bool CNode_Impl::Resume() {
1704 //  beginService( "CNode_Impl::Resume" );
1705   bool RetVal = false ;
1706   GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1707   if ( _DataFlowExecutor ) {
1708     if ( _IsNode ) {
1709       RetVal = _DataFlowExecutor->Resume( Name() ) ;
1710     }
1711     else {
1712       RetVal = _DataFlowExecutor->Resume() ;
1713     }
1714   }
1715 //  endService( "CNode_Impl::Resume" );
1716   return RetVal ;
1717 }
1718
1719 bool CNode_Impl::Run() {
1720   beginService( "CNode_Impl::Run" );
1721   bool RetVal = false ;
1722   GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1723   if ( _DataFlowExecutor ) {
1724     _DataFlowEditor->EditedAfterExecution( false ) ;
1725     if ( _IsNode ) {
1726       RetVal = _DataFlowExecutor->Run( Name() , Name() , false ) ;
1727     }
1728     else {
1729       RetVal = _DataFlowExecutor->Run( false ) ;
1730     }
1731   }
1732   endService( "CNode_Impl::Run" );
1733   return RetVal ;
1734 }
1735
1736 bool CNode_Impl::ReRun() {
1737   beginService( "CNode_Impl::ReRun" );
1738   bool RetVal = false ;
1739   GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1740   if ( _DataFlowExecutor ) {
1741     _DataFlowEditor->EditedAfterExecution( false ) ;
1742     if ( _IsNode ) {
1743       RetVal = _DataFlowExecutor->Run( Name() , Name() , false ) ;
1744     }
1745     else if ( DataFlowEditor()->IsEditing() ) {
1746       //      RetVal = _DataFlowExecutor->Run( false ) ;
1747       return ((Graph_Impl::Graph_Impl *) this)->Graph_Impl::Run() ;
1748     }
1749   }
1750   endService( "CNode_Impl::ReRun" );
1751   return RetVal ;
1752 }
1753
1754 bool CNode_Impl::ReRunAt( const char * aNodeName ) {
1755   beginService( "CNode_Impl::ReRunAt" );
1756   bool RetVal = false ;
1757   GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1758   if ( _DataFlowExecutor ) {
1759     _DataFlowEditor->EditedAfterExecution( false ) ;
1760     if ( _IsNode ) {
1761       RetVal = _DataFlowExecutor->Run( Name() , aNodeName , false ) ;
1762     }
1763   }
1764   endService( "CNode_Impl::ReRunAt" );
1765   return RetVal ;
1766 }
1767
1768 bool CNode_Impl::ReStart() {
1769   beginService( "CNode_Impl::ReStart" );
1770   bool RetVal = false ;
1771   GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1772   if ( _DataFlowExecutor ) {
1773     if ( _IsNode ) {
1774       RetVal = _DataFlowExecutor->Run( Name() , Name() , true ) ;
1775     }
1776     else {
1777       RetVal = _DataFlowExecutor->Run( true ) ;
1778     }
1779   }
1780   endService( "CNode_Impl::ReStart" );
1781   return RetVal ;
1782 }
1783
1784 bool CNode_Impl::ReStartAt( const char * aNodeName ) {
1785   beginService( "CNode_Impl::ReStartAt" );
1786   bool RetVal = false ;
1787   GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1788   if ( _DataFlowExecutor ) {
1789     if ( _IsNode ) {
1790       RetVal = _DataFlowExecutor->Run( Name() , aNodeName , true ) ;
1791     }
1792   }
1793   endService( "CNode_Impl::ReStartAt" );
1794   return RetVal ;
1795 }
1796
1797 long CNode_Impl::CpuUsed() {
1798   long RetVal = 0 ;
1799   GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1800   if ( _DataFlowExecutor ) {
1801     if ( _IsNode ) {
1802       RetVal = _DataFlowExecutor->CpuUsed( Name() ) ;
1803     }
1804     else {
1805       RetVal = _DataFlowExecutor->CpuUsed() ;
1806     }
1807   }
1808   return RetVal ;
1809 }
1810
1811