Salome HOME
860dd16a33e58d9d57c3b47c329550cfd35955f2
[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 "Graph_Impl.hxx"
21
22 #include "CNode_Impl.hxx"
23
24 #include "Port_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   _Orb = CORBA::ORB::_duplicate(orb);
146   _Poa = poa ;
147   _ContId = contId ;
148   _DataFlowEditor = DataFlowEditor ;
149   _DataFlowNode = DataFlowNode ;
150   _IsNode = true ;
151   endService( "CNode_Impl::CNode_Impl" );  
152 }
153
154 CNode_Impl::~CNode_Impl() {
155   beginService( "CNode_Impl::~CNode_Impl" );
156   endService( "CNode_Impl::~CNode_Impl" );
157 }
158
159 void CNode_Impl::destroy() {
160   beginService( "CNode_Impl::Destroy" );
161   if ( _DataFlowEditor->IsEditing() ) {
162     if ( Delete() ) {
163       _DataFlowNode = NULL ;
164       _poa->deactivate_object(*_id) ;
165       CORBA::release(_poa) ;
166       delete(_id) ;
167       _thisObj->_remove_ref();
168     }
169   }
170   endService( "CNode_Impl::Destroy" );
171 }
172
173 bool CNode_Impl::Delete() {
174   beginService( "CNode_Impl::Delete" );
175   bool RetVal = false ;
176   if ( _DataFlowEditor->IsEditing() ) {
177     RetVal = _DataFlowEditor->RemoveNode( Name() ) ;
178     if ( RetVal )
179       RetVal = _DataFlowEditor->IsValid() ;
180   }
181   endService( "CNode_Impl::Delete" );
182   return RetVal ;
183 }
184
185 SALOME_ModuleCatalog::Service * CNode_Impl::Service() {
186 //  beginService( "CNode_Impl::Service" );
187   SALOME_ModuleCatalog::Service * RetVal ;
188   if ( _IsNode ) {
189     RetVal = new SALOME_ModuleCatalog::Service( *_DataFlowNode->GetService() ) ;
190   }
191   else {
192     RetVal = new SALOME_ModuleCatalog::Service( *_DataFlowEditor->GetService() ) ;
193   }
194 //  endService( "CNode_Impl::Service" );
195   return RetVal ;
196 }
197
198 char * CNode_Impl::Name() {
199 //  beginService( "CNode_Impl::Name" );
200   char * RetVal = NULL ;
201   if ( _IsNode ) {
202     RetVal = _DataFlowNode->Name() ;
203   }
204   else {
205    RetVal = _DataFlowEditor->Name() ;
206   }
207 //  endService( "CNode_Impl::Name" );
208   return CORBA::string_dup( RetVal );
209 }
210 bool CNode_Impl::SetName( const char * aDataFlowName ) {
211 //  beginService( "CNode_Impl::SetName" );
212   bool RetVal = false ;
213   if ( _DataFlowEditor->IsEditing() ) {
214     if ( _IsNode ) {
215       RetVal = _DataFlowEditor->ReNameNode( _DataFlowNode->Name() ,
216                                             aDataFlowName ) ;
217     }
218     else {
219      RetVal = _DataFlowEditor->Name( aDataFlowName ) ;
220     }
221   }
222 //  endService( "CNode_Impl::SetName" );
223   return RetVal ;
224 }
225 SUPERV::KindOfNode CNode_Impl::Kind() {
226 //  beginService( "CNode_Impl::Kind" );
227   SUPERV::KindOfNode RetVal = SUPERV::UnknownNode ;
228   if ( _IsNode ) {
229     RetVal = _DataFlowNode->Kind() ;
230   }
231   else {
232     RetVal = _DataFlowEditor->Kind() ;
233   }
234 //  endService( "CNode_Impl::Kind" );
235   return RetVal ;
236 }
237 bool CNode_Impl::IsGraph() {
238 //  beginService( "CNode_Impl::IsGraph" );
239   bool RetVal = false ;
240   if ( _IsNode ) {
241     RetVal = _DataFlowNode->IsDataFlowNode() ;
242   }
243   else {
244     RetVal = _DataFlowEditor->IsDataFlowNode() ;
245   }
246 //  endService( "CNode_Impl::IsGraph" );
247   return RetVal ;
248 }
249 bool CNode_Impl::IsComputing() {
250 //  beginService( "CNode_Impl::IsComputing" );
251   bool RetVal = SUPERV::UnknownNode ;
252   if ( _IsNode ) {
253     RetVal = _DataFlowNode->IsComputingNode() ;
254   }
255   else {
256     RetVal = _DataFlowEditor->IsComputingNode() ;
257   }
258 //  endService( "CNode_Impl::IsComputing" );
259   return RetVal ;
260 }
261 bool CNode_Impl::IsFactory() {
262 //  beginService( "CNode_Impl::IsFactory" );
263   bool RetVal = SUPERV::UnknownNode ;
264   if ( _IsNode ) {
265     RetVal = _DataFlowNode->IsFactoryNode() ;
266   }
267   else {
268     RetVal = _DataFlowEditor->IsFactoryNode() ;
269   }
270 //  endService( "CNode_Impl::IsFactory" );
271   return RetVal ;
272 }
273 bool CNode_Impl::IsInLine() {
274 //  beginService( "CNode_Impl::IsInLine" );
275   bool RetVal = SUPERV::UnknownNode ;
276   if ( _IsNode ) {
277     RetVal = _DataFlowNode->IsInLineNode() ;
278   }
279   else {
280     RetVal = _DataFlowEditor->IsInLineNode() ;
281   }
282 //  endService( "CNode_Impl::IsInLine" );
283   return RetVal ;
284 }
285 bool CNode_Impl::IsGOTO() {
286 //  beginService( "CNode_Impl::IsGOTO" );
287   bool RetVal = SUPERV::UnknownNode ;
288   if ( _IsNode ) {
289     RetVal = _DataFlowNode->IsGOTONode() ;
290   }
291   else {
292     RetVal = _DataFlowEditor->IsGOTONode() ;
293   }
294 //  endService( "CNode_Impl::IsGOTO" );
295   return RetVal ;
296 }
297 bool CNode_Impl::IsLoop() {
298 //  beginService( "CNode_Impl::IsLoop" );
299   bool RetVal = SUPERV::UnknownNode ;
300   if ( _IsNode ) {
301     RetVal = _DataFlowNode->IsLoopNode() ;
302   }
303   else {
304     RetVal = _DataFlowEditor->IsLoopNode() ;
305   }
306 //  endService( "CNode_Impl::IsLoop" );
307   return RetVal ;
308 }
309 bool CNode_Impl::IsEndLoop() {
310 //  beginService( "CNode_Impl::IsEndLoop" );
311   bool RetVal = SUPERV::UnknownNode ;
312   if ( _IsNode ) {
313     RetVal = _DataFlowNode->IsEndLoopNode() ;
314   }
315   else {
316     RetVal = _DataFlowEditor->IsEndLoopNode() ;
317   }
318 //  endService( "CNode_Impl::IsEndLoop" );
319   return RetVal ;
320 }
321 bool CNode_Impl::IsSwitch() {
322 //  beginService( "CNode_Impl::IsSwitch" );
323   bool RetVal = SUPERV::UnknownNode ;
324   if ( _IsNode ) {
325     RetVal = _DataFlowNode->IsSwitchNode() ;
326   }
327   else {
328     RetVal = _DataFlowEditor->IsSwitchNode() ;
329   }
330 //  endService( "CNode_Impl::IsSwitch" );
331   return RetVal ;
332 }
333 bool CNode_Impl::IsEndSwitch() {
334 //  beginService( "CNode_Impl::IsEndSwitch" );
335   bool RetVal = SUPERV::UnknownNode ;
336   if ( _IsNode ) {
337     RetVal = _DataFlowNode->IsEndSwitchNode() ;
338   }
339   else {
340     RetVal = _DataFlowEditor->IsEndSwitchNode() ;
341   }
342 //  endService( "CNode_Impl::IsEndSwitch" );
343   return RetVal ;
344 }
345
346 SUPERV::SDate CNode_Impl::CreationDate() {
347 //  beginService( "CNode_Impl::CreationDate" );
348   SUPERV::SDate_var RetVal ;
349   if ( _IsNode ) {
350     RetVal = new SUPERV::SDate( _DataFlowNode->FirstCreation() ) ;
351   }
352   else {
353 //    cout << " CNode_Impl::CreationDate " << _DataFlowEditor->FirstCreation()
354 //         << endl ;
355     RetVal = new SUPERV::SDate( _DataFlowEditor->FirstCreation() ) ;
356   }
357 //  endService( "CNode_Impl::CreationDate" );
358   return (RetVal._retn()) ;
359 }
360 SUPERV::SDate CNode_Impl::LastUpdateDate() {
361 //  beginService( "CNode_Impl::LastUpdateDate" );
362   SUPERV::SDate_var RetVal ;
363   if ( _IsNode ) {
364     RetVal = new SUPERV::SDate( _DataFlowNode->LastModification() ) ;
365   }
366   else {
367     RetVal = new SUPERV::SDate( _DataFlowEditor->LastModification() ) ;
368   }
369 //  endService( "CNode_Impl::LastUpdateDate" );
370   return  (RetVal._retn()) ;
371 }
372 char * CNode_Impl::Version() {
373 //  beginService( "CNode_Impl::Version" );
374   char * RetVal ;
375   if ( _IsNode ) {
376     RetVal = _DataFlowNode->EditorRelease() ;
377   }
378   else {
379     RetVal = _DataFlowEditor->EditorRelease() ;
380   }
381 //  endService( "CNode_Impl::Version" );
382   return CORBA::string_dup( RetVal ) ;
383 }
384 char * CNode_Impl::Author() {
385 //  beginService( "CNode_Impl::Author" );
386   char * RetVal ;
387   if ( _IsNode ) {
388     RetVal = _DataFlowNode->Author() ;
389   }
390   else {
391     RetVal = _DataFlowEditor->Author() ;
392   }
393 //  endService( "CNode_Impl::Author" );
394   return CORBA::string_dup( RetVal ) ;
395 }
396 bool CNode_Impl::SetAuthor( const char * aDataFlowAuthor ) {
397 //  beginService( "CNode_Impl::SetAuthor" );
398   bool RetVal = false ;
399   if ( _DataFlowEditor->IsEditing() ) {
400     if ( _IsNode ) {
401       RetVal = _DataFlowNode->Author( aDataFlowAuthor ) ;
402     }
403     else {
404       RetVal = _DataFlowEditor->Author( aDataFlowAuthor ) ;
405     }
406   }
407 //  endService( "CNode_Impl::SetAuthor" );
408   return RetVal ;
409 }
410 char * CNode_Impl::Comment() {
411 //  beginService( "CNode_Impl::Comment" );
412   char * RetVal ;
413   if ( _IsNode ) {
414     RetVal = _DataFlowNode->Comment() ;
415   }
416   else {
417     RetVal = _DataFlowEditor->Comment() ;
418   }
419 //  endService( "CNode_Impl::Comment" );
420   return CORBA::string_dup( RetVal ) ;
421 }
422 bool CNode_Impl::SetComment( const char * aDataFlowComment ) {
423 //  beginService( "CNode_Impl::SetComment" );
424   bool RetVal = false ;
425   if ( _DataFlowEditor->IsEditing() ) {
426     if ( _IsNode ) {
427       RetVal = _DataFlowNode->Comment( aDataFlowComment ) ;
428     }
429     else {
430       RetVal = _DataFlowEditor->Comment( aDataFlowComment ) ;
431     }
432   }
433 //  endService( "CNode_Impl::SetComment" );
434   return RetVal ;
435 }
436
437 SUPERV::ListOfLinks * CNode_Impl::Links() {
438   beginService( "CNode_Impl::Links" ) ;
439   SUPERV::ListOfLinks_var RetVal = new SUPERV::ListOfLinks ;
440   if ( _DataFlowNode ) {
441     RetVal = DataFlowEditor()->ObjImpl()->Links( _DataFlowNode->ComputingNode() , NULL ) ;
442   }
443   endService( "CNode_Impl::Links" ) ;
444   return ( RetVal._retn() ) ;
445 }
446
447 void CNode_Impl::Coords(long X , long Y ) {
448 //  beginService( "CNode_Impl::Coords" );
449   if ( _DataFlowEditor->IsEditing() ) {
450     if ( _IsNode ) {
451       ((GraphEditor::InNode *) _DataFlowNode)->Coordinates( X , Y ) ;
452     }
453     else {
454       _DataFlowEditor->Coordinates( X , Y ) ;
455     }
456   }
457 //  endService( "CNode_Impl::Coords" );
458 }
459 long CNode_Impl::X() {
460 //  beginService( "CNode_Impl::X" );
461   long RetVal ;
462   if ( _IsNode ) {
463     RetVal = _DataFlowNode->XCoordinate() ;
464   }
465   else {
466 //    RetVal = _DataFlowEditor->XCoordinate() ;
467     RetVal = 0 ;
468   }
469 //  endService( "CNode_Impl::X" );
470   return RetVal ;
471 }
472 long CNode_Impl::Y() {
473 //  beginService( "CNode_Impl::Y" );
474   long RetVal ;
475   if ( _IsNode ) {
476     RetVal = _DataFlowNode->YCoordinate() ;
477   }
478   else {
479 //    RetVal = _DataFlowEditor->YCoordinate() ;
480     RetVal = 0 ;
481   }
482 //  endService( "CNode_Impl::Y" );
483   return RetVal ;
484 }
485
486 #if 0
487 SUPERV::Link_ptr CNode_Impl::Link( const char * ToServiceParameterName ,
488                                    const SUPERV::Value_ptr aValue ) {
489   beginService( "CNode_Impl::Link" );
490   Link_Impl * myLink = new Link_Impl( _Orb , _Poa , _ContId ,
491                                       instanceName() , interfaceName() ,
492                                       _DataFlowEditor ,
493                                       _DataFlowNode ,
494                                       ToServiceParameterName ,
495                                       aValue ) ;
496   PortableServer::ObjectId * id = myLink->getId() ;
497   CORBA::Object_var obj = _poa->id_to_reference(*id);
498   SUPERV::Link_var iobject ;
499   iobject = SUPERV::Link::_narrow(obj) ;
500   endService( "CNode_Impl::Link" );
501   return SUPERV::Link::_duplicate( iobject ) ;
502 }
503 #endif
504
505 SUPERV::Port_ptr CNode_Impl::Port( const char * ServiceParameterName ) {
506   bool begin = true ;
507   Port_Impl * myPort = NULL ;
508   SUPERV::Port_var iobject = SUPERV::Port::_nil() ;
509   bool aninport ;
510   if ( _IsNode ) {
511     aninport = _DataFlowNode->GetInPort( ServiceParameterName ) ;
512   }
513   else {
514     aninport = _DataFlowEditor->GetInPort( ServiceParameterName ) ;
515   }  
516   bool anoutport ;
517   if ( _IsNode ) {
518     anoutport = _DataFlowNode->GetOutPort( ServiceParameterName ) ;
519   }
520   else {
521     anoutport = _DataFlowEditor->GetOutPort( ServiceParameterName ) ;
522   }  
523   if ( aninport ) {
524     GraphBase::InPort * anInPort ;
525     if ( _IsNode ) {
526       anInPort = _DataFlowNode->GetChangeInPort( ServiceParameterName ) ;
527     }
528     else {
529       anInPort = _DataFlowEditor->GetChangeInPort( ServiceParameterName ) ;
530     }
531     if ( CORBA::is_nil( anInPort->ObjRef() ) ) {
532       if ( begin ) {
533         beginService( "CNode_Impl::Port" );
534         begin = false ;
535       }
536       bool hasinput ;
537       if ( _IsNode ) {
538         hasinput = _DataFlowNode->HasInput( anInPort->PortName() ) ;
539       }
540       else {
541         hasinput = _DataFlowEditor->HasInput( anInPort->PortName() ) ;
542       }
543       if ( hasinput ) {
544         const CORBA::Any * anAny = anInPort->GetOutPort()->Value() ;
545         myPort = new Port_Impl( _Orb , _Poa , _ContId ,
546                                 instanceName() , interfaceName() ,
547                                 _DataFlowEditor ,
548                                 _DataFlowNode ,
549 //                                ServiceParameterName ,
550                                 (GraphBase::Port * ) anInPort ,
551                                 true ,
552                                 anAny ) ;
553       }
554       else {
555         myPort = new Port_Impl( _Orb , _Poa , _ContId ,
556                                 instanceName() , interfaceName() ,
557                                 _DataFlowEditor ,
558                                 _DataFlowNode ,
559 //                                ServiceParameterName ) ;
560                                 (GraphBase::Port * ) anInPort ,
561                                 true ) ;
562       }
563       PortableServer::ObjectId * id = myPort->getId() ;
564       CORBA::Object_var obj = _poa->id_to_reference(*id);
565       iobject = SUPERV::Port::_narrow(obj) ;
566       anInPort->ObjRef( SUPERV::Port::_duplicate( iobject ) ) ;
567     }
568     else {
569       iobject = anInPort->ObjRef() ;
570     }
571   }
572   else if ( anoutport ) {
573     GraphBase::OutPort * anOutPort ;
574     if ( _IsNode ) {
575       anOutPort = _DataFlowNode->GetChangeOutPort( ServiceParameterName ) ;
576     }
577     else {
578       anOutPort = _DataFlowEditor->GetChangeOutPort( ServiceParameterName ) ;
579     }
580     if ( CORBA::is_nil( anOutPort->ObjRef() ) ) {
581       if ( begin ) {
582         beginService( "CNode_Impl::Port" );
583         begin = false ;
584       }
585       const CORBA::Any * anAny = anOutPort->Value() ;
586       myPort = new Port_Impl( _Orb , _Poa , _ContId ,
587                               instanceName() , interfaceName() ,
588                               _DataFlowEditor ,
589                               _DataFlowNode ,
590 //                              ServiceParameterName ,
591                               (GraphBase::Port * ) anOutPort ,
592                               false ,
593                               anAny ) ;
594       PortableServer::ObjectId * id = myPort->getId() ;
595       CORBA::Object_var obj = _poa->id_to_reference(*id);
596       iobject = SUPERV::Port::_narrow(obj) ;
597       anOutPort->ObjRef( SUPERV::Port::_duplicate( iobject ) ) ;
598     }
599     else {
600       iobject = anOutPort->ObjRef() ;
601     }
602   }
603   if ( !begin ) {
604     endService( "CNode_Impl::Port" );
605   }
606   return SUPERV::Port::_duplicate( iobject ) ;
607 }
608
609 SUPERV::Port_ptr CNode_Impl::Input( const char * ToServiceParameterName ,
610                                     const SUPERV::Value_ptr aValue ) {
611   bool begin = true ;
612   SUPERV::Port_var iobject = SUPERV::Port::_nil() ;
613   GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
614   if ( _DataFlowEditor->IsEditing() ) {
615     bool sts = false ;
616     GraphBase::InPort * anInPort ;
617     if ( _IsNode ) {
618       sts = _DataFlowEditor->AddInputData( _DataFlowNode->Name() ,
619                                            ToServiceParameterName ,
620                                            *aValue->ToAny() ) ;
621       anInPort = _DataFlowNode->GetChangeInPort( ToServiceParameterName ) ;
622     }
623     else {
624       sts = _DataFlowEditor->AddInputData( _DataFlowEditor->Name() ,
625                                            ToServiceParameterName ,
626                                            *aValue->ToAny() ) ;
627       anInPort = _DataFlowEditor->GetChangeInPort( ToServiceParameterName ) ;
628     }
629     if ( sts && anInPort ) {
630       if ( CORBA::is_nil( anInPort->ObjRef() ) ) {
631         if ( begin ) {
632           beginService( "CNode_Impl::Input" );
633           begin = false ;
634         }
635         Port_Impl * myPort ;
636         myPort = new Port_Impl( _Orb , _Poa , _ContId ,
637                                 instanceName() , interfaceName() ,
638                                 _DataFlowEditor ,
639                                 _DataFlowNode ,
640 //                                ToServiceParameterName ,
641                                 (GraphBase::Port * ) anInPort ,
642                                 true ,
643                                 aValue->ToAny() ) ;
644         PortableServer::ObjectId * id = myPort->getId() ;
645         CORBA::Object_var obj = _poa->id_to_reference(*id);
646         iobject = SUPERV::Port::_narrow(obj) ;
647         anInPort->ObjRef( SUPERV::Port::_duplicate( iobject ) ) ;
648       }
649       else {
650         iobject = anInPort->ObjRef() ;
651       }
652     }
653   }
654   else if ( _DataFlowExecutor ) {
655     bool sts = false ;
656     GraphBase::InPort * anInPort ;
657     if ( _IsNode ) {
658       sts = _DataFlowExecutor->ChangeInputData( _DataFlowNode->Name() ,
659                                                 ToServiceParameterName ,
660                                                 *aValue->ToAny() ) ;
661       anInPort = _DataFlowNode->GetChangeInPort( ToServiceParameterName ) ;
662     }
663     else {
664       sts = _DataFlowExecutor->ChangeInputData( _DataFlowEditor->Name() ,
665                                                 ToServiceParameterName ,
666                                                 *aValue->ToAny() ) ;
667       anInPort = _DataFlowEditor->GetChangeInPort( ToServiceParameterName ) ;
668     }
669     if ( sts && anInPort ) {
670       if ( CORBA::is_nil( anInPort->ObjRef() ) ) {
671         if ( begin ) {
672           beginService( "CNode_Impl::Input" );
673           begin = false ;
674         }
675         Port_Impl * myPort ;
676         myPort = new Port_Impl( _Orb , _Poa , _ContId ,
677                                 instanceName() , interfaceName() ,
678                                 _DataFlowEditor ,
679                                 _DataFlowNode ,
680 //                                ToServiceParameterName ,
681                                 (GraphBase::Port * ) anInPort ,
682                                 true ,
683                                 aValue->ToAny() ) ;
684         PortableServer::ObjectId * id = myPort->getId() ;
685         CORBA::Object_var obj = _poa->id_to_reference(*id);
686         iobject = SUPERV::Port::_narrow(obj) ;
687         anInPort->ObjRef( SUPERV::Port::_duplicate( iobject ) ) ;
688       }
689       else {
690         iobject = anInPort->ObjRef() ;
691       }
692     }
693   }
694   if ( !begin ) {
695     endService( "CNode_Impl::Input" );
696   }
697   return SUPERV::Port::_duplicate( iobject ) ;
698 }
699
700 SUPERV::ListOfPorts * CNode_Impl::Ports() {
701   bool begin = true ;
702   SUPERV::ListOfPorts_var RetVal = new SUPERV::ListOfPorts ;
703   if ( _IsNode ) {
704     int i , j ;
705     RetVal->length( _DataFlowNode->GetNodeInPortsSize() +
706                     _DataFlowNode->GetNodeOutPortsSize() ) ;
707     for ( i = 0 ; i < _DataFlowNode->GetNodeInPortsSize() ; i++ ) {
708       GraphBase::InPort * anInPort = _DataFlowNode->GetChangeNodeInPort( i ) ;
709       if ( begin ) {
710         beginService( "CNode_Impl::Ports" );
711         begin = false ;
712       }
713       if ( anInPort->IsLoop() || ( anInPort->IsGate() && !anInPort->IsConnected() && 
714                                    ( _DataFlowEditor->IsExecuting() || _DataFlowEditor->IsReadOnly() ) ) ) {
715         MESSAGE( "InPort " << i << " " << anInPort->PortName() << " of Node " << Name() << " ignored" ) ;
716         RetVal[ i ] = SUPERV::Port::_duplicate( SUPERV::Port::_narrow( CORBA::Object::_nil() ) ) ;
717       }
718       else if ( CORBA::is_nil( anInPort->ObjRef() ) ) {
719         MESSAGE( "InPort " << i << " " << anInPort->PortName() << " of Node " << Name() << " IsExecuting "
720                  << _DataFlowEditor->IsExecuting() << " IsGate/IsConnected " << anInPort->IsGate()
721                  << "/" << anInPort->IsConnected() ) ;
722         Port_Impl * myPort ;
723         if ( _DataFlowNode->HasInput( anInPort->PortName() ) ) {
724           const CORBA::Any * anAny = anInPort->GetOutPort()->Value() ;
725           myPort = new Port_Impl( _Orb , _Poa , _ContId ,
726                                   instanceName() , interfaceName() ,
727                                   _DataFlowEditor ,
728                                   _DataFlowNode ,
729 //                                  anInPort->PortName() ,
730                                   (GraphBase::Port * ) anInPort ,
731                                   true ,
732                                   anAny ) ;
733         }
734         else {
735           myPort = new Port_Impl( _Orb , _Poa , _ContId ,
736                                   instanceName() , interfaceName() ,
737                                   _DataFlowEditor ,
738                                   _DataFlowNode ,
739 //                                  anInPort->PortName() ) ;
740                                   (GraphBase::Port * ) anInPort ,
741                                   true ) ;
742         }
743         PortableServer::ObjectId * id = myPort->getId() ;
744         CORBA::Object_var obj = _poa->id_to_reference(*id);
745         SUPERV::Port_var iobject ;
746         iobject = SUPERV::Port::_narrow(obj) ;
747         RetVal[ i ] = SUPERV::Port::_duplicate( iobject ) ;
748         anInPort->ObjRef( SUPERV::Port::_duplicate( iobject ) ) ;
749       }
750       else {
751         MESSAGE( "InPort " << i << " " << anInPort->PortName() << " of Node " << Name() ) ;
752         RetVal[ i ] = SUPERV::Port::_duplicate( anInPort->ObjRef() ) ;
753       }
754     }
755     for ( i = 0 ; i < _DataFlowNode->GetNodeOutPortsSize() ; i++ ) {
756       GraphBase::OutPort * anOutPort = _DataFlowNode->GetChangeNodeOutPort( i ) ;
757       if ( begin ) {
758         beginService( "CNode_Impl::Ports" );
759         begin = false ;
760       }
761       if ( anOutPort->IsLoop() || ( anOutPort->IsGate() && !anOutPort->IsConnected() &&
762                                     ( _DataFlowEditor->IsExecuting() || _DataFlowEditor->IsReadOnly() ) ) ) {
763         MESSAGE( "OutPort " << i << " " << anOutPort->PortName() << " of Node " << Name() << " ignored" ) ;
764         RetVal[ _DataFlowNode->GetNodeInPortsSize() + i ] = SUPERV::Port::_duplicate( SUPERV::Port::_narrow( CORBA::Object::_nil() ) ) ;
765       }
766       else if ( CORBA::is_nil( anOutPort->ObjRef() ) ) {
767         MESSAGE( "OutPort " << i << " " << anOutPort->PortName() << " of Node " << Name() ) ;
768         const CORBA::Any * anAny = anOutPort->Value() ;
769         Port_Impl * myPort = new Port_Impl( _Orb , _Poa , _ContId ,
770                                             instanceName() , interfaceName() ,
771                                             _DataFlowEditor ,
772                                             _DataFlowNode ,
773 //                                            anOutPort->PortName() ,
774                                             (GraphBase::Port * ) anOutPort ,
775                                             false ,
776                                             anAny ) ;
777         PortableServer::ObjectId * id = myPort->getId() ;
778         CORBA::Object_var obj = _poa->id_to_reference(*id);
779         SUPERV::Port_var iobject ;
780         iobject = SUPERV::Port::_narrow(obj) ;
781         RetVal[ _DataFlowNode->GetNodeInPortsSize() + i ] = SUPERV::Port::_duplicate( iobject ) ;
782         anOutPort->ObjRef( SUPERV::Port::_duplicate( iobject ) ) ;
783       }
784       else {
785         MESSAGE( "OutPort " << i << " " << anOutPort->PortName() << " of Node " << Name() ) ;
786         RetVal[ _DataFlowNode->GetNodeInPortsSize() + i ] = SUPERV::Port::_duplicate( anOutPort->ObjRef() ) ;
787       }
788     }
789     for ( i = 0 ; i < (int ) RetVal->length() ; i++ ) {
790       if ( CORBA::is_nil( RetVal[ i ] ) ) {
791         for ( j = i ; j < (int ) RetVal->length() - 1 ; j++ ) {
792           RetVal[ j ] = RetVal[ j + 1 ] ;
793         }
794         RetVal->length( RetVal->length() - 1 ) ;
795         i-- ;
796       }
797     }
798   }
799   else {
800     if ( _DataFlowEditor->IsValid() ) {
801       int i , j ;
802       RetVal->length( _DataFlowEditor->GetNodeInDataNodePortsSize() +
803                       _DataFlowEditor->GetNodeOutDataNodePortsSize() ) ;
804       for ( i = 0 ; i < _DataFlowEditor->GetNodeInDataNodePortsSize() ; i++ ) {
805         GraphBase::OutPort * anOutPort = _DataFlowEditor->GetChangeNodeInDataNodePort(i) ;
806         if ( CORBA::is_nil( anOutPort->ObjRef() ) ) {
807           if ( begin ) {
808             beginService( "CNode_Impl::Ports" );
809             begin = false ;
810           }
811           Port_Impl * myPort ;
812           if ( anOutPort->IsDataConnected() ) {
813             const CORBA::Any * anAny = anOutPort->Value() ;
814             myPort = new Port_Impl( _Orb , _Poa , _ContId ,
815                                     instanceName() , interfaceName() ,
816                                     _DataFlowEditor ,
817                                     _DataFlowNode ,
818 //                                    anOutPort->PortName() ,
819                                     (GraphBase::Port * ) anOutPort ,
820                                     true ,
821                                     anAny ) ;
822           }
823           else {
824             myPort = new Port_Impl( _Orb , _Poa , _ContId ,
825                                     instanceName() , interfaceName() ,
826                                     _DataFlowEditor ,
827                                     _DataFlowNode ,
828 //                                    anOutPort->PortName() ) ;
829                                     (GraphBase::Port * ) anOutPort ,
830                                     true ) ;
831           }
832           PortableServer::ObjectId * id = myPort->getId() ;
833           CORBA::Object_var obj = _poa->id_to_reference(*id);
834           SUPERV::Port_var iobject ;
835           iobject = SUPERV::Port::_narrow(obj) ;
836           RetVal[ i ] = SUPERV::Port::_duplicate( iobject ) ;
837           anOutPort->ObjRef( SUPERV::Port::_duplicate( iobject ) ) ;
838         }
839         else {
840           RetVal[ i ] = SUPERV::Port::_duplicate( anOutPort->ObjRef() ) ;
841         }
842       }
843       j = _DataFlowEditor->GetNodeInDataNodePortsSize() ;
844       for ( i = 0 ; i < _DataFlowEditor->GetNodeOutDataNodePortsSize() ; i++ ) {
845         GraphBase::InPort * anInPort = _DataFlowEditor->GetChangeNodeOutDataNodePort(i) ;
846         if ( CORBA::is_nil( anInPort->ObjRef() ) ) {
847           if ( begin ) {
848             beginService( "CNode_Impl::Ports" );
849             begin = false ;
850           }
851           Port_Impl * myPort ;
852           if ( anInPort->IsDataConnected() ) {
853             const CORBA::Any * anAny = anInPort->GetOutPort()->Value() ;
854             myPort = new Port_Impl( _Orb , _Poa , _ContId ,
855                                     instanceName() , interfaceName() ,
856                                     _DataFlowEditor ,
857                                     _DataFlowNode ,
858 //                                    anInPort->PortName() ,
859                                     (GraphBase::Port * ) anInPort ,
860                                     false ,
861                                     anAny ) ;
862           }
863           else {
864             myPort = new Port_Impl( _Orb , _Poa , _ContId ,
865                                     instanceName() , interfaceName() ,
866                                     _DataFlowEditor ,
867                                     _DataFlowNode ,
868 //                                    anInPort->PortName() ) ;
869                                     anInPort ,
870                                     false ) ;
871           }
872           PortableServer::ObjectId * id = myPort->getId() ;
873           CORBA::Object_var obj = _poa->id_to_reference(*id);
874           SUPERV::Port_var iobject ;
875           iobject = SUPERV::Port::_narrow(obj) ;
876           RetVal[ j + i ] = SUPERV::Port::_duplicate( iobject ) ;
877           anInPort->ObjRef( SUPERV::Port::_duplicate( iobject ) ) ;
878         }
879         else {
880           RetVal[ j + i ] = SUPERV::Port::_duplicate( anInPort->ObjRef() ) ;
881         }
882       }
883     }
884   }
885   if ( !begin ) {
886     endService( "CNode_Impl::Ports" );
887   }
888   return ( RetVal._retn() ) ;
889 }
890
891 SUPERV::Link_ptr CNode_Impl::GetLink(const char * ToServiceParameterName ) {
892   bool begin = true ;
893   SUPERV::Link_var iobject = SUPERV::Link::_nil() ;
894   char* FromNodeName ;
895   char* FromServiceParameterName ;
896   bool status = _DataFlowEditor->GetLink( _DataFlowNode->Name() ,
897                                           ToServiceParameterName ,
898                                           & FromNodeName ,
899                                           & FromServiceParameterName ) ;
900   if ( status ) {
901     GraphBase::InPort * anInPort = _DataFlowNode->GetChangeInPort( ToServiceParameterName ) ;
902     if ( anInPort->GetOutPort() ) {
903       GraphBase::OutPort * anOutPort = anInPort->GetOutPort() ;
904       if ( CORBA::is_nil( anOutPort->InPortObjRef( anInPort ) ) ) {
905         if ( begin ) {
906           beginService( "CNode_Impl::GetLink" );
907           begin = false ;
908         }
909         Link_Impl * myLink = new Link_Impl( _Orb , _Poa , _ContId ,
910                                             instanceName() , interfaceName() ,
911                                             _DataFlowEditor ,
912                                             _DataFlowNode ,
913                                             ToServiceParameterName ,
914                                             (GraphEditor::InNode *) _DataFlowEditor->GetChangeGraphNode( FromNodeName )->GetInNode() ,
915                                             FromServiceParameterName ,
916                                             true ) ;
917         PortableServer::ObjectId * id = myLink->getId() ;
918         CORBA::Object_var obj = _poa->id_to_reference(*id);
919         iobject = SUPERV::Link::_narrow(obj) ;
920         anOutPort->AddInPortObjRef( anInPort , SUPERV::Link::_duplicate( iobject ) ) ;
921       }
922       else {
923         iobject = anOutPort->InPortObjRef( anInPort ) ;
924       }
925     }
926   }
927   if ( !begin ) {
928     endService( "CNode_Impl::GetLink" );
929   }
930   return SUPERV::Link::_duplicate( iobject ) ;
931 }
932
933 long CNode_Impl::SubGraph() {
934 //  beginService( "CNode_Impl::SubGraph" );
935   long RetVal = 0 ;
936   if ( _IsNode ) {
937     RetVal = _DataFlowNode->SubGraph() ;
938   }
939 //  endService( "CNode_Impl::SubGraph" );
940   return RetVal ;
941 }
942
943 bool CNode_Impl::IsLinked(const char * ServiceParameterName ) {
944   beginService( "CNode_Impl::IsLinked" );
945   bool RetVal = _DataFlowNode->IsLinked( ServiceParameterName ) ;
946   MESSAGE( Name() << "->IsLinked( '" << ServiceParameterName << "' )" ) ;
947   endService( "CNode_Impl::IsLinked" );
948   return RetVal ;
949 }
950
951 bool CNode_Impl::HasInput(const char * ServiceParameterName ) {
952 //  beginService( "CNode_Impl::HasInput" );
953   bool RetVal = _DataFlowNode->HasInput( ServiceParameterName ) ;
954 //  endService( "CNode_Impl::HasInput" );
955   return RetVal ;
956 }
957
958 SUPERV::GraphState CNode_Impl::State() {
959 //  beginService( "CNode_Impl::State" );
960   SUPERV::GraphState RetVal = SUPERV::EditingState ;
961   GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
962   if ( _DataFlowExecutor && !_DataFlowEditor->EditedAfterExecution() ) {
963     //JR : 12/06/03  if ( _DataFlowExecutor ) {
964     if ( _IsNode ) {
965       RetVal = _DataFlowExecutor->State( Name() ) ;
966     }
967     else {
968       RetVal = _DataFlowExecutor->State() ;
969     }
970   }
971 //  endService( "CNode_Impl::State" );
972   return RetVal ;
973 }
974 long CNode_Impl::Thread() {
975 //  beginService( "CNode_Impl::Thread" );
976   long RetVal = 0 ;
977   GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
978   if ( _DataFlowExecutor ) {
979     if ( _IsNode ) {
980       RetVal = _DataFlowExecutor->Thread( Name() ) ;
981     }
982     else {
983       RetVal = _DataFlowExecutor->Thread() ;
984     }
985   }
986 //  endService( "CNode_Impl::Thread" );
987   return RetVal ;
988 }
989 SUPERV::AutomatonState CNode_Impl::AutoState() {
990 //  beginService( "CNode_Impl::AutoState" );
991   SUPERV::AutomatonState RetVal = SUPERV::UnKnownState ;
992   GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
993   if ( _DataFlowExecutor ) {
994     if ( _IsNode ) {
995       RetVal = _DataFlowExecutor->AutomatonState( Name() ) ;
996     }
997     else {
998       RetVal = _DataFlowExecutor->AutomatonState() ;
999     }
1000   }
1001 //  endService( "CNode_Impl::AutoState" );
1002   return RetVal ;
1003 }
1004 SUPERV::ControlState CNode_Impl::Control() {
1005 //  beginService( "CNode_Impl::Control" );
1006   SUPERV::ControlState RetVal = SUPERV::VoidState ;
1007   GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1008   if ( _DataFlowExecutor ) {
1009     if ( _IsNode ) {
1010       RetVal = _DataFlowExecutor->ControlState( Name() ) ;
1011     }
1012     else {
1013       RetVal = _DataFlowExecutor->ControlState() ;
1014     }
1015   }
1016 //  endService( "CNode_Impl::Control" );
1017   return RetVal ;
1018 }
1019 void CNode_Impl::ControlClear() {
1020 //  beginService( "CNode_Impl::ControlClear" );
1021 //  SUPERV::ControlState RetVal = SUPERV::VoidState ;
1022   GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1023   if ( _DataFlowExecutor ) {
1024     if ( _IsNode ) {
1025       _DataFlowExecutor->ControlClear( Name() ) ;
1026     }
1027     else {
1028       _DataFlowExecutor->ControlClear() ;
1029     }
1030   }
1031 //  endService( "CNode_Impl::ControlClear" );
1032   return ;
1033 }
1034
1035 bool CNode_Impl::IsReady() {
1036 //  beginService( "CNode_Impl::IsReady" );
1037   bool RetVal = false ;
1038   GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1039   if ( _DataFlowExecutor ) {
1040     if ( _IsNode ) {
1041       RetVal = _DataFlowExecutor->IsReady( Name() ) ;
1042     }
1043     else {
1044       RetVal = _DataFlowExecutor->IsReady() ;
1045     }
1046   }
1047 //  endService( "CNode_Impl::IsReady" );
1048   return RetVal ;
1049 }
1050
1051 bool CNode_Impl::IsWaiting() {
1052 //  beginService( "CNode_Impl::IsWaiting" );
1053   bool RetVal = false ;
1054   GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1055   if ( _DataFlowExecutor ) {
1056     if ( _IsNode ) {
1057       RetVal = _DataFlowExecutor->IsWaiting( Name() ) ;
1058     }
1059     else {
1060       RetVal = _DataFlowExecutor->IsWaiting() ;
1061     }
1062   }
1063 //  endService( "CNode_Impl::IsWaiting" );
1064   return RetVal ;
1065 }
1066
1067 bool CNode_Impl::IsRunning() {
1068 //  beginService( "CNode_Impl::IsRunning" );
1069   bool RetVal = false ;
1070   GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1071   if ( _DataFlowExecutor ) {
1072     if ( _IsNode ) {
1073       RetVal = _DataFlowExecutor->IsRunning( Name() ) ;
1074     }
1075     else {
1076       RetVal = _DataFlowExecutor->IsRunning() ;
1077     }
1078   }
1079 //  endService( "CNode_Impl::IsRunning" );
1080   return RetVal ;
1081 }
1082
1083 bool CNode_Impl::IsDone() {
1084 //  beginService( "CNode_Impl::IsDone" );
1085   bool RetVal = false ;
1086   GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1087   if ( _DataFlowExecutor ) {
1088     if ( _IsNode ) {
1089       RetVal = _DataFlowExecutor->IsDone( Name() ) ;
1090     }
1091     else {
1092       RetVal = _DataFlowExecutor->IsDone() ;
1093     }
1094   }
1095 //  endService( "CNode_Impl::IsDone" );
1096   return RetVal ;
1097 }
1098
1099 bool CNode_Impl::IsSuspended() {
1100 //  beginService( "CNode_Impl::IsSuspended" );
1101   bool RetVal = false ;
1102   GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1103   if ( _DataFlowExecutor ) {
1104     if ( _IsNode ) {
1105       RetVal = _DataFlowExecutor->IsSuspended( Name() ) ;
1106     }
1107     else {
1108       RetVal = _DataFlowExecutor->IsSuspended() ;
1109     }
1110   }
1111 //  endService( "CNode_Impl::IsSuspended" );
1112   return RetVal ;
1113 }
1114
1115 bool CNode_Impl::ReadyW() {
1116 //  beginService( "CNode_Impl::ReadyW" );
1117   bool RetVal = false ;
1118   GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1119   if ( _DataFlowExecutor ) {
1120     if ( _IsNode ) {
1121       RetVal = _DataFlowExecutor->ReadyWait( Name() ) ;
1122     }
1123     else {
1124       RetVal = _DataFlowExecutor->ReadyWait() ;
1125     }
1126   }
1127 //  endService( "CNode_Impl::ReadyW" );
1128   return RetVal ;
1129 }
1130
1131 bool CNode_Impl::RunningW() {
1132 //  beginService( "CNode_Impl::RunningW" );
1133   bool RetVal = false ;
1134   GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1135   if ( _DataFlowExecutor ) {
1136     if ( _IsNode ) {
1137       RetVal = _DataFlowExecutor->RunningWait( Name() ) ;
1138     }
1139     else {
1140       RetVal = _DataFlowExecutor->RunningWait() ;
1141     }
1142   }
1143 //  endService( "CNode_Impl::RunningW" );
1144   return RetVal ;
1145 }
1146
1147 bool CNode_Impl::DoneW() {
1148 //  beginService( "CNode_Impl::DoneW" );
1149   bool RetVal = false ;
1150   GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1151   if ( _DataFlowExecutor ) {
1152     if ( _IsNode ) {
1153       RetVal = _DataFlowExecutor->DoneWait( Name() ) ;
1154     }
1155     else {
1156       RetVal = _DataFlowExecutor->DoneWait() ;
1157     }
1158   }
1159 //  endService( "CNode_Impl::DoneW" );
1160   return RetVal ;
1161 }
1162
1163 bool CNode_Impl::SuspendedW() {
1164 //  beginService( "CNode_Impl::SuspendedW" );
1165   bool RetVal = false ;
1166   GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1167   if ( _DataFlowExecutor ) {
1168     if ( _IsNode ) {
1169       RetVal = _DataFlowExecutor->SuspendedWait( Name() ) ;
1170     }
1171     else {
1172       RetVal = _DataFlowExecutor->SuspendedWait() ;
1173     }
1174   }
1175 //  endService( "CNode_Impl::SuspendedW" );
1176   return RetVal ;
1177 }
1178
1179 void CNode_Impl::ping() {
1180 //  beginService( "CNode_Impl::ping" );
1181   bool RetVal = false ;
1182   GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1183   if ( _DataFlowExecutor ) {
1184     if ( _IsNode ) {
1185       RetVal = _DataFlowExecutor->Ping( Name() ) ;
1186     }
1187     else {
1188       RetVal = false ;
1189     }
1190   }
1191 //  endService( "CNode_Impl::ping" );
1192   return ;
1193 }
1194
1195 bool CNode_Impl::ContainerKill() {
1196   beginService( "CNode_Impl::ContainerKill" );
1197   bool RetVal = false ;
1198   GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1199   if ( _DataFlowExecutor && _DataFlowEditor->IsExecuting() ) {
1200     if ( _IsNode ) {
1201       RetVal = _DataFlowExecutor->ContainerKill( Name() ) ;
1202     }
1203     else {
1204       RetVal = _DataFlowExecutor->ContainerKill() ;
1205     }
1206   }
1207   endService( "CNode_Impl::ContainerKill" );
1208   return RetVal ;
1209 }
1210 bool CNode_Impl::Kill() {
1211 //  beginService( "CNode_Impl::Kill" );
1212   bool RetVal = false ;
1213   GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1214   if ( _DataFlowExecutor ) {
1215     if ( _IsNode ) {
1216       RetVal = _DataFlowExecutor->Kill( Name() ) ;
1217     }
1218     else {
1219       RetVal = _DataFlowExecutor->Kill() ;
1220     }
1221   }
1222 //  endService( "CNode_Impl::Kill" );
1223   return RetVal ;
1224 }
1225 bool CNode_Impl::KillDone() {
1226 //  beginService( "CNode_Impl::KillDone" );
1227   bool RetVal = false ;
1228   GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1229   if ( _DataFlowExecutor ) {
1230     if ( _IsNode ) {
1231       RetVal = _DataFlowExecutor->KillDone( Name() ) ;
1232     }
1233   }
1234 //  endService( "CNode_Impl::KillDone" );
1235   return RetVal ;
1236 }
1237 bool CNode_Impl::Stop() {
1238 //  beginService( "CNode_Impl::Stop" );
1239   bool RetVal ; // = _DataFlowExecutor->Stop() ;
1240 //  endService( "CNode_Impl::Stop" );
1241   return RetVal ;
1242 }
1243 bool CNode_Impl::Suspend() {
1244 //  beginService( "CNode_Impl::Suspend" );
1245   bool RetVal = false ;
1246   GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1247   if ( _DataFlowExecutor ) {
1248     if ( _IsNode ) {
1249       RetVal = _DataFlowExecutor->Suspend( Name() ) ;
1250     }
1251     else {
1252       RetVal = _DataFlowExecutor->Suspend() ;
1253     }
1254   }
1255 //  endService( "CNode_Impl::Suspend" );
1256   return RetVal ;
1257 }
1258 bool CNode_Impl::SuspendDone() {
1259 //  beginService( "CNode_Impl::SuspendDone" );
1260   bool RetVal = false ;
1261   GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1262   if ( _DataFlowExecutor ) {
1263     if ( _IsNode ) {
1264       RetVal = _DataFlowExecutor->SuspendDone( Name() ) ;
1265     }
1266     else {
1267       RetVal = _DataFlowExecutor->SuspendDone() ;
1268     }
1269   }
1270 //  endService( "CNode_Impl::SuspendDone" );
1271   return RetVal ;
1272 }
1273 bool CNode_Impl::Resume() {
1274 //  beginService( "CNode_Impl::Resume" );
1275   bool RetVal = false ;
1276   GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1277   if ( _DataFlowExecutor ) {
1278     if ( _IsNode ) {
1279       RetVal = _DataFlowExecutor->Resume( Name() ) ;
1280     }
1281     else {
1282       RetVal = _DataFlowExecutor->Resume() ;
1283     }
1284   }
1285 //  endService( "CNode_Impl::Resume" );
1286   return RetVal ;
1287 }
1288
1289 bool CNode_Impl::Run() {
1290   beginService( "CNode_Impl::Run" );
1291   bool RetVal = false ;
1292   GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1293   if ( _DataFlowExecutor ) {
1294     _DataFlowEditor->EditedAfterExecution( false ) ;
1295     if ( _IsNode ) {
1296       RetVal = _DataFlowExecutor->Run( Name() , Name() , false ) ;
1297     }
1298     else {
1299       RetVal = _DataFlowExecutor->Run( false ) ;
1300     }
1301   }
1302   endService( "CNode_Impl::Run" );
1303   return RetVal ;
1304 }
1305
1306 bool CNode_Impl::ReRun() {
1307   beginService( "CNode_Impl::ReRun" );
1308   bool RetVal = false ;
1309   GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1310   if ( _DataFlowExecutor ) {
1311     _DataFlowEditor->EditedAfterExecution( false ) ;
1312     if ( _IsNode ) {
1313       RetVal = _DataFlowExecutor->Run( Name() , Name() , false ) ;
1314     }
1315     else if ( DataFlowEditor()->IsEditing() ) {
1316       //      RetVal = _DataFlowExecutor->Run( false ) ;
1317       return ((Graph_Impl::Graph_Impl *) this)->Graph_Impl::Run() ;
1318     }
1319   }
1320   endService( "CNode_Impl::ReRun" );
1321   return RetVal ;
1322 }
1323
1324 bool CNode_Impl::ReRunAt( const char * aNodeName ) {
1325   beginService( "CNode_Impl::ReRunAt" );
1326   bool RetVal = false ;
1327   GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1328   if ( _DataFlowExecutor ) {
1329     _DataFlowEditor->EditedAfterExecution( false ) ;
1330     if ( _IsNode ) {
1331       RetVal = _DataFlowExecutor->Run( Name() , aNodeName , false ) ;
1332     }
1333   }
1334   endService( "CNode_Impl::ReRunAt" );
1335   return RetVal ;
1336 }
1337
1338 bool CNode_Impl::ReStart() {
1339   beginService( "CNode_Impl::ReStart" );
1340   bool RetVal = false ;
1341   GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1342   if ( _DataFlowExecutor ) {
1343     if ( _IsNode ) {
1344       RetVal = _DataFlowExecutor->Run( Name() , Name() , true ) ;
1345     }
1346     else {
1347       RetVal = _DataFlowExecutor->Run( true ) ;
1348     }
1349   }
1350   endService( "CNode_Impl::ReStart" );
1351   return RetVal ;
1352 }
1353
1354 bool CNode_Impl::ReStartAt( const char * aNodeName ) {
1355   beginService( "CNode_Impl::ReStartAt" );
1356   bool RetVal = false ;
1357   GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1358   if ( _DataFlowExecutor ) {
1359     if ( _IsNode ) {
1360       RetVal = _DataFlowExecutor->Run( Name() , aNodeName , true ) ;
1361     }
1362   }
1363   endService( "CNode_Impl::ReStartAt" );
1364   return RetVal ;
1365 }
1366
1367 long CNode_Impl::CpuUsed() {
1368   long RetVal = 0 ;
1369   GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1370   if ( _DataFlowExecutor ) {
1371     if ( _IsNode ) {
1372       RetVal = _DataFlowExecutor->CpuUsed( Name() ) ;
1373     }
1374     else {
1375       RetVal = _DataFlowExecutor->CpuUsed() ;
1376     }
1377   }
1378   return RetVal ;
1379 }
1380
1381