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 Engines_Component_i(orb, poa, contId, instanceName, interfaceName, false, false) {
33 // MESSAGE("CNode_Impl::CNode_Impl activate object instanceName("
34 // << instanceName << ") interfaceName(" << interfaceName << ") --> "
35 // << hex << (void *) this << dec )
37 // _id = _poa->activate_object(_thisObj);
38 // MESSAGE( "CNode_Impl::CNode_Impl " << aDataFlowName << " " );
39 beginService( "CNode_Impl::CNode_Impl" );
40 _Orb = CORBA::ORB::_duplicate(orb);
43 _DataFlowNode = NULL ;
45 endService( "CNode_Impl::CNode_Impl" );
48 CNode_Impl::CNode_Impl() {
51 CNode_Impl::CNode_Impl( CORBA::ORB_ptr orb ,
52 PortableServer::POA_ptr poa ,
53 PortableServer::ObjectId * contId ,
54 const char *instanceName ,
55 const char *interfaceName ,
56 GraphEditor::DataFlow * DataFlowEditor ,
57 const SALOME_ModuleCatalog::Service &NodeService ,
58 const char * NodeName ,
59 const SUPERV::KindOfNode NodeKindOfNode ,
60 const char * FuncName ,
61 const SUPERV::ListOfStrings & PythonFunction ) :
62 Engines_Component_i(orb, poa, contId, instanceName, interfaceName, false, false) {
63 beginService( "CNode_Impl::CNode_Impl" );
64 // cout << "CNode_Impl::CNode_Impl -->" << endl ;
65 // if ( FuncName && NodeName ) {
66 // cout << "CNode_Impl::CNode_Impl " << (void *) NodeName << " " << NodeName
67 // << " " << strlen(NodeName) << " " << (void *) FuncName << " " << FuncName
68 // << " " << strlen( FuncName ) << endl ;
70 if ( NodeKindOfNode == SUPERV::ComputingNode ) {
71 MESSAGE( "CNode_Impl::CNode_Impl " << FuncName << " _poa->activate_object" );
73 _id = _poa->activate_object(_thisObj);
75 _Orb = CORBA::ORB::_duplicate(orb);
78 _DataFlowEditor = DataFlowEditor ;
79 GraphBase::ListOfFuncName aFuncName ;
80 GraphBase::ListOfPythonFunctions aPythonFunction ;
83 aFuncName[0] = my_strdup( FuncName ) ;
84 aPythonFunction.resize(1) ;
85 aPythonFunction[0] = &PythonFunction ;
87 _DataFlowNode = _DataFlowEditor->AddNode( NodeService , "" , "" , NodeName ,
92 endService( "CNode_Impl::CNode_Impl" );
93 // cout << "<-- CNode_Impl::CNode_Impl" << endl ;
96 CNode_Impl::CNode_Impl( CORBA::ORB_ptr orb ,
97 PortableServer::POA_ptr poa ,
98 PortableServer::ObjectId * contId ,
99 const char *instanceName ,
100 const char *interfaceName ,
101 GraphEditor::DataFlow * DataFlowEditor ,
102 const SALOME_ModuleCatalog::Service &NodeService ,
103 const char * NodeName ,
104 const SUPERV::KindOfNode NodeKindOfNode ,
105 const GraphBase::ListOfFuncName & aFuncName ,
106 const GraphBase::ListOfPythonFunctions & aPythonFunction ) :
107 Engines_Component_i(orb, poa, contId, instanceName, interfaceName, false, false) {
108 MESSAGE( NodeName << " " );
109 beginService( "CNode_Impl::CNode_Impl" );
111 MESSAGE("CNode_Impl::CNode_Impl " << NodeName << " " << strlen( NodeName ) ) ;
113 if ( NodeKindOfNode == SUPERV::ComputingNode ) {
114 MESSAGE( "CNode_Impl::CNode_Impl " << aFuncName[0] << " _poa->activate_object" );
116 _id = _poa->activate_object(_thisObj);
118 _Orb = CORBA::ORB::_duplicate(orb);
121 _DataFlowEditor = DataFlowEditor ;
122 _DataFlowNode = _DataFlowEditor->AddNode( NodeService , "" , "" , NodeName ,
127 endService( "CNode_Impl::CNode_Impl" );
130 CNode_Impl::CNode_Impl( CORBA::ORB_ptr orb ,
131 PortableServer::POA_ptr poa ,
132 PortableServer::ObjectId * contId ,
133 const char *instanceName ,
134 const char *interfaceName ,
135 GraphEditor::DataFlow * DataFlowEditor ,
136 GraphEditor::InNode * DataFlowNode ) :
137 Engines_Component_i(orb, poa, contId, instanceName, interfaceName, false, false) {
138 MESSAGE( DataFlowNode->Name() << " " );
139 beginService( "CNode_Impl::CNode_Impl" );
140 if ( DataFlowNode->IsComputingNode() ) {
141 MESSAGE( "CNode_Impl::CNode_Impl _poa->activate_object" );
143 _id = _poa->activate_object(_thisObj);
146 MESSAGE( "CNode_Impl::CNode_Impl NO _poa->activate_object " );
148 _Orb = CORBA::ORB::_duplicate(orb);
151 _DataFlowEditor = DataFlowEditor ;
152 _DataFlowNode = DataFlowNode ;
154 endService( "CNode_Impl::CNode_Impl" );
157 CNode_Impl::~CNode_Impl() {
158 beginService( "CNode_Impl::~CNode_Impl" );
159 endService( "CNode_Impl::~CNode_Impl" );
162 void CNode_Impl::destroy() {
163 beginService( "CNode_Impl::Destroy" );
164 if ( _DataFlowEditor->IsEditing() ) {
166 _DataFlowNode = NULL ;
167 _poa->deactivate_object(*_id) ;
168 CORBA::release(_poa) ;
170 _thisObj->_remove_ref();
173 // endService( "CNode_Impl::Destroy" );
176 bool CNode_Impl::Delete() {
177 beginService( "CNode_Impl::Delete" );
178 bool RetVal = false ;
179 if ( _DataFlowEditor->IsEditing() ) {
180 RetVal = _DataFlowEditor->RemoveNode( Name() ) ;
182 RetVal = _DataFlowEditor->UnValid() ;
185 endService( "CNode_Impl::Delete" );
189 SALOME_ModuleCatalog::Service * CNode_Impl::Service() {
190 // beginService( "CNode_Impl::Service" );
191 SALOME_ModuleCatalog::Service * RetVal ;
193 RetVal = new SALOME_ModuleCatalog::Service( *_DataFlowNode->GetService() ) ;
196 RetVal = new SALOME_ModuleCatalog::Service( *_DataFlowEditor->GetService() ) ;
198 // endService( "CNode_Impl::Service" );
202 char * CNode_Impl::Name() {
203 // beginService( "CNode_Impl::Name" );
204 char * RetVal = NULL ;
206 RetVal = _DataFlowNode->Name() ;
209 RetVal = _DataFlowEditor->Graph()->Name() ;
211 // endService( "CNode_Impl::Name" );
212 return CORBA::string_dup( RetVal );
214 bool CNode_Impl::SetName( const char * aDataFlowName ) {
215 // beginService( "CNode_Impl::SetName" );
216 bool RetVal = false ;
217 if ( _DataFlowEditor->IsEditing() ) {
219 RetVal = _DataFlowEditor->ReNameNode( _DataFlowNode->Name() ,
223 RetVal = _DataFlowEditor->Graph()->Name( aDataFlowName ) ;
226 // endService( "CNode_Impl::SetName" );
229 SUPERV::KindOfNode CNode_Impl::Kind() {
230 // beginService( "CNode_Impl::Kind" );
231 SUPERV::KindOfNode RetVal = SUPERV::UnknownNode ;
233 RetVal = _DataFlowNode->Kind() ;
236 RetVal = _DataFlowEditor->Graph()->Kind() ;
238 // endService( "CNode_Impl::Kind" );
241 bool CNode_Impl::IsGraph() {
242 // beginService( "CNode_Impl::IsGraph" );
243 bool RetVal = false ;
245 RetVal = _DataFlowNode->IsDataFlowNode() ;
248 RetVal = _DataFlowEditor->Graph()->IsDataFlowNode() ;
250 // endService( "CNode_Impl::IsGraph" );
253 bool CNode_Impl::IsStreamGraph() {
254 // beginService( "CNode_Impl::IsStreamGraph" );
255 bool RetVal = false ;
257 RetVal = _DataFlowNode->IsDataStreamNode() ;
260 RetVal = _DataFlowEditor->Graph()->IsDataStreamNode() ;
262 // endService( "CNode_Impl::IsStreamGraph" );
265 bool CNode_Impl::IsComputing() {
266 // beginService( "CNode_Impl::IsComputing" );
267 bool RetVal = SUPERV::UnknownNode ;
269 RetVal = _DataFlowNode->IsComputingNode() ;
272 RetVal = _DataFlowEditor->Graph()->IsComputingNode() ;
274 // endService( "CNode_Impl::IsComputing" );
277 bool CNode_Impl::IsFactory() {
278 // beginService( "CNode_Impl::IsFactory" );
279 bool RetVal = SUPERV::UnknownNode ;
281 RetVal = _DataFlowNode->IsFactoryNode() ;
284 RetVal = _DataFlowEditor->Graph()->IsFactoryNode() ;
286 // endService( "CNode_Impl::IsFactory" );
289 bool CNode_Impl::IsInLine() {
290 // beginService( "CNode_Impl::IsInLine" );
291 bool RetVal = SUPERV::UnknownNode ;
293 RetVal = _DataFlowNode->IsInLineNode() ;
296 RetVal = _DataFlowEditor->Graph()->IsInLineNode() ;
298 // endService( "CNode_Impl::IsInLine" );
301 bool CNode_Impl::IsGOTO() {
302 // beginService( "CNode_Impl::IsGOTO" );
303 bool RetVal = SUPERV::UnknownNode ;
305 RetVal = _DataFlowNode->IsGOTONode() ;
308 RetVal = _DataFlowEditor->Graph()->IsGOTONode() ;
310 // endService( "CNode_Impl::IsGOTO" );
313 bool CNode_Impl::IsLoop() {
314 // beginService( "CNode_Impl::IsLoop" );
315 bool RetVal = SUPERV::UnknownNode ;
317 RetVal = _DataFlowNode->IsLoopNode() ;
320 RetVal = _DataFlowEditor->Graph()->IsLoopNode() ;
322 // endService( "CNode_Impl::IsLoop" );
325 bool CNode_Impl::IsEndLoop() {
326 // beginService( "CNode_Impl::IsEndLoop" );
327 bool RetVal = SUPERV::UnknownNode ;
329 RetVal = _DataFlowNode->IsEndLoopNode() ;
332 RetVal = _DataFlowEditor->Graph()->IsEndLoopNode() ;
334 // endService( "CNode_Impl::IsEndLoop" );
337 bool CNode_Impl::IsSwitch() {
338 // beginService( "CNode_Impl::IsSwitch" );
339 bool RetVal = SUPERV::UnknownNode ;
341 RetVal = _DataFlowNode->IsSwitchNode() ;
344 RetVal = _DataFlowEditor->Graph()->IsSwitchNode() ;
346 // endService( "CNode_Impl::IsSwitch" );
349 bool CNode_Impl::IsEndSwitch() {
350 // beginService( "CNode_Impl::IsEndSwitch" );
351 bool RetVal = SUPERV::UnknownNode ;
353 RetVal = _DataFlowNode->IsEndSwitchNode() ;
356 RetVal = _DataFlowEditor->Graph()->IsEndSwitchNode() ;
358 // endService( "CNode_Impl::IsEndSwitch" );
362 SUPERV::SDate CNode_Impl::CreationDate() {
363 // beginService( "CNode_Impl::CreationDate" );
364 SUPERV::SDate_var RetVal ;
366 RetVal = new SUPERV::SDate( _DataFlowNode->FirstCreation() ) ;
369 // cout << " CNode_Impl::CreationDate " << _DataFlowEditor->FirstCreation()
371 RetVal = new SUPERV::SDate( _DataFlowEditor->Graph()->FirstCreation() ) ;
373 // endService( "CNode_Impl::CreationDate" );
374 return (RetVal._retn()) ;
376 SUPERV::SDate CNode_Impl::LastUpdateDate() {
377 // beginService( "CNode_Impl::LastUpdateDate" );
378 SUPERV::SDate_var RetVal ;
380 RetVal = new SUPERV::SDate( _DataFlowNode->LastModification() ) ;
383 RetVal = new SUPERV::SDate( _DataFlowEditor->Graph()->LastModification() ) ;
385 // endService( "CNode_Impl::LastUpdateDate" );
386 return (RetVal._retn()) ;
388 char * CNode_Impl::Version() {
389 // beginService( "CNode_Impl::Version" );
392 RetVal = _DataFlowNode->EditorRelease() ;
395 RetVal = _DataFlowEditor->Graph()->EditorRelease() ;
397 // endService( "CNode_Impl::Version" );
398 return CORBA::string_dup( RetVal ) ;
400 char * CNode_Impl::Author() {
401 // beginService( "CNode_Impl::Author" );
404 RetVal = _DataFlowNode->Author() ;
407 RetVal = _DataFlowEditor->Graph()->Author() ;
409 // endService( "CNode_Impl::Author" );
410 return CORBA::string_dup( RetVal ) ;
412 bool CNode_Impl::SetAuthor( const char * aDataFlowAuthor ) {
413 // beginService( "CNode_Impl::SetAuthor" );
414 bool RetVal = false ;
415 if ( _DataFlowEditor->IsEditing() ) {
417 RetVal = _DataFlowNode->Author( aDataFlowAuthor ) ;
420 RetVal = _DataFlowEditor->Graph()->Author( aDataFlowAuthor ) ;
423 // endService( "CNode_Impl::SetAuthor" );
426 char * CNode_Impl::Comment() {
427 // beginService( "CNode_Impl::Comment" );
430 RetVal = _DataFlowNode->Comment() ;
433 RetVal = _DataFlowEditor->Graph()->Comment() ;
435 // endService( "CNode_Impl::Comment" );
436 return CORBA::string_dup( RetVal ) ;
438 bool CNode_Impl::SetComment( const char * aDataFlowComment ) {
439 // beginService( "CNode_Impl::SetComment" );
440 bool RetVal = false ;
441 if ( _DataFlowEditor->IsEditing() ) {
443 RetVal = _DataFlowNode->Comment( aDataFlowComment ) ;
446 RetVal = _DataFlowEditor->Graph()->Comment( aDataFlowComment ) ;
449 // endService( "CNode_Impl::SetComment" );
453 void CNode_Impl::Coords(long X , long Y ) {
454 // beginService( "CNode_Impl::Coords" );
455 if ( _DataFlowEditor->IsEditing() ) {
457 ((GraphEditor::InNode *) _DataFlowNode)->Coordinates( X , Y ) ;
460 _DataFlowEditor->Graph()->Coordinates( X , Y ) ;
463 // endService( "CNode_Impl::Coords" );
465 long CNode_Impl::X() {
466 // beginService( "CNode_Impl::X" );
469 RetVal = _DataFlowNode->XCoordinate() ;
472 RetVal = _DataFlowEditor->Graph()->XCoordinate() ;
474 // endService( "CNode_Impl::X" );
477 long CNode_Impl::Y() {
478 // beginService( "CNode_Impl::Y" );
481 RetVal = _DataFlowNode->YCoordinate() ;
484 RetVal = _DataFlowEditor->Graph()->YCoordinate() ;
486 // endService( "CNode_Impl::Y" );
490 SUPERV::Port_ptr CNode_Impl::Port( const char * ServiceParameterName ) {
492 Port_Impl * myPort = NULL ;
493 SUPERV::Port_var iobject = SUPERV::Port::_nil() ;
496 aninport = _DataFlowNode->GetInPort( ServiceParameterName ) ;
499 aninport = _DataFlowEditor->GetInPort( ServiceParameterName ) ;
503 anoutport = _DataFlowNode->GetOutPort( ServiceParameterName ) ;
506 anoutport = _DataFlowEditor->GetOutPort( ServiceParameterName ) ;
509 GraphBase::InPort * anInPort ;
511 anInPort = _DataFlowNode->GetChangeInPort( ServiceParameterName ) ;
514 anInPort = _DataFlowEditor->GetChangeInPort( ServiceParameterName ) ;
516 if ( anInPort->IsDataStream() ) {
517 MESSAGE( "CNode_Impl::Port ERROR IsDataStream " ) ;
519 else if ( CORBA::is_nil( anInPort->ObjRef() ) ) {
521 beginService( "CNode_Impl::Port" );
526 hasinput = _DataFlowNode->HasInput( anInPort->PortName() ) ;
529 hasinput = _DataFlowEditor->HasInput( anInPort->PortName() ) ;
532 const CORBA::Any * anAny = anInPort->GetOutPort()->Value() ;
533 myPort = new Port_Impl( _Orb , _Poa , _ContId ,
534 instanceName() , interfaceName() ,
537 // ServiceParameterName ,
538 (GraphBase::Port * ) anInPort ,
543 myPort = new Port_Impl( _Orb , _Poa , _ContId ,
544 instanceName() , interfaceName() ,
547 // ServiceParameterName ) ;
548 (GraphBase::Port * ) anInPort ,
551 PortableServer::ObjectId * id = myPort->getId() ;
552 CORBA::Object_var obj = _poa->id_to_reference(*id);
553 iobject = SUPERV::Port::_narrow(obj) ;
554 anInPort->ObjRef( SUPERV::Port::_duplicate( iobject ) ) ;
557 iobject = anInPort->ObjRef() ;
560 else if ( anoutport ) {
561 GraphBase::OutPort * anOutPort ;
563 anOutPort = _DataFlowNode->GetChangeOutPort( ServiceParameterName ) ;
566 anOutPort = _DataFlowEditor->GetChangeOutPort( ServiceParameterName ) ;
568 if ( anOutPort->IsDataStream() ) {
569 MESSAGE( "CNode_Impl::Port ERROR IsDataStream " ) ;
571 else if ( CORBA::is_nil( anOutPort->ObjRef() ) ) {
573 beginService( "CNode_Impl::Port" );
576 const CORBA::Any * anAny = anOutPort->Value() ;
577 myPort = new Port_Impl( _Orb , _Poa , _ContId ,
578 instanceName() , interfaceName() ,
581 // ServiceParameterName ,
582 (GraphBase::Port * ) anOutPort ,
585 PortableServer::ObjectId * id = myPort->getId() ;
586 CORBA::Object_var obj = _poa->id_to_reference(*id);
587 iobject = SUPERV::Port::_narrow(obj) ;
588 anOutPort->ObjRef( SUPERV::Port::_duplicate( iobject ) ) ;
591 iobject = anOutPort->ObjRef() ;
595 endService( "CNode_Impl::Port" );
597 DataFlowEditor()->UnValid() ;
598 return SUPERV::Port::_duplicate( iobject ) ;
601 SUPERV::Port_ptr CNode_Impl::Input( const char * ToServiceParameterName ,
602 const SUPERV::Value_ptr aValue ) {
604 SUPERV::Port_var iobject = SUPERV::Port::_nil() ;
605 GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
607 GraphBase::InPort * anInPort = NULL ;
608 if ( _DataFlowEditor->IsEditing() ) {
610 sts = _DataFlowEditor->AddInputData( _DataFlowNode->Name() ,
611 ToServiceParameterName ,
613 anInPort = _DataFlowNode->GetChangeInPort( ToServiceParameterName ) ;
616 sts = _DataFlowEditor->AddInputData( _DataFlowEditor->Graph()->Name() ,
617 ToServiceParameterName ,
619 anInPort = _DataFlowEditor->Graph()->GetChangeInPort( ToServiceParameterName ) ;
621 if ( sts && anInPort ) {
622 if ( CORBA::is_nil( anInPort->ObjRef() ) ) {
624 beginService( "CNode_Impl::Input" );
628 myPort = new Port_Impl( _Orb , _Poa , _ContId ,
629 instanceName() , interfaceName() ,
632 // ToServiceParameterName ,
633 (GraphBase::Port * ) anInPort ,
636 PortableServer::ObjectId * id = myPort->getId() ;
637 CORBA::Object_var obj = _poa->id_to_reference(*id);
638 iobject = SUPERV::Port::_narrow(obj) ;
639 anInPort->ObjRef( SUPERV::Port::_duplicate( iobject ) ) ;
642 iobject = anInPort->ObjRef() ;
646 else if ( _DataFlowExecutor ) {
648 sts = _DataFlowExecutor->ChangeInputData( _DataFlowNode->Name() ,
649 ToServiceParameterName ,
651 anInPort = _DataFlowNode->GetChangeInPort( ToServiceParameterName ) ;
654 sts = _DataFlowExecutor->ChangeInputData( _DataFlowEditor->Graph()->Name() ,
655 ToServiceParameterName ,
657 anInPort = _DataFlowEditor->Graph()->GetChangeInPort( ToServiceParameterName ) ;
659 if ( sts && anInPort ) {
660 if ( CORBA::is_nil( anInPort->ObjRef() ) ) {
662 beginService( "CNode_Impl::Input" );
666 myPort = new Port_Impl( _Orb , _Poa , _ContId ,
667 instanceName() , interfaceName() ,
670 // ToServiceParameterName ,
671 (GraphBase::Port * ) anInPort ,
674 PortableServer::ObjectId * id = myPort->getId() ;
675 CORBA::Object_var obj = _poa->id_to_reference(*id);
676 iobject = SUPERV::Port::_narrow(obj) ;
677 anInPort->ObjRef( SUPERV::Port::_duplicate( iobject ) ) ;
680 iobject = anInPort->ObjRef() ;
685 endService( "CNode_Impl::Input" );
687 if ( CORBA::is_nil( iobject ) ) {
688 MESSAGE( "CNode_Impl::Input returns nil object _IsNode " << _IsNode << " sts " << sts << " anInPort "
691 DataFlowEditor()->UnValid() ;
692 return SUPERV::Port::_duplicate( iobject ) ;
695 SUPERV::Port_ptr CNode_Impl::GetInPort( const char *aParameterName ) {
696 SUPERV::Port_ptr Inobject = SUPERV::Port::_nil() ;
697 Port_Impl * myInPort = NULL ;
698 GraphBase::InPort * anInPort = DataFlowNode()->GetChangeInPort( aParameterName ) ;
699 if ( anInPort && !anInPort->IsDataStream() ) {
700 Inobject = anInPort->ObjRef() ;
701 if ( CORBA::is_nil( Inobject ) ) {
702 myInPort = new Port_Impl( _Orb , _Poa , _ContId ,
703 instanceName() , interfaceName() ,
706 (GraphBase::Port * ) anInPort ,
709 PortableServer::ObjectId * id = myInPort->getId() ;
710 CORBA::Object_var obj = _poa->id_to_reference(*id) ;
711 Inobject = SUPERV::Port::_narrow(obj) ;
712 anInPort->ObjRef( SUPERV::Port::_duplicate( Inobject ) ) ;
716 return SUPERV::Port::_duplicate( Inobject ) ;
719 SUPERV::Port_ptr CNode_Impl::GetOutPort( const char *aParameterName ) {
720 Port_Impl * myOutPort = NULL ;
721 SUPERV::Port_ptr Outobject = SUPERV::Port::_nil() ;
722 GraphBase::OutPort * anOutPort = DataFlowNode()->GetChangeOutPort( aParameterName ) ;
723 if ( anOutPort && !anOutPort->IsDataStream() ) {
724 Outobject = anOutPort->ObjRef() ;
725 if ( CORBA::is_nil( Outobject ) ) {
726 const CORBA::Any * anAny = anOutPort->Value() ;
727 myOutPort = new Port_Impl( _Orb , _Poa , _ContId ,
728 instanceName() , interfaceName() ,
731 (GraphBase::Port * ) anOutPort ,
735 PortableServer::ObjectId * id = myOutPort->getId() ;
736 CORBA::Object_var obj = _poa->id_to_reference(*id) ;
737 Outobject = SUPERV::Port::_narrow(obj) ;
738 anOutPort->ObjRef( SUPERV::Port::_duplicate( Outobject ) ) ;
742 return SUPERV::Port::_duplicate( Outobject );
745 SUPERV::StreamPort_ptr CNode_Impl::GetInStreamPort( const char *aParameterName ) {
746 SUPERV::StreamPort_ptr Inobject = SUPERV::StreamPort::_nil() ;
747 if ( DataFlowEditor()->Graph()->IsDataStreamNode() ) {
748 StreamPort_Impl * myInStreamPort = NULL ;
749 GraphBase::InPort * anInPort = DataFlowNode()->GetChangeInPort( aParameterName ) ;
750 if ( anInPort && anInPort->IsDataStream() ) {
751 Inobject = SUPERV::StreamPort::_narrow( anInPort->ObjRef() ) ;
752 if ( CORBA::is_nil( Inobject ) ) {
753 myInStreamPort = new StreamPort_Impl( _Orb , _Poa , _ContId ,
754 instanceName() , interfaceName() ,
757 (GraphBase::Port * ) anInPort ,
759 if ( myInStreamPort ) {
760 PortableServer::ObjectId * id = myInStreamPort->getId() ;
761 CORBA::Object_var obj = _poa->id_to_reference(*id) ;
762 Inobject = SUPERV::StreamPort::_narrow(obj) ;
763 anInPort->ObjRef( SUPERV::StreamPort::_duplicate( Inobject ) ) ;
768 return SUPERV::StreamPort::_duplicate( Inobject ) ;
771 SUPERV::StreamPort_ptr CNode_Impl::GetOutStreamPort( const char *aParameterName ) {
772 StreamPort_Impl * myOutStreamPort = NULL ;
773 SUPERV::StreamPort_ptr Outobject = SUPERV::StreamPort::_nil() ;
774 if ( DataFlowEditor()->Graph()->IsDataStreamNode() ) {
775 GraphBase::OutPort * anOutPort = DataFlowNode()->GetChangeOutPort( aParameterName ) ;
776 if ( anOutPort && anOutPort->IsDataStream() ) {
777 Outobject = SUPERV::StreamPort::_narrow( anOutPort->ObjRef() ) ;
778 if ( CORBA::is_nil( Outobject ) ) {
779 const CORBA::Any * anAny = anOutPort->Value() ;
780 myOutStreamPort = new StreamPort_Impl( _Orb , _Poa , _ContId ,
781 instanceName() , interfaceName() ,
784 (GraphBase::Port * ) anOutPort ,
787 if ( myOutStreamPort ) {
788 PortableServer::ObjectId * id = myOutStreamPort->getId() ;
789 CORBA::Object_var obj = _poa->id_to_reference(*id) ;
790 Outobject = SUPERV::StreamPort::_narrow(obj) ;
791 anOutPort->ObjRef( SUPERV::StreamPort::_duplicate( Outobject ) ) ;
796 return SUPERV::StreamPort::_duplicate( Outobject );
799 SUPERV::Link_ptr CNode_Impl::GetLink(const char * ToServiceParameterName ) {
801 SUPERV::Link_var iobject = SUPERV::Link::_nil() ;
803 char* FromServiceParameterName ;
804 bool status = _DataFlowEditor->GetLink( _DataFlowNode->Name() ,
805 ToServiceParameterName ,
807 & FromServiceParameterName ) ;
809 GraphBase::InPort * anInPort = _DataFlowNode->GetChangeInPort( ToServiceParameterName ) ;
810 if ( !anInPort->IsDataStream() && anInPort->GetOutPort() ) {
811 GraphBase::OutPort * anOutPort = anInPort->GetOutPort() ;
812 if ( CORBA::is_nil( anOutPort->InPortObjRef( anInPort ) ) ) {
814 beginService( "CNode_Impl::GetLink" );
818 Link_Impl * myLink = new Link_Impl( _Orb , _Poa , _ContId ,
819 instanceName() , interfaceName() ,
822 ToServiceParameterName ,
823 (GraphEditor::InNode *) _DataFlowEditor->Graph()->GetChangeGraphNode( FromNodeName )->GetInNode() ,
824 FromServiceParameterName ,
825 true , false , Success ) ;
827 PortableServer::ObjectId * id = myLink->getId() ;
828 CORBA::Object_var obj = _poa->id_to_reference(*id);
829 iobject = SUPERV::Link::_narrow(obj) ;
830 anOutPort->AddInPortObjRef( anInPort , SUPERV::Link::_duplicate( iobject ) ) ;
834 iobject = anOutPort->InPortObjRef( anInPort ) ;
839 endService( "CNode_Impl::GetLink" );
841 return SUPERV::Link::_duplicate( iobject ) ;
844 SUPERV::StreamLink_ptr CNode_Impl::GetStreamLink(const char * ToServiceParameterName ) {
846 SUPERV::StreamLink_var iobject = SUPERV::StreamLink::_nil() ;
848 char* FromServiceParameterName ;
849 if ( DataFlowEditor()->Graph()->IsDataStreamNode() ) {
850 bool status = _DataFlowEditor->GetLink( _DataFlowNode->Name() ,
851 ToServiceParameterName ,
853 & FromServiceParameterName ) ;
855 GraphBase::InPort * anInPort = _DataFlowNode->GetChangeInPort( ToServiceParameterName ) ;
856 if ( anInPort->IsDataStream() && anInPort->GetOutPort() ) {
857 GraphBase::OutPort * anOutPort = anInPort->GetOutPort() ;
858 if ( CORBA::is_nil( anOutPort->InPortObjRef( anInPort ) ) ) {
860 beginService( "CNode_Impl::GetLink" );
864 StreamLink_Impl * myStreamLink = new StreamLink_Impl(
865 _Orb , _Poa , _ContId ,
866 instanceName() , interfaceName() ,
869 ToServiceParameterName ,
870 (GraphEditor::InNode *) _DataFlowEditor->Graph()->GetChangeGraphNode( FromNodeName )->GetInNode() ,
871 FromServiceParameterName ,
874 PortableServer::ObjectId * id = myStreamLink->getId() ;
875 CORBA::Object_var obj = _poa->id_to_reference(*id);
876 iobject = SUPERV::StreamLink::_narrow(obj) ;
877 anOutPort->AddInPortObjRef( anInPort , SUPERV::StreamLink::_duplicate( iobject ) ) ;
881 iobject = SUPERV::StreamLink::_narrow( anOutPort->InPortObjRef( anInPort ) ) ;
887 endService( "CNode_Impl::GetLink" );
889 return SUPERV::StreamLink::_duplicate( iobject ) ;
892 SUPERV::ListOfPorts * CNode_Impl::Ports() {
896 SUPERV::ListOfPorts_var RetVal = new SUPERV::ListOfPorts ;
898 // RetVal->length( _DataFlowNode->GetNodeInPortsSize() +
899 // _DataFlowNode->GetNodeOutPortsSize() ) ;
900 for ( i = 0 ; i < _DataFlowNode->GetNodeInPortsSize() ; i++ ) {
901 GraphBase::InPort * anInPort = _DataFlowNode->GetChangeNodeInPort( i ) ;
902 if ( !anInPort->IsDataStream() ) {
904 beginService( "CNode_Impl::Ports" );
907 if ( anInPort->IsLoop() || ( anInPort->IsGate() && !anInPort->IsConnected() &&
908 ( _DataFlowEditor->IsExecuting() || _DataFlowEditor->IsReadOnly() ) ) ) {
909 MESSAGE( "InPort " << i << " " << anInPort->PortName() << " of Node " << Name() << " ignored" ) ;
910 // RetVal[ i ] = SUPERV::Port::_duplicate( SUPERV::Port::_narrow( CORBA::Object::_nil() ) ) ;
912 else if ( CORBA::is_nil( anInPort->ObjRef() ) ) {
913 MESSAGE( "InPort " << i << " " << anInPort->PortName() << " of Node " << Name() << " IsExecuting "
914 << _DataFlowEditor->IsExecuting() << " IsGate/IsConnected " << anInPort->IsGate()
915 << "/" << anInPort->IsConnected() ) ;
917 if ( _DataFlowNode->HasInput( anInPort->PortName() ) ) {
918 const CORBA::Any * anAny = anInPort->GetOutPort()->Value() ;
919 myPort = new Port_Impl( _Orb , _Poa , _ContId ,
920 instanceName() , interfaceName() ,
923 (GraphBase::Port * ) anInPort ,
928 myPort = new Port_Impl( _Orb , _Poa , _ContId ,
929 instanceName() , interfaceName() ,
932 (GraphBase::Port * ) anInPort ,
935 PortableServer::ObjectId * id = myPort->getId() ;
936 CORBA::Object_var obj = _poa->id_to_reference(*id);
937 SUPERV::Port_var iobject ;
938 iobject = SUPERV::Port::_narrow(obj) ;
940 RetVal->length( PortCount ) ;
941 RetVal[ PortCount - 1 ] = SUPERV::Port::_duplicate( iobject ) ;
942 anInPort->ObjRef( SUPERV::Port::_duplicate( iobject ) ) ;
945 MESSAGE( "InPort " << i << " " << anInPort->PortName() << " of Node " << Name() ) ;
947 RetVal->length( PortCount ) ;
948 RetVal[ PortCount - 1 ] = SUPERV::Port::_duplicate( anInPort->ObjRef() ) ;
952 MESSAGE( "InPort " << i << " " << anInPort->PortName() << " of Node " << Name() << " IsDataStream" ) ;
953 // RetVal[ i ] = SUPERV::Port::_duplicate( SUPERV::Port::_narrow( CORBA::Object::_nil() ) ) ;
956 for ( i = 0 ; i < _DataFlowNode->GetNodeOutPortsSize() ; i++ ) {
957 GraphBase::OutPort * anOutPort = _DataFlowNode->GetChangeNodeOutPort( i ) ;
958 if ( !anOutPort->IsDataStream() ) {
960 beginService( "CNode_Impl::Ports" );
963 if ( anOutPort->IsLoop() || ( anOutPort->IsGate() && !anOutPort->IsConnected() &&
964 ( _DataFlowEditor->IsExecuting() || _DataFlowEditor->IsReadOnly() ) ) ) {
965 MESSAGE( "OutPort " << i << " " << anOutPort->PortName() << " of Node " << Name() << " ignored" ) ;
966 // RetVal[ _DataFlowNode->GetNodeInPortsSize() + i ] = SUPERV::Port::_duplicate( SUPERV::Port::_narrow( CORBA::Object::_nil() ) ) ;
968 else if ( CORBA::is_nil( anOutPort->ObjRef() ) ) {
969 MESSAGE( "OutPort " << i << " " << anOutPort->PortName() << " of Node " << Name() ) ;
970 const CORBA::Any * anAny = anOutPort->Value() ;
971 Port_Impl * myPort = new Port_Impl( _Orb , _Poa , _ContId ,
972 instanceName() , interfaceName() ,
975 (GraphBase::Port * ) anOutPort ,
978 PortableServer::ObjectId * id = myPort->getId() ;
979 CORBA::Object_var obj = _poa->id_to_reference(*id);
980 SUPERV::Port_var iobject ;
981 iobject = SUPERV::Port::_narrow(obj) ;
983 RetVal->length( PortCount ) ;
984 RetVal[ PortCount - 1 ] = SUPERV::Port::_duplicate( iobject ) ;
985 anOutPort->ObjRef( SUPERV::Port::_duplicate( iobject ) ) ;
988 MESSAGE( "OutPort " << i << " " << anOutPort->PortName() << " of Node " << Name() ) ;
990 RetVal->length( PortCount ) ;
991 RetVal[ PortCount - 1 ] = SUPERV::Port::_duplicate( anOutPort->ObjRef() ) ;
995 MESSAGE( "OutPort " << i << " " << anOutPort->PortName() << " of Node " << Name() << " IsDataStream" ) ;
996 // RetVal[ _DataFlowNode->GetNodeInPortsSize() + i ] = SUPERV::Port::_duplicate( SUPERV::Port::_narrow( CORBA::Object::_nil() ) ) ;
1001 if ( _DataFlowEditor->IsValid() ) {
1002 RetVal->length( _DataFlowEditor->Graph()->GetNodeInDataNodePortsSize() +
1003 _DataFlowEditor->Graph()->GetNodeOutDataNodePortsSize() ) ;
1004 for ( i = 0 ; i < _DataFlowEditor->Graph()->GetNodeInDataNodePortsSize() ; i++ ) {
1005 GraphBase::OutPort * anOutPort = _DataFlowEditor->Graph()->GetChangeNodeInDataNodePort(i) ;
1006 if ( !anOutPort->IsDataStream() ) {
1007 if ( CORBA::is_nil( anOutPort->ObjRef() ) ) {
1009 beginService( "CNode_Impl::Ports" );
1012 Port_Impl * myPort ;
1013 if ( anOutPort->IsDataConnected() ) {
1014 const CORBA::Any * anAny = anOutPort->Value() ;
1015 myPort = new Port_Impl( _Orb , _Poa , _ContId ,
1016 instanceName() , interfaceName() ,
1019 (GraphBase::Port * ) anOutPort ,
1024 myPort = new Port_Impl( _Orb , _Poa , _ContId ,
1025 instanceName() , interfaceName() ,
1028 (GraphBase::Port * ) anOutPort ,
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 anOutPort->ObjRef( SUPERV::Port::_duplicate( iobject ) ) ;
1042 RetVal->length( PortCount ) ;
1043 RetVal[ PortCount - 1 ] = SUPERV::Port::_duplicate( anOutPort->ObjRef() ) ;
1047 // RetVal[ i ] = SUPERV::Port::_duplicate( SUPERV::Port::_narrow( CORBA::Object::_nil() ) ) ;
1050 j = _DataFlowEditor->Graph()->GetNodeInDataNodePortsSize() ;
1051 for ( i = 0 ; i < _DataFlowEditor->Graph()->GetNodeOutDataNodePortsSize() ; i++ ) {
1052 GraphBase::InPort * anInPort = _DataFlowEditor->Graph()->GetChangeNodeOutDataNodePort(i) ;
1053 if ( !anInPort->IsDataStream() ) {
1054 if ( CORBA::is_nil( anInPort->ObjRef() ) ) {
1056 beginService( "CNode_Impl::Ports" );
1059 Port_Impl * myPort ;
1060 if ( anInPort->IsDataConnected() ) {
1061 const CORBA::Any * anAny = anInPort->GetOutPort()->Value() ;
1062 myPort = new Port_Impl( _Orb , _Poa , _ContId ,
1063 instanceName() , interfaceName() ,
1066 (GraphBase::Port * ) anInPort ,
1071 myPort = new Port_Impl( _Orb , _Poa , _ContId ,
1072 instanceName() , interfaceName() ,
1078 PortableServer::ObjectId * id = myPort->getId() ;
1079 CORBA::Object_var obj = _poa->id_to_reference(*id);
1080 SUPERV::Port_var iobject ;
1081 iobject = SUPERV::Port::_narrow(obj) ;
1083 RetVal->length( PortCount ) ;
1084 RetVal[ PortCount - 1 ] = SUPERV::Port::_duplicate( iobject ) ;
1085 anInPort->ObjRef( SUPERV::Port::_duplicate( iobject ) ) ;
1089 RetVal->length( PortCount ) ;
1090 RetVal[ PortCount - 1 ] = SUPERV::Port::_duplicate( anInPort->ObjRef() ) ;
1094 // RetVal[ j + i ] = SUPERV::Port::_duplicate( SUPERV::Port::_narrow( CORBA::Object::_nil() ) ) ;
1099 // int RetVallength = (unsigned int ) RetVal->length() ;
1100 // for ( i = 0 ; i < RetVallength ; i++ ) {
1101 // MESSAGE( "Port " << i << " " << RetVal[i]->Name() << " of Node " << Name() ) ;
1104 endService( "CNode_Impl::Ports " ) ;
1106 return ( RetVal._retn() ) ;
1109 SUPERV::ListOfStreamPorts * CNode_Impl::StreamPorts() {
1113 SUPERV::ListOfStreamPorts_var RetVal = new SUPERV::ListOfStreamPorts ;
1114 if ( !DataFlowEditor()->Graph()->IsDataStreamNode() ) {
1115 // MESSAGE("CNode_Impl::StreamPorts NOT a DataStreamNode" ) ;
1117 else if ( _IsNode ) {
1118 // RetVal->length( _DataFlowNode->GetNodeInPortsSize() +
1119 // _DataFlowNode->GetNodeOutPortsSize() ) ;
1120 for ( i = 0 ; i < _DataFlowNode->GetNodeInPortsSize() ; i++ ) {
1121 GraphBase::InPort * anInPort = _DataFlowNode->GetChangeNodeInPort( i ) ;
1122 if ( anInPort->IsDataStream() ) {
1124 beginService( "CNode_Impl::StreamPorts" );
1127 if ( anInPort->IsLoop() || ( anInPort->IsGate() && !anInPort->IsConnected() &&
1128 ( _DataFlowEditor->IsExecuting() || _DataFlowEditor->IsReadOnly() ) ) ) {
1129 MESSAGE( "InStreamPort " << i << " " << anInPort->PortName() << " of Node " << Name() << " ignored" ) ;
1130 // RetVal[ i ] = SUPERV::StreamPort::_duplicate( SUPERV::StreamPort::_narrow( CORBA::Object::_nil() ) ) ;
1132 else if ( CORBA::is_nil( anInPort->ObjRef() ) ) {
1133 MESSAGE( "InStreamPort " << i << " " << anInPort->PortName() << " of Node " << Name() << " IsExecuting "
1134 << _DataFlowEditor->IsExecuting() << " IsGate/IsConnected " << anInPort->IsGate()
1135 << "/" << anInPort->IsConnected() ) ;
1136 StreamPort_Impl * myStreamPort ;
1137 if ( _DataFlowNode->HasInput( anInPort->PortName() ) ) {
1138 const CORBA::Any * anAny = anInPort->GetOutPort()->Value() ;
1139 myStreamPort = new StreamPort_Impl( _Orb , _Poa , _ContId ,
1140 instanceName() , interfaceName() ,
1143 (GraphBase::Port * ) anInPort ,
1148 myStreamPort = new StreamPort_Impl( _Orb , _Poa , _ContId ,
1149 instanceName() , interfaceName() ,
1152 (GraphBase::Port * ) anInPort ,
1155 PortableServer::ObjectId * id = myStreamPort->getId() ;
1156 CORBA::Object_var obj = _poa->id_to_reference(*id);
1157 SUPERV::StreamPort_var iobject ;
1158 iobject = SUPERV::StreamPort::_narrow(obj) ;
1160 RetVal->length( PortCount ) ;
1161 RetVal[ PortCount - 1 ] = SUPERV::StreamPort::_duplicate( iobject ) ;
1162 anInPort->ObjRef( SUPERV::StreamPort::_duplicate( iobject ) ) ;
1165 MESSAGE( "InStreamPort " << i << " " << anInPort->PortName() << " of Node " << Name() ) ;
1167 RetVal->length( PortCount ) ;
1168 RetVal[ PortCount - 1 ] = SUPERV::StreamPort::_duplicate( SUPERV::StreamPort::_narrow( anInPort->ObjRef() ) ) ;
1172 // RetVal[ i ] = SUPERV::StreamPort::_duplicate( SUPERV::StreamPort::_narrow( CORBA::Object::_nil() ) ) ;
1175 for ( i = 0 ; i < _DataFlowNode->GetNodeOutPortsSize() ; i++ ) {
1176 GraphBase::OutPort * anOutPort = _DataFlowNode->GetChangeNodeOutPort( i ) ;
1177 if ( anOutPort->IsDataStream() ) {
1179 beginService( "CNode_Impl::StreamPorts" );
1182 if ( anOutPort->IsLoop() || ( anOutPort->IsGate() && !anOutPort->IsConnected() &&
1183 ( _DataFlowEditor->IsExecuting() || _DataFlowEditor->IsReadOnly() ) ) ) {
1184 MESSAGE( "OutStreamPort " << i << " " << anOutPort->PortName() << " of Node " << Name() << " ignored" ) ;
1185 // RetVal[ _DataFlowNode->GetNodeInPortsSize() + i ] = SUPERV::StreamPort::_duplicate( SUPERV::StreamPort::_narrow( CORBA::Object::_nil() ) ) ;
1187 else if ( CORBA::is_nil( anOutPort->ObjRef() ) ) {
1188 MESSAGE( "OutStreamPort " << i << " " << anOutPort->PortName() << " of Node " << Name() ) ;
1189 const CORBA::Any * anAny = anOutPort->Value() ;
1190 StreamPort_Impl * myStreamPort = new StreamPort_Impl( _Orb , _Poa , _ContId ,
1191 instanceName() , interfaceName() ,
1194 (GraphBase::Port * ) anOutPort ,
1197 PortableServer::ObjectId * id = myStreamPort->getId() ;
1198 CORBA::Object_var obj = _poa->id_to_reference(*id);
1199 SUPERV::StreamPort_var iobject ;
1200 iobject = SUPERV::StreamPort::_narrow(obj) ;
1202 RetVal->length( PortCount ) ;
1203 RetVal[ PortCount - 1 ] = SUPERV::StreamPort::_duplicate( iobject ) ;
1204 anOutPort->ObjRef( SUPERV::StreamPort::_duplicate( iobject ) ) ;
1207 MESSAGE( "OutStreamPort " << i << " " << anOutPort->PortName() << " of Node " << Name() ) ;
1209 RetVal->length( PortCount ) ;
1210 RetVal[ PortCount - 1 ] = SUPERV::StreamPort::_duplicate( SUPERV::StreamPort::_narrow( anOutPort->ObjRef() ) ) ;
1214 // RetVal[ i ] = SUPERV::StreamPort::_duplicate( SUPERV::StreamPort::_narrow( CORBA::Object::_nil() ) ) ;
1219 if ( _DataFlowEditor->IsValid() ) {
1220 // RetVal->length( _DataFlowEditor->Graph()->GetNodeInDataNodePortsSize() +
1221 // _DataFlowEditor->Graph()->GetNodeOutDataNodePortsSize() ) ;
1222 for ( i = 0 ; i < _DataFlowEditor->Graph()->GetNodeInDataNodePortsSize() ; i++ ) {
1223 GraphBase::OutPort * anOutPort = _DataFlowEditor->Graph()->GetChangeNodeInDataNodePort(i) ;
1224 if ( anOutPort->IsDataStream() ) {
1225 if ( CORBA::is_nil( anOutPort->ObjRef() ) ) {
1227 beginService( "CNode_Impl::StreamPorts" );
1230 StreamPort_Impl * myStreamPort ;
1231 if ( anOutPort->IsDataConnected() ) {
1232 const CORBA::Any * anAny = anOutPort->Value() ;
1233 myStreamPort = new StreamPort_Impl( _Orb , _Poa , _ContId ,
1234 instanceName() , interfaceName() ,
1237 (GraphBase::Port * ) anOutPort ,
1242 myStreamPort = new StreamPort_Impl( _Orb , _Poa , _ContId ,
1243 instanceName() , interfaceName() ,
1246 (GraphBase::Port * ) anOutPort ,
1249 PortableServer::ObjectId * id = myStreamPort->getId() ;
1250 CORBA::Object_var obj = _poa->id_to_reference(*id);
1251 SUPERV::StreamPort_var iobject ;
1252 iobject = SUPERV::StreamPort::_narrow(obj) ;
1254 RetVal->length( PortCount ) ;
1255 RetVal[ PortCount - 1 ] = SUPERV::StreamPort::_duplicate( iobject ) ;
1256 anOutPort->ObjRef( SUPERV::StreamPort::_duplicate( iobject ) ) ;
1260 RetVal->length( PortCount ) ;
1261 RetVal[ PortCount - 1 ] = SUPERV::StreamPort::_duplicate( SUPERV::StreamPort::_narrow( anOutPort->ObjRef() ) ) ;
1265 // RetVal[ i ] = SUPERV::StreamPort::_duplicate( SUPERV::StreamPort::_narrow( CORBA::Object::_nil() ) ) ;
1268 j = _DataFlowEditor->Graph()->GetNodeInDataNodePortsSize() ;
1269 for ( i = 0 ; i < _DataFlowEditor->Graph()->GetNodeOutDataNodePortsSize() ; i++ ) {
1270 GraphBase::InPort * anInPort = _DataFlowEditor->Graph()->GetChangeNodeOutDataNodePort(i) ;
1271 if ( anInPort->IsDataStream() ) {
1272 if ( CORBA::is_nil( anInPort->ObjRef() ) ) {
1274 beginService( "CNode_Impl::StreamPorts" );
1277 StreamPort_Impl * myStreamPort ;
1278 if ( anInPort->IsDataConnected() ) {
1279 const CORBA::Any * anAny = anInPort->GetOutPort()->Value() ;
1280 myStreamPort = new StreamPort_Impl( _Orb , _Poa , _ContId ,
1281 instanceName() , interfaceName() ,
1284 (GraphBase::Port * ) anInPort ,
1289 myStreamPort = new StreamPort_Impl( _Orb , _Poa , _ContId ,
1290 instanceName() , interfaceName() ,
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 anInPort->ObjRef( SUPERV::StreamPort::_duplicate( iobject ) ) ;
1307 RetVal->length( PortCount ) ;
1308 RetVal[ PortCount - 1 ] = SUPERV::StreamPort::_duplicate( SUPERV::StreamPort::_narrow( anInPort->ObjRef() ) ) ;
1312 // RetVal[ i ] = SUPERV::StreamPort::_duplicate( SUPERV::StreamPort::_narrow( CORBA::Object::_nil() ) ) ;
1317 // int RetVallength = (unsigned int ) RetVal->length() ;
1318 // for ( i = 0 ; i < RetVallength ; i++ ) {
1319 // MESSAGE( "StreamPort " << i << " " << RetVal[i]->Name() << " of Node " << Name() ) ;
1322 endService( "CNode_Impl::StreamPorts " ) ;
1324 return ( RetVal._retn() ) ;
1327 SUPERV::ListOfLinks * CNode_Impl::Links() {
1328 beginService( "CNode_Impl::Links" ) ;
1329 SUPERV::ListOfLinks_var RetVal = new SUPERV::ListOfLinks ;
1330 if ( _DataFlowNode ) {
1331 RetVal = DataFlowEditor()->Graph()->ObjImpl()->Links( _DataFlowNode->ComputingNode() , NULL ) ;
1334 RetVal = DataFlowEditor()->Graph()->ObjImpl()->Links( NULL , NULL ) ;
1336 MESSAGE( "CNode_Impl::Links " << RetVal->length() << " Links" ) ;
1337 endService( "CNode_Impl::Links" ) ;
1338 return ( RetVal._retn() ) ;
1341 SUPERV::ListOfStreamLinks * CNode_Impl::StreamLinks() {
1342 beginService( "CNode_Impl::StreamLinks" ) ;
1343 SUPERV::ListOfStreamLinks_var RetVal = new SUPERV::ListOfStreamLinks ;
1344 if ( _DataFlowNode && DataFlowEditor()->Graph()->IsDataStreamNode() ) {
1345 RetVal = ((StreamGraph_Impl *) (DataFlowEditor()->StreamGraph()->ObjImpl()))->StreamLinks( _DataFlowNode->ComputingNode() , NULL ) ;
1347 else if ( DataFlowEditor()->Graph()->IsDataStreamNode() ) {
1348 RetVal = ((StreamGraph_Impl *) (DataFlowEditor()->StreamGraph()->ObjImpl()))->StreamLinks( NULL , NULL ) ;
1350 MESSAGE( "CNode_Impl::StreamLinks " << RetVal->length() << " StreamLinks" ) ;
1351 endService( "CNode_Impl::StreamLinks" ) ;
1352 return ( RetVal._retn() ) ;
1355 long CNode_Impl::SubGraph() {
1356 // beginService( "CNode_Impl::SubGraph" );
1359 RetVal = _DataFlowNode->SubGraph() ;
1361 // endService( "CNode_Impl::SubGraph" );
1365 long CNode_Impl::SubStreamGraph() {
1366 // beginService( "CNode_Impl::SubStreamGraph" );
1369 RetVal = _DataFlowNode->SubStreamGraph() ;
1371 // endService( "CNode_Impl::SubStreamGraph" );
1375 bool CNode_Impl::IsLinked(const char * ServiceParameterName ) {
1376 beginService( "CNode_Impl::IsLinked" );
1377 bool RetVal = _DataFlowNode->IsLinked( ServiceParameterName ) ;
1378 MESSAGE( Name() << "->IsLinked( '" << ServiceParameterName << "' )" ) ;
1379 endService( "CNode_Impl::IsLinked" );
1383 bool CNode_Impl::HasInput(const char * ServiceParameterName ) {
1384 // beginService( "CNode_Impl::HasInput" );
1385 bool RetVal = _DataFlowNode->HasInput( ServiceParameterName ) ;
1386 // endService( "CNode_Impl::HasInput" );
1390 SUPERV::GraphState CNode_Impl::State() {
1391 // beginService( "CNode_Impl::State" );
1392 SUPERV::GraphState RetVal = SUPERV::EditingState ;
1393 GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1394 if ( _DataFlowExecutor && !_DataFlowEditor->EditedAfterExecution() ) {
1395 //JR : 12/06/03 if ( _DataFlowExecutor ) {
1397 RetVal = _DataFlowExecutor->State( Name() ) ;
1400 RetVal = _DataFlowExecutor->State() ;
1403 // endService( "CNode_Impl::State" );
1406 long CNode_Impl::Thread() {
1407 // beginService( "CNode_Impl::Thread" );
1409 GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1410 if ( _DataFlowExecutor ) {
1412 RetVal = _DataFlowExecutor->Thread( Name() ) ;
1415 RetVal = _DataFlowExecutor->Thread() ;
1418 // endService( "CNode_Impl::Thread" );
1421 SUPERV::AutomatonState CNode_Impl::AutoState() {
1422 // beginService( "CNode_Impl::AutoState" );
1423 SUPERV::AutomatonState RetVal = SUPERV::UnKnownState ;
1424 GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1425 if ( _DataFlowExecutor ) {
1427 RetVal = _DataFlowExecutor->AutomatonState( Name() ) ;
1430 RetVal = _DataFlowExecutor->AutomatonState() ;
1433 // endService( "CNode_Impl::AutoState" );
1436 SUPERV::ControlState CNode_Impl::Control() {
1437 // beginService( "CNode_Impl::Control" );
1438 SUPERV::ControlState RetVal = SUPERV::VoidState ;
1439 GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1440 if ( _DataFlowExecutor ) {
1442 RetVal = _DataFlowExecutor->ControlState( Name() ) ;
1445 RetVal = _DataFlowExecutor->ControlState() ;
1448 // endService( "CNode_Impl::Control" );
1451 void CNode_Impl::ControlClear() {
1452 // beginService( "CNode_Impl::ControlClear" );
1453 // SUPERV::ControlState RetVal = SUPERV::VoidState ;
1454 GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1455 if ( _DataFlowExecutor ) {
1457 _DataFlowExecutor->ControlClear( Name() ) ;
1460 _DataFlowExecutor->ControlClear() ;
1463 // endService( "CNode_Impl::ControlClear" );
1467 bool CNode_Impl::IsReady() {
1468 // beginService( "CNode_Impl::IsReady" );
1469 bool RetVal = false ;
1470 GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1471 if ( _DataFlowExecutor ) {
1473 RetVal = _DataFlowExecutor->IsReady( Name() ) ;
1476 RetVal = _DataFlowExecutor->IsReady() ;
1479 // endService( "CNode_Impl::IsReady" );
1483 bool CNode_Impl::IsWaiting() {
1484 // beginService( "CNode_Impl::IsWaiting" );
1485 bool RetVal = false ;
1486 GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1487 if ( _DataFlowExecutor ) {
1489 RetVal = _DataFlowExecutor->IsWaiting( Name() ) ;
1492 RetVal = _DataFlowExecutor->IsWaiting() ;
1495 // endService( "CNode_Impl::IsWaiting" );
1499 bool CNode_Impl::IsRunning() {
1500 // beginService( "CNode_Impl::IsRunning" );
1501 bool RetVal = false ;
1502 GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1503 if ( _DataFlowExecutor ) {
1505 RetVal = _DataFlowExecutor->IsRunning( Name() ) ;
1508 RetVal = _DataFlowExecutor->IsRunning() ;
1511 // endService( "CNode_Impl::IsRunning" );
1515 bool CNode_Impl::IsDone() {
1516 // beginService( "CNode_Impl::IsDone" );
1517 bool RetVal = false ;
1518 GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1519 if ( _DataFlowExecutor ) {
1521 RetVal = _DataFlowExecutor->IsDone( Name() ) ;
1524 RetVal = _DataFlowExecutor->IsDone() ;
1527 // endService( "CNode_Impl::IsDone" );
1531 bool CNode_Impl::IsSuspended() {
1532 // beginService( "CNode_Impl::IsSuspended" );
1533 bool RetVal = false ;
1534 GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1535 if ( _DataFlowExecutor ) {
1537 RetVal = _DataFlowExecutor->IsSuspended( Name() ) ;
1540 RetVal = _DataFlowExecutor->IsSuspended() ;
1543 // endService( "CNode_Impl::IsSuspended" );
1547 bool CNode_Impl::ReadyW() {
1548 // beginService( "CNode_Impl::ReadyW" );
1549 bool RetVal = false ;
1550 GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1551 if ( _DataFlowExecutor ) {
1553 RetVal = _DataFlowExecutor->ReadyWait( Name() ) ;
1556 RetVal = _DataFlowExecutor->ReadyWait() ;
1559 // endService( "CNode_Impl::ReadyW" );
1563 bool CNode_Impl::RunningW() {
1564 // beginService( "CNode_Impl::RunningW" );
1565 bool RetVal = false ;
1566 GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1567 if ( _DataFlowExecutor ) {
1569 RetVal = _DataFlowExecutor->RunningWait( Name() ) ;
1572 RetVal = _DataFlowExecutor->RunningWait() ;
1575 // endService( "CNode_Impl::RunningW" );
1579 bool CNode_Impl::DoneW() {
1580 // beginService( "CNode_Impl::DoneW" );
1581 bool RetVal = false ;
1582 GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1583 if ( _DataFlowExecutor ) {
1585 RetVal = _DataFlowExecutor->DoneWait( Name() ) ;
1588 RetVal = _DataFlowExecutor->DoneWait() ;
1591 // endService( "CNode_Impl::DoneW" );
1595 bool CNode_Impl::SuspendedW() {
1596 // beginService( "CNode_Impl::SuspendedW" );
1597 bool RetVal = false ;
1598 GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1599 if ( _DataFlowExecutor ) {
1601 RetVal = _DataFlowExecutor->SuspendedWait( Name() ) ;
1604 RetVal = _DataFlowExecutor->SuspendedWait() ;
1607 // endService( "CNode_Impl::SuspendedW" );
1611 void CNode_Impl::ping() {
1612 // beginService( "CNode_Impl::ping" );
1613 bool RetVal = false ;
1614 GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1615 if ( _DataFlowExecutor ) {
1617 RetVal = _DataFlowExecutor->Ping( Name() ) ;
1623 // endService( "CNode_Impl::ping" );
1627 bool CNode_Impl::ContainerKill() {
1628 beginService( "CNode_Impl::ContainerKill" );
1629 bool RetVal = false ;
1630 GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1631 if ( _DataFlowExecutor && _DataFlowEditor->IsExecuting() ) {
1633 RetVal = _DataFlowExecutor->ContainerKill( Name() ) ;
1636 RetVal = _DataFlowExecutor->ContainerKill() ;
1639 endService( "CNode_Impl::ContainerKill" );
1642 bool CNode_Impl::Kill() {
1643 beginService( "CNode_Impl::Kill" );
1644 bool RetVal = false ;
1645 GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1646 if ( _DataFlowExecutor ) {
1648 RetVal = _DataFlowExecutor->Kill( Name() ) ;
1651 RetVal = _DataFlowExecutor->Kill() ;
1652 MESSAGE( "Graph execution was killed " << RetVal ) ;
1655 endService( "CNode_Impl::Kill" );
1658 bool CNode_Impl::KillDone() {
1659 // beginService( "CNode_Impl::KillDone" );
1660 bool RetVal = false ;
1661 GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1662 if ( _DataFlowExecutor ) {
1664 RetVal = _DataFlowExecutor->KillDone( Name() ) ;
1667 // endService( "CNode_Impl::KillDone" );
1670 bool CNode_Impl::Stop() {
1671 // beginService( "CNode_Impl::Stop" );
1672 bool RetVal ; // = _DataFlowExecutor->Stop() ;
1673 // endService( "CNode_Impl::Stop" );
1676 bool CNode_Impl::Suspend() {
1677 beginService( "CNode_Impl::Suspend" );
1678 bool RetVal = false ;
1679 GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1680 if ( _DataFlowExecutor ) {
1682 MESSAGE( "CNode_Impl::Suspend " << Name() ) ;
1683 RetVal = _DataFlowExecutor->Suspend( Name() ) ;
1686 MESSAGE( "CNode_Impl::Suspend " << _DataFlowExecutor->Graph()->Name() ) ;
1687 RetVal = _DataFlowExecutor->Suspend() ;
1690 endService( "CNode_Impl::Suspend" );
1693 bool CNode_Impl::SuspendDone() {
1694 // beginService( "CNode_Impl::SuspendDone" );
1695 bool RetVal = false ;
1696 GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1697 if ( _DataFlowExecutor ) {
1699 RetVal = _DataFlowExecutor->SuspendDone( Name() ) ;
1702 RetVal = _DataFlowExecutor->SuspendDone() ;
1705 // endService( "CNode_Impl::SuspendDone" );
1708 bool CNode_Impl::Resume() {
1709 bool RetVal = false ;
1710 beginService( "CNode_Impl::Resume" );
1711 GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1712 if ( _DataFlowExecutor ) {
1714 MESSAGE( "CNode_Impl::Resume " << Name() ) ;
1715 RetVal = _DataFlowExecutor->Resume( Name() ) ;
1718 MESSAGE( "CNode_Impl::Resume " << _DataFlowExecutor->Graph()->Name() ) ;
1719 RetVal = _DataFlowExecutor->Resume() ;
1722 endService( "CNode_Impl::Resume" );
1726 bool CNode_Impl::Run() {
1727 beginService( "CNode_Impl::Run" );
1728 bool RetVal = false ;
1729 GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1730 if ( _DataFlowExecutor ) {
1731 _DataFlowEditor->EditedAfterExecution( false ) ;
1733 RetVal = _DataFlowExecutor->Run( Name() , Name() , false ) ;
1736 RetVal = _DataFlowExecutor->Run( false ) ;
1739 endService( "CNode_Impl::Run" );
1743 bool CNode_Impl::ReRun() {
1744 beginService( "CNode_Impl::ReRun" );
1745 bool RetVal = false ;
1746 GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1747 if ( _DataFlowExecutor ) {
1748 _DataFlowEditor->EditedAfterExecution( false ) ;
1750 RetVal = _DataFlowExecutor->Run( Name() , Name() , false ) ;
1752 else if ( DataFlowEditor()->IsEditing() ) {
1753 // RetVal = _DataFlowExecutor->Run( false ) ;
1754 return ((Graph_Impl::Graph_Impl *) this)->Graph_Impl::Run() ;
1757 endService( "CNode_Impl::ReRun" );
1761 bool CNode_Impl::ReRunAt( const char * aNodeName ) {
1762 beginService( "CNode_Impl::ReRunAt" );
1763 bool RetVal = false ;
1764 GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1765 if ( _DataFlowExecutor ) {
1766 _DataFlowEditor->EditedAfterExecution( false ) ;
1768 RetVal = _DataFlowExecutor->Run( Name() , aNodeName , false ) ;
1771 endService( "CNode_Impl::ReRunAt" );
1775 bool CNode_Impl::ReStart() {
1776 beginService( "CNode_Impl::ReStart" );
1777 bool RetVal = false ;
1778 GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1779 if ( _DataFlowExecutor ) {
1781 RetVal = _DataFlowExecutor->Run( Name() , Name() , true ) ;
1784 RetVal = _DataFlowExecutor->Run( true ) ;
1787 endService( "CNode_Impl::ReStart" );
1791 bool CNode_Impl::ReStartAt( const char * aNodeName ) {
1792 beginService( "CNode_Impl::ReStartAt" );
1793 bool RetVal = false ;
1794 GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1795 if ( _DataFlowExecutor ) {
1797 RetVal = _DataFlowExecutor->Run( Name() , aNodeName , true ) ;
1800 endService( "CNode_Impl::ReStartAt" );
1804 long CNode_Impl::CpuUsed() {
1806 GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
1807 if ( _DataFlowExecutor ) {
1809 RetVal = _DataFlowExecutor->CpuUsed( Name() ) ;
1812 RetVal = _DataFlowExecutor->CpuUsed() ;