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