1 // SUPERV Supervision : contains the implementation of interfaces of SuperVision described in SUPERV.idl
3 // Copyright (C) 2003 CEA/DEN, EDF R&D
7 // File : CNode_Impl.cxx
8 // Author : Jean Rahuel
18 //#include "utilities.h"
20 #include "StreamGraph_Impl.hxx"
22 #include "CNode_Impl.hxx"
24 #include "StreamPort_Impl.hxx"
26 CNode_Impl::CNode_Impl( CORBA::ORB_ptr orb ,
27 PortableServer::POA_ptr poa ,
28 PortableServer::ObjectId * contId ,
29 const char *instanceName ,
30 const char *interfaceName ,
31 const char *aDataFlowName ,
32 const SUPERV::KindOfNode aKindOfNode ) :
33 Engines_Component_i(orb, poa, contId, instanceName, interfaceName, false, false) {
34 // MESSAGE("CNode_Impl::CNode_Impl activate object instanceName("
35 // << instanceName << ") interfaceName(" << interfaceName << ") --> "
36 // << hex << (void *) this << dec )
38 // _id = _poa->activate_object(_thisObj);
39 // MESSAGE( "CNode_Impl::CNode_Impl " << aDataFlowName << " " );
40 // beginService( "CNode_Impl::CNode_Impl" );
41 _Orb = CORBA::ORB::_duplicate(orb);
44 _DataFlowEditor = NULL ;
45 _DataFlowNode = NULL ;
46 if ( aKindOfNode == SUPERV::MacroNode ) {
52 // endService( "CNode_Impl::CNode_Impl" );
55 CNode_Impl::CNode_Impl() {
58 CNode_Impl::CNode_Impl( CORBA::ORB_ptr orb ,
59 PortableServer::POA_ptr poa ,
60 PortableServer::ObjectId * contId ,
61 const char *instanceName ,
62 const char *interfaceName ,
63 GraphEditor::DataFlow * aDataFlowEditor ,
64 const SALOME_ModuleCatalog::Service &NodeService ,
65 const char * NodeName ,
66 const SUPERV::KindOfNode NodeKindOfNode ,
67 const char * FuncName ,
68 const SUPERV::ListOfStrings & PythonFunction ) :
69 Engines_Component_i(orb, poa, contId, instanceName, interfaceName, false, false) {
70 // beginService( "CNode_Impl::CNode_Impl" );
71 // cout << "CNode_Impl::CNode_Impl -->" << endl ;
72 // if ( FuncName && NodeName ) {
73 // cout << "CNode_Impl::CNode_Impl " << (void *) NodeName << " " << NodeName
74 // << " " << strlen(NodeName) << " " << (void *) FuncName << " " << FuncName
75 // << " " << strlen( FuncName ) << endl ;
77 if ( NodeKindOfNode == SUPERV::ComputingNode ) {
78 // MESSAGE( "CNode_Impl::CNode_Impl " << FuncName << " _poa->activate_object" );
80 _id = _poa->activate_object(_thisObj);
82 _Orb = CORBA::ORB::_duplicate(orb);
85 _DataFlowEditor = aDataFlowEditor ;
86 DataFlowEditor()->Graph()->GraphEditor( aDataFlowEditor ) ;
87 GraphBase::ListOfFuncName aFuncName ;
88 GraphBase::ListOfPythonFunctions aPythonFunction ;
91 aFuncName[0] = my_strdup( FuncName ) ;
92 aPythonFunction.resize(1) ;
93 aPythonFunction[0] = &PythonFunction ;
95 _DataFlowNode = DataFlowEditor()->AddNode( NodeService , "" , "" , NodeName ,
100 // endService( "CNode_Impl::CNode_Impl" );
101 // cout << "<-- CNode_Impl::CNode_Impl" << endl ;
104 CNode_Impl::CNode_Impl( CORBA::ORB_ptr orb ,
105 PortableServer::POA_ptr poa ,
106 PortableServer::ObjectId * contId ,
107 const char *instanceName ,
108 const char *interfaceName ,
109 GraphEditor::DataFlow * aDataFlowEditor ,
110 const SALOME_ModuleCatalog::Service &NodeService ,
111 const char * NodeName ,
112 const SUPERV::KindOfNode NodeKindOfNode ,
113 const GraphBase::ListOfFuncName & aFuncName ,
114 const GraphBase::ListOfPythonFunctions & aPythonFunction ) :
115 Engines_Component_i(orb, poa, contId, instanceName, interfaceName, false, false) {
116 // MESSAGE( NodeName << " " );
117 // beginService( "CNode_Impl::CNode_Impl" );
119 // MESSAGE("CNode_Impl::CNode_Impl " << NodeName << " " << strlen( NodeName ) ) ;
121 if ( NodeKindOfNode == SUPERV::ComputingNode ) {
122 // MESSAGE( "CNode_Impl::CNode_Impl " << aFuncName[0] << " _poa->activate_object" );
124 _id = _poa->activate_object(_thisObj);
126 _Orb = CORBA::ORB::_duplicate(orb);
129 _DataFlowEditor = aDataFlowEditor ;
130 DataFlowEditor()->Graph()->GraphEditor( aDataFlowEditor ) ;
131 _DataFlowNode = DataFlowEditor()->AddNode( NodeService , "" , "" , NodeName ,
136 // endService( "CNode_Impl::CNode_Impl" );
139 CNode_Impl::CNode_Impl( CORBA::ORB_ptr orb ,
140 PortableServer::POA_ptr poa ,
141 PortableServer::ObjectId * contId ,
142 const char *instanceName ,
143 const char *interfaceName ,
144 GraphEditor::DataFlow * aDataFlowEditor ,
145 GraphEditor::InNode * aDataFlowNode ) :
146 Engines_Component_i(orb, poa, contId, instanceName, interfaceName, false, false) {
147 // beginService( "CNode_Impl::CNode_Impl" );
148 if ( aDataFlowNode && aDataFlowNode->IsComputingNode() ) {
149 // MESSAGE( "CNode_Impl::CNode_Impl _poa->activate_object" );
151 _id = _poa->activate_object(_thisObj);
154 // MESSAGE( "CNode_Impl::CNode_Impl NO _poa->activate_object " );
156 _Orb = CORBA::ORB::_duplicate(orb);
159 _DataFlowEditor = aDataFlowEditor ;
160 DataFlowEditor()->Graph()->GraphEditor( aDataFlowEditor ) ;
161 _DataFlowNode = aDataFlowNode ;
162 if ( aDataFlowNode ) {
168 // endService( "CNode_Impl::CNode_Impl" );
171 CNode_Impl::~CNode_Impl() {
172 beginService( "CNode_Impl::~CNode_Impl" );
173 endService( "CNode_Impl::~CNode_Impl" );
176 void CNode_Impl::destroy() {
177 beginService( "CNode_Impl::Destroy" );
178 if ( DataFlowEditor()->IsEditing() ) {
180 _DataFlowNode = NULL ;
181 _poa->deactivate_object(*_id) ;
182 CORBA::release(_poa) ;
184 _thisObj->_remove_ref();
187 MESSAGE("CNode_Impl::destroy ERROR ") ;
190 // endService( "CNode_Impl::Destroy" );
193 bool CNode_Impl::Delete() {
194 beginService( "CNode_Impl::Delete" );
195 bool RetVal = false ;
196 if ( DataFlowEditor()->IsEditing() ) {
198 RetVal = DataFlowEditor()->RemoveNode( Name() ) ;
200 DataFlowEditor()->UnValid() ;
203 endService( "CNode_Impl::Delete" );
207 void CNode_Impl::DeletePorts() {
208 beginService( "CNode_Impl::DeletePorts" );
209 if ( DataFlowEditor()->IsEditing() && DataFlowNode() ) {
211 for ( i = 0 ; i < DataFlowNode()->ComputingNode()->GetNodeInPortsSize() ; i++ ) {
212 SUPERV::Port_var aPort = DataFlowNode()->ComputingNode()->GetChangeNodeInPort( i )->ObjRef() ;
213 if ( !CORBA::is_nil( aPort ) ) {
217 for ( i = 0 ; i < DataFlowNode()->ComputingNode()->GetNodeOutPortsSize() ; i++ ) {
218 SUPERV::Port_var aPort = DataFlowNode()->ComputingNode()->GetChangeNodeOutPort( i )->ObjRef() ;
219 if ( !CORBA::is_nil( aPort ) ) {
224 endService( "CNode_Impl::DeletePorts" );
227 SALOME_ModuleCatalog::Service * CNode_Impl::Service() {
228 // beginService( "CNode_Impl::Service" );
229 SALOME_ModuleCatalog::Service * RetVal ;
231 RetVal = new SALOME_ModuleCatalog::Service( *DataFlowNode()->GetService() ) ;
234 RetVal = new SALOME_ModuleCatalog::Service( *DataFlowEditor()->GetService() ) ;
236 // endService( "CNode_Impl::Service" );
240 char * CNode_Impl::Name() {
241 // beginService( "CNode_Impl::Name" );
242 char * RetVal = NULL ;
244 RetVal = DataFlowNode()->Name() ;
247 RetVal = DataFlowEditor()->Graph()->Name() ;
249 // endService( "CNode_Impl::Name" );
250 return CORBA::string_dup( RetVal );
252 bool CNode_Impl::SetName( const char * aDataFlowName ) {
253 // beginService( "CNode_Impl::SetName" );
254 bool RetVal = false ;
255 if ( DataFlowEditor()->IsEditing() ) {
257 //JR 29.06.2005 debug :
258 char * OldNodeName = my_strdup( DataFlowNode()->Name() ) ;
259 // RetVal = DataFlowEditor()->ReNameNode( DataFlowNode()->Name() ,
260 RetVal = DataFlowEditor()->ReNameNode( OldNodeName ,
262 delete [] OldNodeName ;
265 // RetVal = DataFlowEditor()->Graph()->Name( aDataFlowName ) ;
266 RetVal = DataFlowEditor()->Name( aDataFlowName ) ;
269 // endService( "CNode_Impl::SetName" );
272 SUPERV::KindOfNode CNode_Impl::Kind() {
273 // beginService( "CNode_Impl::Kind" );
274 SUPERV::KindOfNode RetVal = SUPERV::UnknownNode ;
276 RetVal = DataFlowNode()->Kind() ;
279 RetVal = DataFlowEditor()->Graph()->Kind() ;
281 // endService( "CNode_Impl::Kind" );
284 bool CNode_Impl::IsGraph() {
285 // beginService( "CNode_Impl::IsGraph" );
286 bool RetVal = false ;
288 RetVal = DataFlowNode()->IsDataFlowNode() ;
291 RetVal = DataFlowEditor()->Graph()->IsDataFlowNode() ;
293 // endService( "CNode_Impl::IsGraph" );
296 bool CNode_Impl::IsStreamGraph() {
297 beginService( "CNode_Impl::IsStreamGraph" );
298 bool RetVal = false ;
300 RetVal = DataFlowNode()->IsDataStreamNode() ;
303 RetVal = DataFlowEditor()->Graph()->IsDataStreamNode() ;
305 MESSAGE( "CNode_Impl::IsStreamGraph " << RetVal );
306 endService( "CNode_Impl::IsStreamGraph" );
309 bool CNode_Impl::IsMacro() {
310 // beginService( "CNode_Impl::IsMacro" );
311 bool RetVal = false ;
312 if ( _IsNode && DataFlowNode()->IsMacroNode() ) {
315 // endService( "CNode_Impl::IsMacro" );
318 bool CNode_Impl::IsFlowMacro() {
319 // beginService( "CNode_Impl::IsFlowMacro" );
320 bool RetVal = false ;
321 if ( _IsNode && DataFlowNode()->IsMacroNode() && DataFlowNode()->ComputingNode()->MacroObject()->IsGraph() ) {
324 // endService( "CNode_Impl::IsFlowMacro" );
327 bool CNode_Impl::IsStreamMacro() {
328 // beginService( "CNode_Impl::IsStreamMacro" );
329 bool RetVal = false ;
330 if ( _IsNode && DataFlowNode()->IsMacroNode() && DataFlowNode()->ComputingNode()->MacroObject()->IsStreamGraph() ) {
333 // endService( "CNode_Impl::IsStreamMacro" );
336 bool CNode_Impl::IsHeadGraph() {
337 bool RetVal = false ;
338 beginService( "CNode_Impl::IsHeadGraph" );
339 endService( "CNode_Impl::IsHeadGraph" );
342 long CNode_Impl::GraphLevel() {
344 beginService( "CNode_Impl::GraphLevel" );
345 RetVal = DataFlowEditor()->Graph()->GraphMacroLevel() ;
346 endService( "CNode_Impl::GraphLevel" );
350 bool CNode_Impl::IsComputing() {
351 // beginService( "CNode_Impl::IsComputing" );
352 bool RetVal = SUPERV::UnknownNode ;
354 RetVal = DataFlowNode()->IsComputingNode() ;
357 RetVal = DataFlowEditor()->Graph()->IsComputingNode() ;
359 // endService( "CNode_Impl::IsComputing" );
362 bool CNode_Impl::IsFactory() {
363 // beginService( "CNode_Impl::IsFactory" );
364 bool RetVal = SUPERV::UnknownNode ;
366 RetVal = DataFlowNode()->IsFactoryNode() ;
369 RetVal = DataFlowEditor()->Graph()->IsFactoryNode() ;
371 // endService( "CNode_Impl::IsFactory" );
374 bool CNode_Impl::IsInLine() {
375 // beginService( "CNode_Impl::IsInLine" );
376 bool RetVal = SUPERV::UnknownNode ;
378 RetVal = DataFlowNode()->IsInLineNode() ;
381 RetVal = DataFlowEditor()->Graph()->IsInLineNode() ;
383 // endService( "CNode_Impl::IsInLine" );
386 bool CNode_Impl::IsGOTO() {
387 // beginService( "CNode_Impl::IsGOTO" );
388 bool RetVal = SUPERV::UnknownNode ;
390 RetVal = DataFlowNode()->IsGOTONode() ;
393 RetVal = DataFlowEditor()->Graph()->IsGOTONode() ;
395 // endService( "CNode_Impl::IsGOTO" );
398 bool CNode_Impl::IsLoop() {
399 // beginService( "CNode_Impl::IsLoop" );
400 bool RetVal = SUPERV::UnknownNode ;
402 RetVal = DataFlowNode()->IsLoopNode() ;
405 RetVal = DataFlowEditor()->Graph()->IsLoopNode() ;
407 // endService( "CNode_Impl::IsLoop" );
410 bool CNode_Impl::IsEndLoop() {
411 // beginService( "CNode_Impl::IsEndLoop" );
412 bool RetVal = SUPERV::UnknownNode ;
414 RetVal = DataFlowNode()->IsEndLoopNode() ;
417 RetVal = DataFlowEditor()->Graph()->IsEndLoopNode() ;
419 // endService( "CNode_Impl::IsEndLoop" );
422 bool CNode_Impl::IsSwitch() {
423 // beginService( "CNode_Impl::IsSwitch" );
424 bool RetVal = SUPERV::UnknownNode ;
426 RetVal = DataFlowNode()->IsSwitchNode() ;
429 RetVal = DataFlowEditor()->Graph()->IsSwitchNode() ;
431 // endService( "CNode_Impl::IsSwitch" );
434 bool CNode_Impl::IsEndSwitch() {
435 // beginService( "CNode_Impl::IsEndSwitch" );
436 bool RetVal = SUPERV::UnknownNode ;
438 RetVal = DataFlowNode()->IsEndSwitchNode() ;
441 RetVal = DataFlowEditor()->Graph()->IsEndSwitchNode() ;
443 // endService( "CNode_Impl::IsEndSwitch" );
447 SUPERV::SDate CNode_Impl::CreationDate() {
448 // beginService( "CNode_Impl::CreationDate" );
449 SUPERV::SDate_var RetVal ;
451 RetVal = new SUPERV::SDate( DataFlowNode()->FirstCreation() ) ;
454 // cout << " CNode_Impl::CreationDate " << DataFlowEditor()->FirstCreation()
456 RetVal = new SUPERV::SDate( DataFlowEditor()->Graph()->FirstCreation() ) ;
458 // endService( "CNode_Impl::CreationDate" );
459 return (RetVal._retn()) ;
461 SUPERV::SDate CNode_Impl::LastUpdateDate() {
462 // beginService( "CNode_Impl::LastUpdateDate" );
463 SUPERV::SDate_var RetVal ;
465 RetVal = new SUPERV::SDate( DataFlowNode()->LastModification() ) ;
468 RetVal = new SUPERV::SDate( DataFlowEditor()->Graph()->LastModification() ) ;
470 // endService( "CNode_Impl::LastUpdateDate" );
471 return (RetVal._retn()) ;
473 char * CNode_Impl::Version() {
474 // beginService( "CNode_Impl::Version" );
477 RetVal = DataFlowNode()->EditorRelease() ;
480 RetVal = DataFlowEditor()->Graph()->EditorRelease() ;
482 // endService( "CNode_Impl::Version" );
483 return CORBA::string_dup( RetVal ) ;
485 char * CNode_Impl::Author() {
486 // beginService( "CNode_Impl::Author" );
489 RetVal = DataFlowNode()->Author() ;
492 RetVal = DataFlowEditor()->Graph()->Author() ;
494 // endService( "CNode_Impl::Author" );
495 return CORBA::string_dup( RetVal ) ;
497 bool CNode_Impl::SetAuthor( const char * aDataFlowAuthor ) {
498 // beginService( "CNode_Impl::SetAuthor" );
499 bool RetVal = false ;
500 if ( DataFlowEditor()->IsEditing() ) {
502 RetVal = DataFlowNode()->Author( aDataFlowAuthor ) ;
505 RetVal = DataFlowEditor()->Graph()->Author( aDataFlowAuthor ) ;
508 // endService( "CNode_Impl::SetAuthor" );
511 char * CNode_Impl::Comment() {
512 // beginService( "CNode_Impl::Comment" );
515 RetVal = DataFlowNode()->Comment() ;
518 RetVal = DataFlowEditor()->Graph()->Comment() ;
520 // endService( "CNode_Impl::Comment" );
521 return CORBA::string_dup( RetVal ) ;
523 bool CNode_Impl::SetComment( const char * aDataFlowComment ) {
524 // beginService( "CNode_Impl::SetComment" );
525 bool RetVal = false ;
526 if ( DataFlowEditor()->IsEditing() ) {
528 RetVal = DataFlowNode()->Comment( aDataFlowComment ) ;
531 RetVal = DataFlowEditor()->Graph()->Comment( aDataFlowComment ) ;
534 // endService( "CNode_Impl::SetComment" );
538 void CNode_Impl::Coords(long X , long Y ) {
539 // beginService( "CNode_Impl::Coords" );
540 if ( DataFlowEditor()->IsEditing() ) {
542 ((GraphEditor::InNode *) DataFlowNode())->Coordinates( X , Y ) ;
545 DataFlowEditor()->Graph()->Coordinates( X , Y ) ;
548 // endService( "CNode_Impl::Coords" );
550 long CNode_Impl::X() {
551 // beginService( "CNode_Impl::X" );
554 RetVal = DataFlowNode()->XCoordinate() ;
557 RetVal = DataFlowEditor()->Graph()->XCoordinate() ;
559 // endService( "CNode_Impl::X" );
562 long CNode_Impl::Y() {
563 // beginService( "CNode_Impl::Y" );
566 RetVal = DataFlowNode()->YCoordinate() ;
569 RetVal = DataFlowEditor()->Graph()->YCoordinate() ;
571 // endService( "CNode_Impl::Y" );
575 SUPERV::Port_ptr CNode_Impl::Port( const char * ServiceParameterName ) {
577 Port_Impl * myPort = NULL ;
578 SUPERV::Port_var iobject = SUPERV::Port::_nil() ;
581 aninport = DataFlowNode()->GetInPort( ServiceParameterName ) ;
584 aninport = DataFlowEditor()->GetInPort( ServiceParameterName ) ;
588 anoutport = DataFlowNode()->GetOutPort( ServiceParameterName ) ;
591 anoutport = DataFlowEditor()->GetOutPort( ServiceParameterName ) ;
594 GraphBase::InPort * anInPort ;
596 anInPort = DataFlowNode()->GetChangeInPort( ServiceParameterName ) ;
599 anInPort = DataFlowEditor()->GetChangeInPort( ServiceParameterName ) ;
601 if ( anInPort->IsDataStream() ) {
602 MESSAGE( "CNode_Impl::Port ERROR IsDataStream " ) ;
604 else if ( CORBA::is_nil( anInPort->ObjRef() ) ) {
606 beginService( "CNode_Impl::Port" );
611 hasinput = DataFlowNode()->HasInput( anInPort->PortName() ) ;
614 hasinput = DataFlowEditor()->HasInput( anInPort->PortName() ) ;
617 //JR 30.03.2005 const CORBA::Any * anAny = anInPort->GetOutPort()->Value() ;
618 const CORBA::Any anAny = anInPort->GetOutPort()->Value() ;
619 myPort = new Port_Impl( _Orb , _Poa , _ContId ,
620 instanceName() , interfaceName() ,
623 // ServiceParameterName ,
624 (GraphBase::Port * ) anInPort ,
629 myPort = new Port_Impl( _Orb , _Poa , _ContId ,
630 instanceName() , interfaceName() ,
633 // ServiceParameterName ) ;
634 (GraphBase::Port * ) anInPort ,
637 PortableServer::ObjectId * id = myPort->getId() ;
638 CORBA::Object_var obj = _poa->id_to_reference(*id);
639 iobject = SUPERV::Port::_narrow(obj) ;
640 anInPort->ObjRef( SUPERV::Port::_duplicate( iobject ) ) ;
643 iobject = anInPort->ObjRef() ;
646 else if ( anoutport ) {
647 GraphBase::OutPort * anOutPort ;
649 anOutPort = DataFlowNode()->GetChangeOutPort( ServiceParameterName ) ;
652 anOutPort = DataFlowEditor()->GetChangeOutPort( ServiceParameterName ) ;
654 if ( anOutPort->IsDataStream() ) {
655 MESSAGE( "CNode_Impl::Port ERROR IsDataStream " ) ;
657 else if ( CORBA::is_nil( anOutPort->ObjRef() ) ) {
659 beginService( "CNode_Impl::Port" );
662 //JR 30.03.2005 const CORBA::Any * anAny = anOutPort->Value() ;
663 const CORBA::Any anAny = anOutPort->Value() ;
664 myPort = new Port_Impl( _Orb , _Poa , _ContId ,
665 instanceName() , interfaceName() ,
668 // ServiceParameterName ,
669 (GraphBase::Port * ) anOutPort ,
672 PortableServer::ObjectId * id = myPort->getId() ;
673 CORBA::Object_var obj = _poa->id_to_reference(*id);
674 iobject = SUPERV::Port::_narrow(obj) ;
675 anOutPort->ObjRef( SUPERV::Port::_duplicate( iobject ) ) ;
678 iobject = anOutPort->ObjRef() ;
682 endService( "CNode_Impl::Port" );
684 DataFlowEditor()->UnValid() ;
685 return SUPERV::Port::_duplicate( iobject ) ;
688 SUPERV::Port_ptr CNode_Impl::Input( const char * ToServiceParameterName ,
689 const SUPERV::Value_ptr aValue ) {
691 SUPERV::Port_var iobject = SUPERV::Port::_nil() ;
692 GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ;
694 GraphBase::InPort * anInPort = NULL ;
695 if ( DataFlowEditor()->IsEditing() /*&& DataFlowEditor()->Graph()->GraphMacroLevel() == 0*/ ) {
697 sts = DataFlowEditor()->AddInputData( DataFlowNode()->Name() ,
698 ToServiceParameterName ,
700 anInPort = DataFlowNode()->GetChangeInPort( ToServiceParameterName ) ;
703 sts = DataFlowEditor()->AddInputData( DataFlowEditor()->Graph()->Name() ,
704 ToServiceParameterName ,
706 anInPort = DataFlowEditor()->Graph()->GetChangeInPort( ToServiceParameterName ) ;
708 if ( sts && anInPort ) {
709 if ( CORBA::is_nil( anInPort->ObjRef() ) ) {
711 beginService( "CNode_Impl::Input" );
715 myPort = new Port_Impl( _Orb , _Poa , _ContId ,
716 instanceName() , interfaceName() ,
719 // ToServiceParameterName ,
720 (GraphBase::Port * ) anInPort ,
723 PortableServer::ObjectId * id = myPort->getId() ;
724 CORBA::Object_var obj = _poa->id_to_reference(*id);
725 iobject = SUPERV::Port::_narrow(obj) ;
726 anInPort->ObjRef( SUPERV::Port::_duplicate( iobject ) ) ;
729 iobject = anInPort->ObjRef() ;
732 DataFlowEditor()->UnValid() ;
734 else if ( aDataFlowExecutor ) {
736 sts = aDataFlowExecutor->ChangeInputData( DataFlowNode()->Name() ,
737 ToServiceParameterName ,
739 anInPort = DataFlowNode()->GetChangeInPort( ToServiceParameterName ) ;
742 sts = aDataFlowExecutor->ChangeInputData( DataFlowEditor()->Graph()->Name() ,
743 ToServiceParameterName ,
745 anInPort = DataFlowEditor()->Graph()->GetChangeInPort( ToServiceParameterName ) ;
747 if ( sts && anInPort ) {
748 if ( CORBA::is_nil( anInPort->ObjRef() ) ) {
750 beginService( "CNode_Impl::Input" );
754 myPort = new Port_Impl( _Orb , _Poa , _ContId ,
755 instanceName() , interfaceName() ,
758 // ToServiceParameterName ,
759 (GraphBase::Port * ) anInPort ,
762 PortableServer::ObjectId * id = myPort->getId() ;
763 CORBA::Object_var obj = _poa->id_to_reference(*id);
764 iobject = SUPERV::Port::_narrow(obj) ;
765 anInPort->ObjRef( SUPERV::Port::_duplicate( iobject ) ) ;
768 iobject = anInPort->ObjRef() ;
773 endService( "CNode_Impl::Input" );
775 if ( CORBA::is_nil( iobject ) ) {
776 MESSAGE( "CNode_Impl::Input returns nil object _IsNode " << _IsNode << " sts " << sts
777 << " Node " << Name() << " ToServiceParameterName " << ToServiceParameterName
778 << " anInPort " << anInPort ) ;
780 return SUPERV::Port::_duplicate( iobject ) ;
784 SUPERV::Port_ptr CNode_Impl::GetInPort( const char *aParameterName ) {
785 SUPERV::Port_ptr Inobject = SUPERV::Port::_nil() ;
786 Port_Impl * myInPort = NULL ;
787 GraphBase::InPort * anInPort = DataFlowNode()->GetChangeInPort( aParameterName ) ;
788 if ( anInPort && !anInPort->IsDataStream() ) {
789 Inobject = anInPort->ObjRef() ;
790 if ( CORBA::is_nil( Inobject ) ) {
791 myInPort = new Port_Impl( _Orb , _Poa , _ContId ,
792 instanceName() , interfaceName() ,
795 (GraphBase::Port * ) anInPort ,
798 PortableServer::ObjectId * id = myInPort->getId() ;
799 CORBA::Object_var obj = _poa->id_to_reference(*id) ;
800 Inobject = SUPERV::Port::_narrow(obj) ;
801 anInPort->ObjRef( SUPERV::Port::_duplicate( Inobject ) ) ;
805 return SUPERV::Port::_duplicate( Inobject ) ;
808 SUPERV::Port_ptr CNode_Impl::GetOutPort( const char *aParameterName ) {
809 Port_Impl * myOutPort = NULL ;
810 SUPERV::Port_ptr Outobject = SUPERV::Port::_nil() ;
811 GraphBase::OutPort * anOutPort = DataFlowNode()->GetChangeOutPort( aParameterName ) ;
812 if ( anOutPort && !anOutPort->IsDataStream() ) {
813 Outobject = anOutPort->ObjRef() ;
814 if ( CORBA::is_nil( Outobject ) ) {
815 //JR 30.03.2005 const CORBA::Any * anAny = anOutPort->Value() ;
816 const CORBA::Any anAny = anOutPort->Value() ;
817 myOutPort = new Port_Impl( _Orb , _Poa , _ContId ,
818 instanceName() , interfaceName() ,
821 (GraphBase::Port * ) anOutPort ,
825 PortableServer::ObjectId * id = myOutPort->getId() ;
826 CORBA::Object_var obj = _poa->id_to_reference(*id) ;
827 Outobject = SUPERV::Port::_narrow(obj) ;
828 anOutPort->ObjRef( SUPERV::Port::_duplicate( Outobject ) ) ;
832 return SUPERV::Port::_duplicate( Outobject );
835 SUPERV::StreamPort_ptr CNode_Impl::GetInStreamPort( const char *aParameterName ) {
836 SUPERV::StreamPort_ptr Inobject = SUPERV::StreamPort::_nil() ;
837 if ( DataFlowEditor()->Graph()->IsDataStreamNode() ) {
838 StreamPort_Impl * myInStreamPort = NULL ;
839 GraphBase::InPort * anInPort = DataFlowNode()->GetChangeInPort( aParameterName ) ;
840 if ( anInPort && anInPort->IsDataStream() ) {
841 Inobject = SUPERV::StreamPort::_narrow( anInPort->ObjRef() ) ;
842 if ( CORBA::is_nil( Inobject ) ) {
843 myInStreamPort = new StreamPort_Impl( _Orb , _Poa , _ContId ,
844 instanceName() , interfaceName() ,
847 (GraphBase::Port * ) anInPort ,
849 if ( myInStreamPort ) {
850 PortableServer::ObjectId * id = myInStreamPort->getId() ;
851 CORBA::Object_var obj = _poa->id_to_reference(*id) ;
852 Inobject = SUPERV::StreamPort::_narrow(obj) ;
853 anInPort->ObjRef( SUPERV::StreamPort::_duplicate( Inobject ) ) ;
858 return SUPERV::StreamPort::_duplicate( Inobject ) ;
861 SUPERV::StreamPort_ptr CNode_Impl::GetOutStreamPort( const char *aParameterName ) {
862 StreamPort_Impl * myOutStreamPort = NULL ;
863 SUPERV::StreamPort_ptr Outobject = SUPERV::StreamPort::_nil() ;
864 if ( DataFlowEditor()->Graph()->IsDataStreamNode() ) {
865 GraphBase::OutPort * anOutPort = DataFlowNode()->GetChangeOutPort( aParameterName ) ;
866 if ( anOutPort && anOutPort->IsDataStream() ) {
867 Outobject = SUPERV::StreamPort::_narrow( anOutPort->ObjRef() ) ;
868 if ( CORBA::is_nil( Outobject ) ) {
869 //JR 30.03.2005 const CORBA::Any * anAny = anOutPort->Value() ;
870 const CORBA::Any anAny = anOutPort->Value() ;
871 myOutStreamPort = new StreamPort_Impl( _Orb , _Poa , _ContId ,
872 instanceName() , interfaceName() ,
875 (GraphBase::Port * ) anOutPort ,
878 if ( myOutStreamPort ) {
879 PortableServer::ObjectId * id = myOutStreamPort->getId() ;
880 CORBA::Object_var obj = _poa->id_to_reference(*id) ;
881 Outobject = SUPERV::StreamPort::_narrow(obj) ;
882 anOutPort->ObjRef( SUPERV::StreamPort::_duplicate( Outobject ) ) ;
887 return SUPERV::StreamPort::_duplicate( Outobject );
890 bool CNode_Impl::HasStreamPort() {
891 bool RetVal = false ;
892 beginService( "CNode_Impl::HasStreamPort" );
893 endService( "CNode_Impl::HasStreamPort" );
897 SUPERV::Link_ptr CNode_Impl::GetLink(const char * ToServiceParameterName ) {
899 SUPERV::Link_var iobject = SUPERV::Link::_nil() ;
901 char* FromServiceParameterName ;
902 bool status = DataFlowEditor()->GetLink( DataFlowNode()->Name() ,
903 ToServiceParameterName ,
905 & FromServiceParameterName ) ;
907 GraphBase::InPort * anInPort = DataFlowNode()->GetChangeInPort( ToServiceParameterName ) ;
908 if ( !anInPort->IsDataStream() && anInPort->GetOutPort() ) {
909 GraphBase::OutPort * anOutPort = anInPort->GetOutPort() ;
910 if ( CORBA::is_nil( anOutPort->InPortObjRef( anInPort ) ) ) {
912 beginService( "CNode_Impl::GetLink" );
916 Link_Impl * myLink = new Link_Impl( _Orb , _Poa , _ContId ,
917 instanceName() , interfaceName() ,
920 ToServiceParameterName ,
921 (GraphEditor::InNode *) DataFlowEditor()->Graph()->GetChangeGraphNode( FromNodeName )->GetInNode() ,
922 FromServiceParameterName ,
923 true , false , Success ) ;
925 PortableServer::ObjectId * id = myLink->getId() ;
926 CORBA::Object_var obj = _poa->id_to_reference(*id);
927 iobject = SUPERV::Link::_narrow(obj) ;
928 anOutPort->AddInPortObjRef( anInPort , SUPERV::Link::_duplicate( iobject ) ) ;
932 iobject = anOutPort->InPortObjRef( anInPort ) ;
937 endService( "CNode_Impl::GetLink" );
939 return SUPERV::Link::_duplicate( iobject ) ;
942 SUPERV::StreamLink_ptr CNode_Impl::GetStreamLink(const char * ToServiceParameterName ) {
944 SUPERV::StreamLink_var iobject = SUPERV::StreamLink::_nil() ;
946 char* FromServiceParameterName ;
947 if ( DataFlowEditor()->Graph()->IsDataStreamNode() ) {
948 bool status = DataFlowEditor()->GetLink( DataFlowNode()->Name() ,
949 ToServiceParameterName ,
951 & FromServiceParameterName ) ;
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 ) ) ) {
958 beginService( "CNode_Impl::GetLink" );
962 StreamLink_Impl * myStreamLink = new StreamLink_Impl(
963 _Orb , _Poa , _ContId ,
964 instanceName() , interfaceName() ,
967 ToServiceParameterName ,
968 (GraphEditor::InNode *) DataFlowEditor()->Graph()->GetChangeGraphNode( FromNodeName )->GetInNode() ,
969 FromServiceParameterName ,
972 PortableServer::ObjectId * id = myStreamLink->getId() ;
973 CORBA::Object_var obj = _poa->id_to_reference(*id);
974 iobject = SUPERV::StreamLink::_narrow(obj) ;
975 anOutPort->AddInPortObjRef( anInPort , SUPERV::StreamLink::_duplicate( iobject ) ) ;
979 iobject = SUPERV::StreamLink::_narrow( anOutPort->InPortObjRef( anInPort ) ) ;
985 endService( "CNode_Impl::GetLink" );
987 return SUPERV::StreamLink::_duplicate( iobject ) ;
990 SUPERV::ListOfPorts * CNode_Impl::Ports() {
994 SUPERV::ListOfPorts_var RetVal = new SUPERV::ListOfPorts ;
996 for ( i = 0 ; i < DataFlowNode()->GetNodeInPortsSize() ; i++ ) {
997 GraphBase::InPort * anInPort = DataFlowNode()->GetChangeNodeInPort( i ) ;
998 if ( !anInPort->IsDataStream() ) {
1000 beginService( "CNode_Impl::Ports" );
1003 if ( anInPort->IsLoop() || ( anInPort->IsGate() && anInPort->IsNotConnected() &&
1004 ( IsExecuting() || DataFlowEditor()->IsReadOnly() ) ) ) {
1005 // MESSAGE( "InPort " << i << " " << anInPort->PortName() << " of Node " << Name() << " ignored" ) ;
1007 else if ( CORBA::is_nil( anInPort->ObjRef() ) ) {
1008 // MESSAGE( "InPort " << i << " " << anInPort->PortName() << " of Node " << Name() << " IsExecuting "
1009 // << IsExecuting() << " IsGate/IsConnected " << anInPort->IsGate()
1010 // << "/" << anInPort->IsNotConnected() ) ;
1011 Port_Impl * myPort ;
1012 if ( DataFlowNode()->HasInput( anInPort->PortName() ) ) {
1013 //JR 30.03.2005 const CORBA::Any * anAny = anInPort->GetOutPort()->Value() ;
1014 const CORBA::Any anAny = anInPort->GetOutPort()->Value() ;
1015 myPort = new Port_Impl( _Orb , _Poa , _ContId ,
1016 instanceName() , interfaceName() ,
1019 (GraphBase::Port * ) anInPort ,
1024 myPort = new Port_Impl( _Orb , _Poa , _ContId ,
1025 instanceName() , interfaceName() ,
1028 (GraphBase::Port * ) anInPort ,
1031 PortableServer::ObjectId * id = myPort->getId() ;
1032 CORBA::Object_var obj = _poa->id_to_reference(*id);
1033 SUPERV::Port_var iobject ;
1034 iobject = SUPERV::Port::_narrow(obj) ;
1036 RetVal->length( PortCount ) ;
1037 RetVal[ PortCount - 1 ] = SUPERV::Port::_duplicate( iobject ) ;
1038 anInPort->ObjRef( SUPERV::Port::_duplicate( iobject ) ) ;
1041 // MESSAGE( "InPort " << i << " " << anInPort->PortName() << " of Node " << Name() ) ;
1043 RetVal->length( PortCount ) ;
1044 RetVal[ PortCount - 1 ] = SUPERV::Port::_duplicate( anInPort->ObjRef() ) ;
1048 // MESSAGE( "InPort " << i << " " << anInPort->PortName() << " of Node " << Name() << " IsDataStream" ) ;
1051 for ( i = 0 ; i < DataFlowNode()->GetNodeOutPortsSize() ; i++ ) {
1052 GraphBase::OutPort * anOutPort = DataFlowNode()->GetChangeNodeOutPort( i ) ;
1053 if ( !anOutPort->IsDataStream() ) {
1055 beginService( "CNode_Impl::Ports" );
1058 if ( anOutPort->IsLoop() || ( anOutPort->IsGate() && anOutPort->IsNotConnected() &&
1059 ( IsExecuting() || DataFlowEditor()->IsReadOnly() ) ) ) {
1060 // MESSAGE( "OutPort " << i << " " << anOutPort->PortName() << " of Node " << Name() << " ignored" ) ;
1062 else if ( CORBA::is_nil( anOutPort->ObjRef() ) ) {
1063 // MESSAGE( "OutPort " << i << " " << anOutPort->PortName() << " of Node " << Name() ) ;
1064 //JR 30.03.2005 const CORBA::Any * anAny = anOutPort->Value() ;
1065 const CORBA::Any anAny = anOutPort->Value() ;
1066 Port_Impl * myPort = new Port_Impl( _Orb , _Poa , _ContId ,
1067 instanceName() , interfaceName() ,
1070 (GraphBase::Port * ) anOutPort ,
1073 PortableServer::ObjectId * id = myPort->getId() ;
1074 CORBA::Object_var obj = _poa->id_to_reference(*id);
1075 SUPERV::Port_var iobject ;
1076 iobject = SUPERV::Port::_narrow(obj) ;
1078 RetVal->length( PortCount ) ;
1079 RetVal[ PortCount - 1 ] = SUPERV::Port::_duplicate( iobject ) ;
1080 anOutPort->ObjRef( SUPERV::Port::_duplicate( iobject ) ) ;
1083 // MESSAGE( "OutPort " << i << " " << anOutPort->PortName() << " of Node " << Name() ) ;
1085 RetVal->length( PortCount ) ;
1086 RetVal[ PortCount - 1 ] = SUPERV::Port::_duplicate( anOutPort->ObjRef() ) ;
1090 // MESSAGE( "OutPort " << i << " " << anOutPort->PortName() << " of Node " << Name() << " IsDataStream" ) ;
1095 if ( DataFlowEditor()->IsValid() ) {
1096 //DataFlowEditor()->Graph()->Values() ;
1097 RetVal->length( DataFlowEditor()->Graph()->GetNodeInDataNodePortsSize() +
1098 DataFlowEditor()->Graph()->GetNodeOutDataNodePortsSize() ) ;
1099 for ( i = 0 ; i < DataFlowEditor()->Graph()->GetNodeInDataNodePortsSize() ; i++ ) {
1100 GraphBase::OutPort * anOutPort = DataFlowEditor()->Graph()->GetChangeNodeInDataNodePort(i) ;
1101 if ( !anOutPort->IsDataStream() ) {
1102 if ( CORBA::is_nil( anOutPort->ObjRef() ) ) {
1104 beginService( "CNode_Impl::Ports" );
1107 Port_Impl * myPort ;
1108 if ( anOutPort->IsDataConnected() ) {
1109 //JR 30.03.2005 const CORBA::Any * anAny = anOutPort->Value() ;
1110 const CORBA::Any anAny = anOutPort->Value() ;
1111 myPort = new Port_Impl( _Orb , _Poa , _ContId ,
1112 instanceName() , interfaceName() ,
1115 (GraphBase::Port * ) anOutPort ,
1120 myPort = new Port_Impl( _Orb , _Poa , _ContId ,
1121 instanceName() , interfaceName() ,
1124 (GraphBase::Port * ) anOutPort ,
1127 PortableServer::ObjectId * id = myPort->getId() ;
1128 CORBA::Object_var obj = _poa->id_to_reference(*id);
1129 SUPERV::Port_var iobject ;
1130 iobject = SUPERV::Port::_narrow(obj) ;
1132 RetVal->length( PortCount ) ;
1133 RetVal[ PortCount - 1 ] = SUPERV::Port::_duplicate( iobject ) ;
1134 anOutPort->ObjRef( SUPERV::Port::_duplicate( iobject ) ) ;
1138 RetVal->length( PortCount ) ;
1139 RetVal[ PortCount - 1 ] = SUPERV::Port::_duplicate( anOutPort->ObjRef() ) ;
1145 j = DataFlowEditor()->Graph()->GetNodeInDataNodePortsSize() ;
1146 for ( i = 0 ; i < DataFlowEditor()->Graph()->GetNodeOutDataNodePortsSize() ; i++ ) {
1147 GraphBase::InPort * anInPort = DataFlowEditor()->Graph()->GetChangeNodeOutDataNodePort(i) ;
1148 if ( !anInPort->IsDataStream() ) {
1149 if ( CORBA::is_nil( anInPort->ObjRef() ) ) {
1151 beginService( "CNode_Impl::Ports" );
1154 Port_Impl * myPort ;
1155 if ( anInPort->IsDataConnected() ) {
1156 //JR 30.03.2005 const CORBA::Any * anAny = anInPort->GetOutPort()->Value() ;
1157 const CORBA::Any anAny = anInPort->GetOutPort()->Value() ;
1158 myPort = new Port_Impl( _Orb , _Poa , _ContId ,
1159 instanceName() , interfaceName() ,
1162 (GraphBase::Port * ) anInPort ,
1167 myPort = new Port_Impl( _Orb , _Poa , _ContId ,
1168 instanceName() , interfaceName() ,
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) ;
1179 RetVal->length( PortCount ) ;
1180 RetVal[ PortCount - 1 ] = SUPERV::Port::_duplicate( iobject ) ;
1181 anInPort->ObjRef( SUPERV::Port::_duplicate( iobject ) ) ;
1185 RetVal->length( PortCount ) ;
1186 RetVal[ PortCount - 1 ] = SUPERV::Port::_duplicate( anInPort->ObjRef() ) ;
1195 int RetVallength = (unsigned int ) RetVal->length() ;
1196 for ( i = 0 ; i < RetVallength ; i++ ) {
1197 MESSAGE( "Port " << i << " " << RetVal[i]->Name() << " of Node " << Name() ) ;
1201 endService( "CNode_Impl::Ports " ) ;
1203 return ( RetVal._retn() ) ;
1206 SUPERV::ListOfStreamPorts * CNode_Impl::StreamPorts() {
1210 SUPERV::ListOfStreamPorts_var RetVal = new SUPERV::ListOfStreamPorts ;
1211 if ( !DataFlowEditor()->Graph()->IsDataStreamNode() ) {
1212 // MESSAGE("CNode_Impl::StreamPorts NOT a DataStreamNode" ) ;
1214 else if ( _IsNode ) {
1215 // RetVal->length( DataFlowNode()->GetNodeInPortsSize() +
1216 // DataFlowNode()->GetNodeOutPortsSize() ) ;
1217 for ( i = 0 ; i < DataFlowNode()->GetNodeInPortsSize() ; i++ ) {
1218 GraphBase::InPort * anInPort = DataFlowNode()->GetChangeNodeInPort( i ) ;
1219 if ( anInPort->IsDataStream() ) {
1221 beginService( "CNode_Impl::StreamPorts" );
1224 if ( anInPort->IsLoop() || ( anInPort->IsGate() && anInPort->IsNotConnected() &&
1225 ( IsExecuting() || DataFlowEditor()->IsReadOnly() ) ) ) {
1226 MESSAGE( "InStreamPort " << i << " " << anInPort->PortName() << " of Node " << Name() << " ignored" ) ;
1227 // RetVal[ i ] = SUPERV::StreamPort::_duplicate( SUPERV::StreamPort::_narrow( CORBA::Object::_nil() ) ) ;
1229 else if ( CORBA::is_nil( anInPort->ObjRef() ) ) {
1230 MESSAGE( "InStreamPort " << i << " " << anInPort->PortName() << " of Node " << Name() << " IsExecuting "
1231 << IsExecuting() << " IsGate/IsConnected " << anInPort->IsGate()
1232 << "/" << anInPort->IsNotConnected() ) ;
1233 StreamPort_Impl * myStreamPort ;
1234 if ( DataFlowNode()->HasInput( anInPort->PortName() ) ) {
1235 //JR 30.03.2005 const CORBA::Any * anAny = anInPort->GetOutPort()->Value() ;
1236 const CORBA::Any anAny = anInPort->GetOutPort()->Value() ;
1237 myStreamPort = new StreamPort_Impl( _Orb , _Poa , _ContId ,
1238 instanceName() , interfaceName() ,
1241 (GraphBase::Port * ) anInPort ,
1246 myStreamPort = new StreamPort_Impl( _Orb , _Poa , _ContId ,
1247 instanceName() , interfaceName() ,
1250 (GraphBase::Port * ) anInPort ,
1253 PortableServer::ObjectId * id = myStreamPort->getId() ;
1254 CORBA::Object_var obj = _poa->id_to_reference(*id);
1255 SUPERV::StreamPort_var iobject ;
1256 iobject = SUPERV::StreamPort::_narrow(obj) ;
1258 RetVal->length( PortCount ) ;
1259 RetVal[ PortCount - 1 ] = SUPERV::StreamPort::_duplicate( iobject ) ;
1260 anInPort->ObjRef( SUPERV::StreamPort::_duplicate( iobject ) ) ;
1263 MESSAGE( "InStreamPort " << i << " " << anInPort->PortName() << " of Node " << Name() ) ;
1265 RetVal->length( PortCount ) ;
1266 RetVal[ PortCount - 1 ] = SUPERV::StreamPort::_duplicate( SUPERV::StreamPort::_narrow( anInPort->ObjRef() ) ) ;
1270 // RetVal[ i ] = SUPERV::StreamPort::_duplicate( SUPERV::StreamPort::_narrow( CORBA::Object::_nil() ) ) ;
1273 for ( i = 0 ; i < DataFlowNode()->GetNodeOutPortsSize() ; i++ ) {
1274 GraphBase::OutPort * anOutPort = DataFlowNode()->GetChangeNodeOutPort( i ) ;
1275 if ( anOutPort->IsDataStream() ) {
1277 beginService( "CNode_Impl::StreamPorts" );
1280 if ( anOutPort->IsLoop() || ( anOutPort->IsGate() && anOutPort->IsNotConnected() &&
1281 ( IsExecuting() || DataFlowEditor()->IsReadOnly() ) ) ) {
1282 MESSAGE( "OutStreamPort " << i << " " << anOutPort->PortName() << " of Node " << Name() << " ignored" ) ;
1283 // RetVal[ DataFlowNode()->GetNodeInPortsSize() + i ] = SUPERV::StreamPort::_duplicate( SUPERV::StreamPort::_narrow( CORBA::Object::_nil() ) ) ;
1285 else if ( CORBA::is_nil( anOutPort->ObjRef() ) ) {
1286 MESSAGE( "OutStreamPort " << i << " " << anOutPort->PortName() << " of Node " << Name() ) ;
1287 //JR 30.03.2005 const CORBA::Any * anAny = anOutPort->Value() ;
1288 const CORBA::Any anAny = anOutPort->Value() ;
1289 StreamPort_Impl * myStreamPort = new StreamPort_Impl( _Orb , _Poa , _ContId ,
1290 instanceName() , interfaceName() ,
1293 (GraphBase::Port * ) anOutPort ,
1296 PortableServer::ObjectId * id = myStreamPort->getId() ;
1297 CORBA::Object_var obj = _poa->id_to_reference(*id);
1298 SUPERV::StreamPort_var iobject ;
1299 iobject = SUPERV::StreamPort::_narrow(obj) ;
1301 RetVal->length( PortCount ) ;
1302 RetVal[ PortCount - 1 ] = SUPERV::StreamPort::_duplicate( iobject ) ;
1303 anOutPort->ObjRef( SUPERV::StreamPort::_duplicate( iobject ) ) ;
1306 MESSAGE( "OutStreamPort " << i << " " << anOutPort->PortName() << " of Node " << Name() ) ;
1308 RetVal->length( PortCount ) ;
1309 RetVal[ PortCount - 1 ] = SUPERV::StreamPort::_duplicate( SUPERV::StreamPort::_narrow( anOutPort->ObjRef() ) ) ;
1313 // RetVal[ i ] = SUPERV::StreamPort::_duplicate( SUPERV::StreamPort::_narrow( CORBA::Object::_nil() ) ) ;
1318 if ( DataFlowEditor()->IsValid() ) {
1319 // RetVal->length( DataFlowEditor()->Graph()->GetNodeInDataNodePortsSize() +
1320 // DataFlowEditor()->Graph()->GetNodeOutDataNodePortsSize() ) ;
1321 for ( i = 0 ; i < DataFlowEditor()->Graph()->GetNodeInDataNodePortsSize() ; i++ ) {
1322 GraphBase::OutPort * anOutPort = DataFlowEditor()->Graph()->GetChangeNodeInDataNodePort(i) ;
1323 if ( anOutPort->IsDataStream() ) {
1324 if ( CORBA::is_nil( anOutPort->ObjRef() ) ) {
1326 beginService( "CNode_Impl::StreamPorts" );
1329 StreamPort_Impl * myStreamPort ;
1330 if ( anOutPort->IsDataConnected() ) {
1331 //JR 30.03.2005 const CORBA::Any * anAny = anOutPort->Value() ;
1332 const CORBA::Any anAny = anOutPort->Value() ;
1333 myStreamPort = new StreamPort_Impl( _Orb , _Poa , _ContId ,
1334 instanceName() , interfaceName() ,
1337 (GraphBase::Port * ) anOutPort ,
1342 myStreamPort = new StreamPort_Impl( _Orb , _Poa , _ContId ,
1343 instanceName() , interfaceName() ,
1346 (GraphBase::Port * ) anOutPort ,
1349 PortableServer::ObjectId * id = myStreamPort->getId() ;
1350 CORBA::Object_var obj = _poa->id_to_reference(*id);
1351 SUPERV::StreamPort_var iobject ;
1352 iobject = SUPERV::StreamPort::_narrow(obj) ;
1354 RetVal->length( PortCount ) ;
1355 RetVal[ PortCount - 1 ] = SUPERV::StreamPort::_duplicate( iobject ) ;
1356 anOutPort->ObjRef( SUPERV::StreamPort::_duplicate( iobject ) ) ;
1360 RetVal->length( PortCount ) ;
1361 RetVal[ PortCount - 1 ] = SUPERV::StreamPort::_duplicate( SUPERV::StreamPort::_narrow( anOutPort->ObjRef() ) ) ;
1365 // RetVal[ i ] = SUPERV::StreamPort::_duplicate( SUPERV::StreamPort::_narrow( CORBA::Object::_nil() ) ) ;
1368 j = DataFlowEditor()->Graph()->GetNodeInDataNodePortsSize() ;
1369 for ( i = 0 ; i < DataFlowEditor()->Graph()->GetNodeOutDataNodePortsSize() ; i++ ) {
1370 GraphBase::InPort * anInPort = DataFlowEditor()->Graph()->GetChangeNodeOutDataNodePort(i) ;
1371 if ( anInPort->IsDataStream() ) {
1372 if ( CORBA::is_nil( anInPort->ObjRef() ) ) {
1374 beginService( "CNode_Impl::StreamPorts" );
1377 StreamPort_Impl * myStreamPort ;
1378 if ( anInPort->IsDataConnected() ) {
1379 //JR 30.03.2005 const CORBA::Any * anAny = anInPort->GetOutPort()->Value() ;
1380 const CORBA::Any anAny = anInPort->GetOutPort()->Value() ;
1381 myStreamPort = new StreamPort_Impl( _Orb , _Poa , _ContId ,
1382 instanceName() , interfaceName() ,
1385 (GraphBase::Port * ) anInPort ,
1390 myStreamPort = new StreamPort_Impl( _Orb , _Poa , _ContId ,
1391 instanceName() , interfaceName() ,
1397 PortableServer::ObjectId * id = myStreamPort->getId() ;
1398 CORBA::Object_var obj = _poa->id_to_reference(*id);
1399 SUPERV::StreamPort_var iobject ;
1400 iobject = SUPERV::StreamPort::_narrow(obj) ;
1402 RetVal->length( PortCount ) ;
1403 RetVal[ PortCount - 1 ] = SUPERV::StreamPort::_duplicate( iobject ) ;
1404 anInPort->ObjRef( SUPERV::StreamPort::_duplicate( iobject ) ) ;
1408 RetVal->length( PortCount ) ;
1409 RetVal[ PortCount - 1 ] = SUPERV::StreamPort::_duplicate( SUPERV::StreamPort::_narrow( anInPort->ObjRef() ) ) ;
1413 // RetVal[ i ] = SUPERV::StreamPort::_duplicate( SUPERV::StreamPort::_narrow( CORBA::Object::_nil() ) ) ;
1418 // int RetVallength = (unsigned int ) RetVal->length() ;
1419 // for ( i = 0 ; i < RetVallength ; i++ ) {
1420 // MESSAGE( "StreamPort " << i << " " << RetVal[i]->Name() << " of Node " << Name() ) ;
1423 endService( "CNode_Impl::StreamPorts " ) ;
1425 return ( RetVal._retn() ) ;
1428 SUPERV::ListOfLinks * CNode_Impl::Links() {
1429 beginService( "CNode_Impl::Links" ) ;
1430 SUPERV::ListOfLinks_var RetVal = new SUPERV::ListOfLinks ;
1431 if ( DataFlowNode() ) {
1432 // MESSAGE( "CNode_Impl::Links " << DataFlowEditor() << " " << DataFlowEditor()->Graph() << " " << DataFlowEditor()->Graph()->ObjImpl() << " " << DataFlowNode()->ComputingNode() << " " << DataFlowNode()->ComputingNode()->Name() ) ;
1433 RetVal = ((Graph_Impl * ) DataFlowEditor()->Graph()->ObjImpl())->Links( DataFlowNode()->ComputingNode() , NULL ) ;
1436 RetVal = ((Graph_Impl * ) DataFlowEditor()->Graph()->ObjImpl())->Links( NULL , NULL ) ;
1438 MESSAGE( "CNode_Impl::Links " << RetVal->length() << " Links" ) ;
1439 endService( "CNode_Impl::Links" ) ;
1440 return ( RetVal._retn() ) ;
1443 SUPERV::ListOfStreamLinks * CNode_Impl::StreamLinks() {
1444 beginService( "CNode_Impl::StreamLinks" ) ;
1445 SUPERV::ListOfStreamLinks_var RetVal = new SUPERV::ListOfStreamLinks ;
1446 if ( DataFlowNode() && DataFlowEditor()->Graph()->IsDataStreamNode() ) {
1447 RetVal = ((StreamGraph_Impl *) (DataFlowEditor()->StreamGraph()->ObjImpl()))->StreamLinks( DataFlowNode()->ComputingNode() , NULL ) ;
1449 else if ( DataFlowEditor()->Graph()->IsDataStreamNode() ) {
1450 RetVal = ((StreamGraph_Impl *) (DataFlowEditor()->StreamGraph()->ObjImpl()))->StreamLinks( NULL , NULL ) ;
1452 MESSAGE( "CNode_Impl::StreamLinks " << RetVal->length() << " StreamLinks" ) ;
1453 endService( "CNode_Impl::StreamLinks" ) ;
1454 return ( RetVal._retn() ) ;
1457 long CNode_Impl::SubGraph() {
1458 // beginService( "CNode_Impl::SubGraph" );
1461 RetVal = DataFlowNode()->SubGraph() ;
1463 // endService( "CNode_Impl::SubGraph" );
1467 long CNode_Impl::SubStreamGraph() {
1468 // beginService( "CNode_Impl::SubStreamGraph" );
1471 RetVal = DataFlowNode()->SubStreamGraph() ;
1473 // endService( "CNode_Impl::SubStreamGraph" );
1477 bool CNode_Impl::IsLinked(const char * ServiceParameterName ) {
1478 beginService( "CNode_Impl::IsLinked" );
1479 bool RetVal = DataFlowNode()->IsLinked( ServiceParameterName ) ;
1480 MESSAGE( Name() << "->IsLinked( '" << ServiceParameterName << "' )" ) ;
1481 endService( "CNode_Impl::IsLinked" );
1485 bool CNode_Impl::HasInput(const char * ServiceParameterName ) {
1486 // beginService( "CNode_Impl::HasInput" );
1487 bool RetVal = DataFlowNode()->HasInput( ServiceParameterName ) ;
1488 // endService( "CNode_Impl::HasInput" );
1492 SUPERV::GraphState CNode_Impl::State() {
1493 // beginService( "CNode_Impl::State" );
1494 SUPERV::GraphState RetVal = SUPERV::EditingState ;
1495 GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ;
1496 if ( aDataFlowExecutor && !DataFlowEditor()->EditedAfterExecution() ) {
1497 //JR : 12/06/03 if ( aDataFlowExecutor ) {
1499 RetVal = aDataFlowExecutor->State( Name() ) ;
1502 RetVal = aDataFlowExecutor->State() ;
1505 // endService( "CNode_Impl::State" );
1508 long CNode_Impl::Thread() {
1509 // beginService( "CNode_Impl::Thread" );
1511 GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ;
1512 if ( aDataFlowExecutor ) {
1514 RetVal = aDataFlowExecutor->Thread( Name() ) ;
1517 RetVal = aDataFlowExecutor->Thread() ;
1520 // endService( "CNode_Impl::Thread" );
1523 GraphExecutor::AutomatonState CNode_Impl::AutoState() {
1524 // beginService( "CNode_Impl::AutoState" );
1525 GraphExecutor::AutomatonState RetVal = GraphExecutor::UnKnownState ;
1526 GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ;
1527 if ( aDataFlowExecutor ) {
1529 RetVal = aDataFlowExecutor->AutomatonState( Name() ) ;
1532 RetVal = aDataFlowExecutor->AutomatonState() ;
1535 // endService( "CNode_Impl::AutoState" );
1538 SUPERV::ControlState CNode_Impl::Control() {
1539 // beginService( "CNode_Impl::Control" );
1540 SUPERV::ControlState RetVal = SUPERV::VoidState ;
1541 GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ;
1542 if ( aDataFlowExecutor ) {
1544 RetVal = aDataFlowExecutor->ControlState( Name() ) ;
1547 RetVal = aDataFlowExecutor->ControlState() ;
1550 // endService( "CNode_Impl::Control" );
1553 void CNode_Impl::ControlClear() {
1554 // beginService( "CNode_Impl::ControlClear" );
1555 // SUPERV::ControlState RetVal = SUPERV::VoidState ;
1556 GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ;
1557 if ( aDataFlowExecutor ) {
1559 aDataFlowExecutor->ControlClear( Name() ) ;
1562 aDataFlowExecutor->ControlClear() ;
1565 // endService( "CNode_Impl::ControlClear" );
1569 bool CNode_Impl::IsReady() {
1570 // beginService( "CNode_Impl::IsReady" );
1571 bool RetVal = false ;
1572 GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ;
1573 if ( aDataFlowExecutor ) {
1575 RetVal = aDataFlowExecutor->IsReady( Name() ) ;
1578 RetVal = aDataFlowExecutor->IsReady() ;
1581 // endService( "CNode_Impl::IsReady" );
1585 bool CNode_Impl::IsWaiting() {
1586 // beginService( "CNode_Impl::IsWaiting" );
1587 bool RetVal = false ;
1588 GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ;
1589 if ( aDataFlowExecutor ) {
1591 RetVal = aDataFlowExecutor->IsWaiting( Name() ) ;
1594 RetVal = aDataFlowExecutor->IsWaiting() ;
1597 // endService( "CNode_Impl::IsWaiting" );
1601 bool CNode_Impl::IsRunning() {
1602 // beginService( "CNode_Impl::IsRunning" );
1603 bool RetVal = false ;
1604 GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ;
1605 if ( aDataFlowExecutor ) {
1607 RetVal = aDataFlowExecutor->IsRunning( Name() ) ;
1610 RetVal = aDataFlowExecutor->IsRunning() ;
1613 // endService( "CNode_Impl::IsRunning" );
1617 bool CNode_Impl::IsDone() {
1618 // beginService( "CNode_Impl::IsDone" );
1619 bool RetVal = false ;
1620 GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ;
1621 if ( aDataFlowExecutor ) {
1623 RetVal = aDataFlowExecutor->IsDone( Name() ) ;
1626 RetVal = aDataFlowExecutor->IsDone() ;
1629 // endService( "CNode_Impl::IsDone" );
1633 bool CNode_Impl::IsSuspended() {
1634 // beginService( "CNode_Impl::IsSuspended" );
1635 bool RetVal = false ;
1636 GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ;
1637 if ( aDataFlowExecutor ) {
1639 RetVal = aDataFlowExecutor->IsSuspended( Name() ) ;
1642 RetVal = aDataFlowExecutor->IsSuspended() ;
1645 // endService( "CNode_Impl::IsSuspended" );
1649 bool CNode_Impl::ReadyW() {
1650 // beginService( "CNode_Impl::ReadyW" );
1651 bool RetVal = false ;
1652 GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ;
1653 if ( aDataFlowExecutor ) {
1655 RetVal = aDataFlowExecutor->ReadyWait( Name() ) ;
1658 RetVal = aDataFlowExecutor->ReadyWait() ;
1661 // endService( "CNode_Impl::ReadyW" );
1665 bool CNode_Impl::RunningW() {
1666 // beginService( "CNode_Impl::RunningW" );
1667 bool RetVal = false ;
1668 GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ;
1669 if ( aDataFlowExecutor ) {
1671 RetVal = aDataFlowExecutor->RunningWait( Name() ) ;
1674 RetVal = aDataFlowExecutor->RunningWait() ;
1677 // endService( "CNode_Impl::RunningW" );
1681 bool CNode_Impl::DoneW() {
1682 // beginService( "CNode_Impl::DoneW" );
1683 bool RetVal = false ;
1684 GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ;
1685 if ( aDataFlowExecutor ) {
1687 RetVal = aDataFlowExecutor->DoneWait( Name() ) ;
1690 RetVal = aDataFlowExecutor->DoneWait() ;
1693 // endService( "CNode_Impl::DoneW" );
1697 bool CNode_Impl::SuspendedW() {
1698 // beginService( "CNode_Impl::SuspendedW" );
1699 bool RetVal = false ;
1700 GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ;
1701 if ( aDataFlowExecutor ) {
1703 RetVal = aDataFlowExecutor->SuspendedWait( Name() ) ;
1706 RetVal = aDataFlowExecutor->SuspendedWait() ;
1709 // endService( "CNode_Impl::SuspendedW" );
1713 void CNode_Impl::ping() {
1714 // beginService( "CNode_Impl::ping" );
1715 bool RetVal = false ;
1716 GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ;
1717 if ( aDataFlowExecutor ) {
1719 RetVal = aDataFlowExecutor->Ping( Name() ) ;
1725 // endService( "CNode_Impl::ping" );
1729 bool CNode_Impl::ContainerKill() {
1730 beginService( "CNode_Impl::ContainerKill" );
1731 bool RetVal = false ;
1732 GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ;
1733 if ( aDataFlowExecutor && IsExecuting() ) {
1735 RetVal = aDataFlowExecutor->ContainerKill( Name() ) ;
1738 RetVal = aDataFlowExecutor->ContainerKill() ;
1741 endService( "CNode_Impl::ContainerKill" );
1744 bool CNode_Impl::Kill() {
1745 beginService( "CNode_Impl::Kill" );
1746 bool RetVal = false ;
1747 GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ;
1748 if ( aDataFlowExecutor ) {
1750 RetVal = aDataFlowExecutor->Kill( Name() ) ;
1751 MESSAGE( "Node " << Name() << " execution was killed : " << RetVal ) ;
1754 RetVal = aDataFlowExecutor->Kill() ;
1755 MESSAGE( "Graph execution was killed : " << RetVal ) ;
1758 endService( "CNode_Impl::Kill" );
1761 bool CNode_Impl::KillDone() {
1762 // beginService( "CNode_Impl::KillDone" );
1763 bool RetVal = false ;
1764 GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ;
1765 if ( aDataFlowExecutor ) {
1767 RetVal = aDataFlowExecutor->KillDone( Name() ) ;
1770 // endService( "CNode_Impl::KillDone" );
1773 bool CNode_Impl::Stop() {
1774 // beginService( "CNode_Impl::Stop" );
1775 bool RetVal ; // = aDataFlowExecutor->Stop() ;
1776 // endService( "CNode_Impl::Stop" );
1779 bool CNode_Impl::Suspend() {
1780 beginService( "CNode_Impl::Suspend" );
1781 bool RetVal = false ;
1782 GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ;
1783 if ( aDataFlowExecutor ) {
1785 MESSAGE( "CNode_Impl::Suspend " << Name() ) ;
1786 RetVal = aDataFlowExecutor->Suspend( Name() ) ;
1789 MESSAGE( "CNode_Impl::Suspend " << aDataFlowExecutor->Graph()->Name() ) ;
1790 RetVal = aDataFlowExecutor->Suspend() ;
1793 endService( "CNode_Impl::Suspend" );
1796 bool CNode_Impl::SuspendDone() {
1797 // beginService( "CNode_Impl::SuspendDone" );
1798 bool RetVal = false ;
1799 GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ;
1800 if ( aDataFlowExecutor ) {
1802 RetVal = aDataFlowExecutor->SuspendDone( Name() ) ;
1805 RetVal = aDataFlowExecutor->SuspendDone() ;
1808 // endService( "CNode_Impl::SuspendDone" );
1811 bool CNode_Impl::Resume() {
1812 bool RetVal = false ;
1813 beginService( "CNode_Impl::Resume" );
1814 GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ;
1815 if ( aDataFlowExecutor ) {
1817 MESSAGE( "CNode_Impl::Resume " << Name() ) ;
1818 RetVal = aDataFlowExecutor->Resume( Name() ) ;
1821 MESSAGE( "CNode_Impl::Resume " << aDataFlowExecutor->Graph()->Name() ) ;
1822 RetVal = aDataFlowExecutor->Resume() ;
1825 endService( "CNode_Impl::Resume" );
1829 long CNode_Impl::CpuUsed() {
1831 GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ;
1832 if ( aDataFlowExecutor ) {
1834 RetVal = aDataFlowExecutor->CpuUsed( Name() ) ;
1837 RetVal = aDataFlowExecutor->CpuUsed() ;
1843 bool CNode_Impl::IsExecuting() {
1844 bool RetVal = false;
1845 if ( !IsMacro() && DataFlowEditor() && DataFlowEditor()->Executor() ) {
1846 // asv : the statement below normally does not return true, Executor_OutNode
1847 // sets Editor->Editing() after finishing of execution (see Executor_OutNode.cxx)
1848 if ( DataFlowEditor()->IsExecuting() && DataFlowEditor()->Executor()->IsDone() ) {
1849 DataFlowEditor()->Editing();
1852 RetVal = DataFlowEditor()->IsExecuting();