+//STEP B : InPorts of EndSwitchNode directly connected from an OutPort of the SwitchNode
+ for ( i = 0 ; i < GetNodeOutPortsSize() ; i++ ) {
+ GraphBase::OutPort * anOutPort = GetChangeNodeOutPort( i );
+ GraphBase::InPort * anInPort ;
+ int j ;
+ for ( j = 0 ; j < anOutPort->InPortsSize() ; j++ ) {
+ anInPort = anOutPort->ChangeInPorts( j ) ;
+//Update the OutPort field in the Inports directly connected of the EndSwitchNode :
+ if ( !strcmp( anInPort->NodeName() , anEndSwitchNode->Name() ) ) {
+#if OutParametersSetTrace
+ cdebug << "OutParametersSet " << Name() << " " << anInPort->NodeName()
+ << "( " << anInPort->PortName() << " , " << anInPort->Kind()
+ << " ) directly connected " ;
+ if ( anInPort->GetOutPort() ) {
+ cdebug << "linked from " << anInPort->GetOutPort()->NodeName()
+ << "( " << anInPort->GetOutPort()->PortName() << " ) " ;
+ }
+ else {
+ cdebug << "NOT linked " ;
+ }
+ cdebug << "CHANGED TO linked from " << anOutPort->NodeName() << "( "
+ << anOutPort->PortName() << " )" << endl ;
+#endif
+ anInPort->ChangeOutPort( anOutPort ) ;
+ }
+ }
+ }
+//STEP C : If it is not the DefaultBranch, explore the SwitchBranch and all NOTSwitchBranch[es]
+//Change recursively InPorts of EndSwitchNode linked to that Branch (or that SwitchNode)
+ if ( OrSwitch ) {
+ for ( i = 0 ; i < LinkedNodesSize() ; i++ ) {
+ GraphBase::ComputingNode * aNode = (GraphBase::ComputingNode * ) LinkedNodes( i ) ;
+ if ( aNode != anEndSwitchNode && !aNode->IsGOTONode() &&
+ !aNode->IsDataFlowNode() && !aNode->IsDataStreamNode() ) {
+ const GraphBase::InPort * anInGate = aNode->GetNodeInGate() ;
+ GraphExecutor::InNode * anInNode = (GraphExecutor::InNode * ) aNode->GetInNode() ;
+//STEP C1 : SwitchBranch :
+ if ( anInGate->GetOutPort() ) {
+ if ( anInGate->GetOutPort()->BoolValue() ) {
+#if OutParametersSetTrace
+ cdebug << "OutParametersSet " << Name() << " SWITCHBranch " << aNode->Name() << endl ;
+#endif
+ int j ;
+ for ( j = 0 ; j < aNode->GetNodeOutPortsSize() ; j++ ) {
+ GraphBase::OutPort * anOutPort = aNode->GetChangeNodeOutPort( j );
+ anInNode->SetOutPortsOfInportsOfEndSwitch( anOutPort , anEndSwitchNode->Name() ) ;
+ }
+ }
+ }
+//STEP C2 : NOTSwitchBranch :
+ else {
+#if OutParametersSetTrace
+ cdebug << "OutParametersSet " << Name() << " NOTSWITCHBranch " << aNode->Name() << endl ;
+#endif
+ int j ;
+ for ( j = 0 ; j < aNode->GetNodeOutPortsSize() ; j++ ) {
+ GraphBase::OutPort * anOutPort = aNode->GetChangeNodeOutPort( j );
+ anInNode->SetOutPortsOfInportsOfEndSwitch( anOutPort , anEndSwitchNode->Name() ) ;
+ }
+ }
+ }
+ }
+ }