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