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