( igoto == 1 && aCNode->IsGOTONode() ) ) {
if ( aCNode->IsFactoryNode() ) {
GraphBase::FactoryNode * aFNode = (GraphBase::FactoryNode * ) aCNode ;
- (*_list_nodes)[ind].theComponentName = CORBA::string_dup( aFNode->ComponentName());
- (*_list_nodes)[ind].theInterfaceName = CORBA::string_dup( aFNode->InterfaceName());
+//JR 24.02.2005 Memory Leak (*_list_nodes)[ind].theComponentName = CORBA::string_dup( aFNode->ComponentName());
+ (*_list_nodes)[ind].theComponentName = string( aFNode->ComponentName());
+//JR 24.02.2005 Memory Leak (*_list_nodes)[ind].theInterfaceName = CORBA::string_dup( aFNode->InterfaceName());
+ (*_list_nodes)[ind].theInterfaceName = string( aFNode->InterfaceName());
}
else {
- (*_list_nodes)[ind].theComponentName = CORBA::string_dup( "" );
- (*_list_nodes)[ind].theInterfaceName = CORBA::string_dup( "" );
+ (*_list_nodes)[ind].theComponentName = string( "" );
+ (*_list_nodes)[ind].theInterfaceName = string( "" );
}
- (*_list_nodes)[ind].theName = CORBA::string_dup( aCNode->Name() );
+//JR 24.02.2005 Memory Leak (*_list_nodes)[ind].theName = CORBA::string_dup( aCNode->Name() );
+ (*_list_nodes)[ind].theName = string( aCNode->Name() );
(*_list_nodes)[ind].theKind = aCNode->Kind();
if ( aCNode->IsInLineNode() || aCNode->IsMacroNode() ) {
GraphBase::InLineNode * aINode = (GraphBase::InLineNode * ) aCNode ;
(*_list_nodes)[ind].theListOfFuncName.resize( 1 ) ;
- (*_list_nodes)[ind].theListOfFuncName[0] = CORBA::string_dup( aINode->PyFuncName() ) ;
+//JR 24.02.2005 Memory Leak (*_list_nodes)[ind].theListOfFuncName[0] = CORBA::string_dup( aINode->PyFuncName() ) ;
+ (*_list_nodes)[ind].theListOfFuncName[0] = string( aINode->PyFuncName() ) ;
(*_list_nodes)[ind].theListOfPythonFunctions.resize( 1 ) ;
(*_list_nodes)[ind].theListOfPythonFunctions[0] = aINode->PythonFunction() ;
}
if ( aCNode->IsGOTONode() ) {
GraphBase::GOTONode * aGNode = (GraphBase::GOTONode * ) aCNode ;
(*_list_nodes)[ind].theListOfFuncName.resize( 1 ) ;
- (*_list_nodes)[ind].theListOfFuncName[0] = CORBA::string_dup( aGNode->PyFuncName() ) ;
+//JR 24.02.2005 Memory Leak (*_list_nodes)[ind].theListOfFuncName[0] = CORBA::string_dup( aGNode->PyFuncName() ) ;
+ (*_list_nodes)[ind].theListOfFuncName[0] = string( aGNode->PyFuncName() ) ;
(*_list_nodes)[ind].theListOfPythonFunctions.resize( 1 ) ;
(*_list_nodes)[ind].theListOfPythonFunctions[0] = aGNode->PythonFunction() ;
}
if ( aCNode->IsLoopNode() ) {
GraphBase::LoopNode * aLNode = (GraphBase::LoopNode * ) aCNode ;
- (*_list_nodes)[ind].theCoupledNode = CORBA::string_dup( aLNode->CoupledNode()->Name() ) ;
+//JR 24.02.2005 Memory Leak (*_list_nodes)[ind].theCoupledNode = CORBA::string_dup( aLNode->CoupledNode()->Name() ) ;
+ (*_list_nodes)[ind].theCoupledNode = string( aLNode->CoupledNode()->Name() ) ;
(*_list_nodes)[ind].theListOfFuncName.resize( 3 ) ;
- (*_list_nodes)[ind].theListOfFuncName[0] = CORBA::string_dup( aLNode->PyFuncName() ) ;
- (*_list_nodes)[ind].theListOfFuncName[1] = CORBA::string_dup( aLNode->PyMoreName() ) ;
- (*_list_nodes)[ind].theListOfFuncName[2] = CORBA::string_dup( aLNode->PyNextName() ) ;
+//JR 24.02.2005 Memory Leak (*_list_nodes)[ind].theListOfFuncName[0] = CORBA::string_dup( aLNode->PyFuncName() ) ;
+ (*_list_nodes)[ind].theListOfFuncName[0] = string( aLNode->PyFuncName() ) ;
+//JR 24.02.2005 Memory Leak (*_list_nodes)[ind].theListOfFuncName[1] = CORBA::string_dup( aLNode->PyMoreName() ) ;
+ (*_list_nodes)[ind].theListOfFuncName[1] = string( aLNode->PyMoreName() ) ;
+//JR 24.02.2005 Memory Leak (*_list_nodes)[ind].theListOfFuncName[2] = CORBA::string_dup( aLNode->PyNextName() ) ;
+ (*_list_nodes)[ind].theListOfFuncName[2] = string( aLNode->PyNextName() ) ;
(*_list_nodes)[ind].theListOfPythonFunctions.resize( 3 ) ;
(*_list_nodes)[ind].theListOfPythonFunctions[0] = aLNode->PythonFunction() ;
(*_list_nodes)[ind].theListOfPythonFunctions[1] = aLNode->MorePythonFunction() ;
}
else if ( aCNode->IsSwitchNode() ) {
GraphBase::SwitchNode * aSNode = (GraphBase::SwitchNode * ) aCNode ;
- (*_list_nodes)[ind].theCoupledNode = CORBA::string_dup( aSNode->CoupledNode()->Name() ) ;
+//JR 24.02.2005 Memory Leak (*_list_nodes)[ind].theCoupledNode = CORBA::string_dup( aSNode->CoupledNode()->Name() ) ;
+ (*_list_nodes)[ind].theCoupledNode = string( aSNode->CoupledNode()->Name() ) ;
(*_list_nodes)[ind].theListOfFuncName.resize( 1 ) ;
- (*_list_nodes)[ind].theListOfFuncName[0] = CORBA::string_dup( aSNode->PyFuncName() ) ;
+//JR 24.02.2005 Memory Leak (*_list_nodes)[ind].theListOfFuncName[0] = CORBA::string_dup( aSNode->PyFuncName() ) ;
+ (*_list_nodes)[ind].theListOfFuncName[0] = string( aSNode->PyFuncName() ) ;
(*_list_nodes)[ind].theListOfPythonFunctions.resize( 1 ) ;
(*_list_nodes)[ind].theListOfPythonFunctions[0] = aSNode->PythonFunction() ;
}
else if ( aCNode->IsEndLoopNode() ) {
GraphBase::EndOfLoopNode * aELNode = (GraphBase::EndOfLoopNode * ) aCNode ;
- (*_list_nodes)[ind].theCoupledNode = CORBA::string_dup( aELNode->CoupledNode()->Name() ) ;
+//JR 24.02.2005 Memory Leak (*_list_nodes)[ind].theCoupledNode = CORBA::string_dup( aELNode->CoupledNode()->Name() ) ;
+ (*_list_nodes)[ind].theCoupledNode = string( aELNode->CoupledNode()->Name() ) ;
(*_list_nodes)[ind].theListOfFuncName.resize( 1 ) ;
- (*_list_nodes)[ind].theListOfFuncName[0] = CORBA::string_dup( aELNode->PyFuncName() ) ;
+//JR 24.02.2005 Memory Leak (*_list_nodes)[ind].theListOfFuncName[0] = CORBA::string_dup( aELNode->PyFuncName() ) ;
+ (*_list_nodes)[ind].theListOfFuncName[0] = string( aELNode->PyFuncName() ) ;
(*_list_nodes)[ind].theListOfPythonFunctions.resize( 1 ) ;
(*_list_nodes)[ind].theListOfPythonFunctions[0] = aELNode->PythonFunction() ;
}
else if ( aCNode->IsEndSwitchNode() ) {
GraphBase::EndOfSwitchNode * aESNode = (GraphBase::EndOfSwitchNode * ) aCNode ;
- (*_list_nodes)[ind].theCoupledNode = CORBA::string_dup( aESNode->CoupledNode()->Name() ) ;
+//JR 24.02.2005 Memory Leak (*_list_nodes)[ind].theCoupledNode = CORBA::string_dup( aESNode->CoupledNode()->Name() ) ;
+ (*_list_nodes)[ind].theCoupledNode = string( aESNode->CoupledNode()->Name() ) ;
(*_list_nodes)[ind].theListOfFuncName.resize( 1 ) ;
- (*_list_nodes)[ind].theListOfFuncName[0] = CORBA::string_dup( aESNode->PyFuncName() ) ;
+//JR 24.02.2005 Memory Leak (*_list_nodes)[ind].theListOfFuncName[0] = CORBA::string_dup( aESNode->PyFuncName() ) ;
+ (*_list_nodes)[ind].theListOfFuncName[0] = string( aESNode->PyFuncName() ) ;
(*_list_nodes)[ind].theListOfPythonFunctions.resize( 1 ) ;
(*_list_nodes)[ind].theListOfPythonFunctions[0] = aESNode->PythonFunction() ;
}
else if ( aCNode->IsMacroNode() ) {
GraphBase::Graph * aGraph = (GraphBase::Graph * ) aCNode ;
- (*_list_nodes)[ind].theCoupledNode = CORBA::string_dup( aGraph->CoupledNode()->Name() ) ;
+//JR 24.02.2005 Memory Leak (*_list_nodes)[ind].theCoupledNode = CORBA::string_dup( aGraph->CoupledNode()->Name() ) ;
+ (*_list_nodes)[ind].theCoupledNode = string( aGraph->CoupledNode()->Name() ) ;
(*_list_nodes)[ind].theListOfFuncName.resize( 1 ) ;
- (*_list_nodes)[ind].theListOfFuncName[0] = CORBA::string_dup( aGraph->PyFuncName() ) ;
+//JR 24.02.2005 Memory Leak (*_list_nodes)[ind].theListOfFuncName[0] = CORBA::string_dup( aGraph->PyFuncName() ) ;
+ (*_list_nodes)[ind].theListOfFuncName[0] = string( aGraph->PyFuncName() ) ;
(*_list_nodes)[ind].theListOfPythonFunctions.resize( 1 ) ;
(*_list_nodes)[ind].theListOfPythonFunctions[0] = aGraph->PythonFunction() ;
}
else {
- (*_list_nodes)[ind].theCoupledNode = CORBA::string_dup( "" ) ;
+ (*_list_nodes)[ind].theCoupledNode = string( "" ) ;
}
// (*_list_nodes)[ind].theDataStreamInArgsNumber = aCNode->DataStreamInPortsNumber() ;
// (*_list_nodes)[ind].theDataStreamOutArgsNumber = aCNode->DataStreamOutPortsNumber() ;
}
(*_list_nodes)[ind].theFirstCreation = aCNode->FirstCreation();
(*_list_nodes)[ind].theLastModification = aCNode->LastModification();
- (*_list_nodes)[ind].theEditorRelease = CORBA::string_dup( aCNode->EditorRelease());
- (*_list_nodes)[ind].theAuthor = CORBA::string_dup( aCNode->Author());
+//JR 24.02.2005 Memory Leak (*_list_nodes)[ind].theEditorRelease = CORBA::string_dup( aCNode->EditorRelease());
+ (*_list_nodes)[ind].theEditorRelease = string( aCNode->EditorRelease());
+//JR 24.02.2005 Memory Leak (*_list_nodes)[ind].theAuthor = CORBA::string_dup( aCNode->Author());
if ( aCNode->IsFactoryNode() ) {
GraphBase::FactoryNode * aFNode = (GraphBase::FactoryNode * ) aCNode ;
- (*_list_nodes)[ind].theContainer = CORBA::string_dup( aFNode->Computer());
+//JR 24.02.2005 Memory Leak (*_list_nodes)[ind].theContainer = CORBA::string_dup( aFNode->Computer());
+ (*_list_nodes)[ind].theContainer = string( aFNode->Computer());
}
else {
- (*_list_nodes)[ind].theContainer = CORBA::string_dup( "" );
+//JR 24.02.2005 Memory Leak (*_list_nodes)[ind].theContainer = CORBA::string_dup( "" );
+ (*_list_nodes)[ind].theContainer = string( "" );
}
- (*_list_nodes)[ind].theComment = CORBA::string_dup( aCNode->Comment());
+//JR 24.02.2005 Memory Leak (*_list_nodes)[ind].theComment = CORBA::string_dup( aCNode->Comment());
+ (*_list_nodes)[ind].theComment = string( aCNode->Comment());
(*_list_nodes)[ind].theCoords.theX = aCNode->XCoordinate();
(*_list_nodes)[ind].theCoords.theY = aCNode->YCoordinate();
#if 0
if ( anInPort->IsBus() ) {
nports += 1 ;
(*_list_nodes)[ind].theListOfParameters.resize( nports ) ;
- (*_list_nodes)[ind].theListOfParameters[ nports-1 ].theInParameter.Parametertype = CORBA::string_dup( anInPort->PortType() ) ;
- (*_list_nodes)[ind].theListOfParameters[ nports-1 ].theInParameter.Parametername = CORBA::string_dup( anInPort->PortName() ) ;
- (*_list_nodes)[ind].theListOfParameters[ nports-1 ].theOutParameter.Parametertype = CORBA::string_dup( aCNode->GetNodeOutPort( anInPort->PortIndex() )->PortType() ) ;
- (*_list_nodes)[ind].theListOfParameters[ nports-1 ].theOutParameter.Parametername = CORBA::string_dup( aCNode->GetNodeOutPort( anInPort->PortIndex() )->PortName() ) ;
+//JR 24.02.2005 Memory Leak (*_list_nodes)[ind].theListOfParameters[ nports-1 ].theInParameter.Parametertype = CORBA::string_dup( anInPort->PortType() ) ;
+ (*_list_nodes)[ind].theListOfParameters[ nports-1 ].theInParameter.Parametertype = string( anInPort->PortType() ) ;
+//JR 24.02.2005 Memory Leak (*_list_nodes)[ind].theListOfParameters[ nports-1 ].theInParameter.Parametername = CORBA::string_dup( anInPort->PortName() ) ;
+ (*_list_nodes)[ind].theListOfParameters[ nports-1 ].theInParameter.Parametername = string( anInPort->PortName() ) ;
+//JR 24.02.2005 Memory Leak (*_list_nodes)[ind].theListOfParameters[ nports-1 ].theOutParameter.Parametertype = CORBA::string_dup( aCNode->GetNodeOutPort( anInPort->PortIndex() )->PortType() ) ;
+ (*_list_nodes)[ind].theListOfParameters[ nports-1 ].theOutParameter.Parametertype = string( aCNode->GetNodeOutPort( anInPort->PortIndex() )->PortType() ) ;
+//JR 24.02.2005 Memory Leak (*_list_nodes)[ind].theListOfParameters[ nports-1 ].theOutParameter.Parametername = CORBA::string_dup( aCNode->GetNodeOutPort( anInPort->PortIndex() )->PortName() ) ;
+ (*_list_nodes)[ind].theListOfParameters[ nports-1 ].theOutParameter.Parametername = string( aCNode->GetNodeOutPort( anInPort->PortIndex() )->PortName() ) ;
}
}
#endif
// All the links from _LinksList are taken
// vector< InNode *> Nodes = InNodes() ;
+ cdebug_in << "Graph::GetLinks( " << AllLinks << " ) " << endl ;
int ind = 0 ;
int k ;
for ( k = 0 ; k < GraphNodesSize() ; k++ ) {
GraphBase::ComputingNode * fromNode = GraphNodes( k ) ;
+// cdebug << "GraphBase::Graph::GetLinks k" << k << ". :" << fromNode->Name() << endl ;
int i ;
for ( i = 0 ; i < fromNode->GetNodeOutPortsSize() ; i++ ) {
const GraphBase::OutPort* fromPort = fromNode->GetNodeOutPort( i ) ;
+// cdebug << "GraphBase::Graph::GetLinks k" << k << ". :" << fromNode->Name()
+// << " i" << i << ". : " << fromPort->PortName() << endl ;
int j ;
for ( j = 0 ; j < fromPort->InPortsSize() ; j++ ) {
const GraphBase::InPort* toPort = fromPort->InPorts( j ) ;
+// cdebug << "GraphBase::Graph::GetLinks k" << k << ". : fromNode " << fromNode << " = "
+// << fromNode->Name() << " i" << i << ". : fromPort " << fromPort << " = "
+// << fromPort->PortName() << " j" << j << ". : toPort " << toPort << " = "
+// << toPort->NodeName() << "( " << toPort->PortName() << " )" << endl ;
if ( toPort->IsPortConnected() ) {
// Desole pour ce cast mais avec les maps difficile de faire const ...
- const GraphBase::ComputingNode * toNode = ((GraphBase::Graph * ) this)->GetGraphNode( toPort->NodeName() ) ;
+// const GraphBase::ComputingNode * toNode = ((GraphBase::Graph * ) this)->GetGraphNode( toPort->NodeName() ) ;
+// cdebug << "GraphBase::Graph::GetLinks " << fromNode->Name() << " ("
+// << fromPort->PortName() << " ) IsPortConnected" << fromPort->IsPortConnected()
+// << " --> toNode " << toNode << " " << toPort->NodeName() << "( "
+// << toPort->PortName() << " ) " << " " << fromPort->InPortsSize() << " ports"
+// << endl ;
if ( !(fromPort->IsLoop() && toPort->IsLoop() ) || AllLinks ) {
- cdebug << "GraphBase::Graph::GetLinks " << fromNode->Name() << " ("
- << fromPort->PortName() << " ) IsPortConnected" << fromPort->IsPortConnected()
- << " --> " << toNode->Name() << "( " << toPort->PortName() << " ) "
- << " " << fromPort->InPortsSize() << " ports" << endl ;
+// cdebug << "GraphBase::Graph::GetLinks " << fromNode->Name() << " ("
+// << fromPort->PortName() << " ) IsPortConnected" << fromPort->IsPortConnected()
+// << " --> " << toNode->Name() << "( " << toPort->PortName() << " ) "
+// << " " << fromPort->InPortsSize() << " ports" << endl ;
_list_links->resize( ind+1 );
- (*_list_links)[ind].FromNodeName = CORBA::string_dup( fromNode->Name() );
+//JR 23.02.2005 Memory Leak (*_list_links)[ind].FromNodeName = CORBA::string_dup( fromNode->Name() );
+ (*_list_links)[ind].FromNodeName = string( fromNode->Name() );
(*_list_links)[ind].FromServiceParameterName = fromPort->GetServicesParameter().Parametername;
- (*_list_links)[ind].ToNodeName = CORBA::string_dup( toPort->NodeName() );
+//JR 23.02.2005 Memory Leak (*_list_links)[ind].ToNodeName = CORBA::string_dup( toPort->NodeName() );
+ (*_list_links)[ind].ToNodeName = string( toPort->NodeName() );
(*_list_links)[ind].ToServiceParameterName = toPort->GetServicesParameter().Parametername;
- (*_list_links)[ind].aLinkValue = *fromPort->Value() ;
+//JR 30.03.2005 (*_list_links)[ind].aLinkValue = *fromPort->Value() ;
+ (*_list_links)[ind].aLinkValue = fromPort->Value() ;
if ( toPort->IsEndSwitch() ) {
(*_list_links)[ind++].aListOfCoords = *(fromPort->Coords()) ;
}
}
}
else {
- cdebug << "GraphBase::Graph::GetLinks " << fromNode->Name() << " "
- << fromPort->PortName() << " ) " << fromPort->PortStatus()
- << " --> " << toPort->NodeName() << "( " << toPort->PortName() << " ) "
- << " " << toPort->PortStatus() << " " << fromPort->InPortsSize() << " ports ignored" << endl ;
+// cdebug << "GraphBase::Graph::GetLinks " << fromNode->Name() << " "
+// << fromPort->PortName() << " ) " << fromPort->PortStatus()
+// << " --> " << toPort->NodeName() << "( " << toPort->PortName() << " ) "
+// << " " << toPort->PortStatus() << " " << fromPort->InPortsSize()
+// << " ports ignored" << endl ;
}
}
}
}
+ cdebug_out << "Graph::GetLinks( " << AllLinks << " ) " << endl ;
return _list_links;
}
GraphBase::InPort* toPort ) {
GraphBase::SLink * _link = new GraphBase::SLink ;
GraphBase::OutPort* fromPort = toPort->GetOutPort() ;
- _link->FromNodeName = CORBA::string_dup( fromPort->NodeName() );
+//JR 24.02.2005 Memory Leak _link->FromNodeName = CORBA::string_dup( fromPort->NodeName() );
+ _link->FromNodeName = string( fromPort->NodeName() );
_link->FromServiceParameterName = fromPort->GetServicesParameter().Parametername;
- _link->ToNodeName = CORBA::string_dup( toPort->NodeName() );
+//JR 24.02.2005 Memory Leak _link->ToNodeName = CORBA::string_dup( toPort->NodeName() );
+ _link->ToNodeName = string( toPort->NodeName() );
_link->ToServiceParameterName = toPort->GetServicesParameter().Parametername;
- CORBA::Any aSPValue = *fromPort->Value() ;
+//JR 30.03.2005 CORBA::Any aSPValue = *fromPort->Value() ;
+ CORBA::Any aSPValue = fromPort->Value() ;
_link->aLinkValue = aSPValue;
_link->aListOfCoords = *(toPort->Coords()) ;
return _link;
// input ports. Input(s) of a DataFlow match one or several output-virtual-dataport
for ( j = 0 ; j < fromDataPort->InPortsSize() ; j++ ) {
_list_datalinks->resize( ind+1 );
- (*_list_datalinks)[ind].FromNodeName = CORBA::string_dup( aDataNode->Name() );
+//JR 24.02.2005 Memory Leak (*_list_datalinks)[ind].FromNodeName = CORBA::string_dup( aDataNode->Name() );
+ (*_list_datalinks)[ind].FromNodeName = string( aDataNode->Name() );
(*_list_datalinks)[ind].FromServiceParameterName = fromDataPort->GetServicesParameter().Parametername;
const GraphBase::InPort* toPort = fromDataPort->InPorts( j ) ;
- (*_list_datalinks)[ind].ToNodeName = CORBA::string_dup( toPort->NodeName() );
+//JR 24.02.2005 Memory Leak (*_list_datalinks)[ind].ToNodeName = CORBA::string_dup( toPort->NodeName() );
+ (*_list_datalinks)[ind].ToNodeName = string( toPort->NodeName() );
(*_list_datalinks)[ind].ToServiceParameterName = toPort->GetServicesParameter().Parametername;
- CORBA::Any aSPValue = *fromDataPort->Value() ;
+//JR 30.03.2005 CORBA::Any aSPValue = *fromDataPort->Value() ;
+ CORBA::Any aSPValue = fromDataPort->Value() ;
(*_list_datalinks)[ind].aLinkValue = aSPValue;
(*_list_datalinks)[ind++].aListOfCoords = *(toPort->Coords()) ;
}
}
}
-#if 0
-// Output(s) of a DataFlow match only one input-virtual-dataport
- for ( i = 0 ; i < aDataNode->GetNodeOutDataNodePortsSize() ; i++ ) {
- GraphBase::InPort* toDataPort = aDataNode->GetChangeNodeOutDataNodePort( i ) ;
- const GraphBase::OutPort* fromPort = toDataPort->GetLink() ;
- if ( fromPort->IsDataConnected() ) {
- _list_datalinks->length( ind+1 );
- _list_datalinks[ind].FromNodeName = CORBA::string_dup( fromPort->NodeName() );
- _list_datalinks[ind].FromServiceParameterName = fromPort->GetServicesParameter().Parametername;
- _list_datalinks[ind].ToNodeName = CORBA::string_dup( aDataNode->Name() );
- _list_datalinks[ind].ToServiceParameterName = toDataPort->GetServicesParameter().Parametername;
-// SALOME_SuperVisionBase::ServicesParameterValue aSPValue;
- CORBA::Any aSPValue = *fromPort->Value() ;
-// aSPValue.Value = CORBA::string_dup( fromPort->Value() );
-// aSPValue.Kind = fromPort->Kind();
- _list_datalinks[ind].aLinkValue = aSPValue;
- _list_datalinks[ind++].aListOfCoords = toDataPort->Coords() ;
- }
- }
-#endif
-
return _list_datalinks ;
}
GraphBase::ComputingNode * aNode = GetChangeGraphNode( index ) ;
// Update 'ToNode's Map from 'aNode'
- cdebug << "Graph::ReNameNode " << aNode->Name() << " LinkedNodesSize "
+ cdebug << "Graph::ReNameNode " << aNode->Name() << " LinkedNodesSize : "
<< aNode->LinkedNodesSize() << endl ;
for ( i = 0 ; i < aNode->LinkedNodesSize() ; i++ ) {
GraphBase::StreamNode * ToNode = aNode->LinkedNodes( i ) ;
ToNode->ReNameLinkedFromNode( OldNodeName , NewNodeName ) ;
}
-// Update 'FomNode's Map to 'aNode'
+// Rename in _MapOfLinkedNodes of 'FromNode'
+ cdebug << "Graph::ReNameNode " << aNode->Name() << " LinkedFromNodesSize : "
+ << aNode->LinkedFromNodesSize() << endl ;
+ for ( i = 0 ; i < aNode->LinkedFromNodesSize() ; i++ ) {
+ GraphBase::StreamNode * FromNode = aNode->LinkedFromNodes( i ) ;
+ if ( FromNode->GetLinkedNodeIndex( OldNodeName ) >= 0 ) {
+ FromNode->ReNameLinkedNode( OldNodeName , NewNodeName ) ;
+ }
+ else {
+ FromNode->ReNameStreamLinkedNode( OldNodeName , NewNodeName ) ;
+ }
+ }
// Inports 'anInPort' of 'aNode'
for ( i = aNode->GetNodeInPortsSize()-1 ; i >= 0 ; i-- ) {
GraphBase::InPort * anInPort = aNode->GetChangeNodeInPort( i ) ;
else {
FromNode = this ;
}
-// Rename in _MapOfLinkedFromNodes of 'FromNode'
cdebug << " fromConnected " << anOutPort->NodeName() << endl ;
+#if 0
+//JR 26.01.2005 : a same node may be renamed severeal times. So this is done above
+// Rename in _MapOfLinkedFromNodes of 'FromNode'
if ( anInPort->IsDataStream() ) {
FromNode->ReNameStreamLinkedNode( OldNodeName , NewNodeName ) ;
}
else {
FromNode->ReNameLinkedNode( OldNodeName , NewNodeName ) ;
}
+#endif
}
char* OldNodePortName = new char[ strlen( OldNodeName ) +
strlen( aNode->GetChangeNodeInPort( i )->PortName() ) + 3 ] ;
}
}
RetVal = true ;
+// PAL8508
+//JR 02.02.2005 DEBUG : ReName in the CoupledNode was missing
+ if ( aNode->IsLoopNode() || aNode->IsEndLoopNode() ||
+ aNode->IsSwitchNode() || aNode->IsEndSwitchNode() ) {
+ GraphBase::GOTONode * theCoupledNode = NULL ;
+ theCoupledNode = (GraphBase::GOTONode * ) ((GraphBase::GOTONode * ) aNode)->CoupledNode() ;
+ theCoupledNode->CoupledNodeName( aNode->Name() ) ;
+ }
+ else if ( aNode->IsInLineNode() ) {
+ GraphBase::OutPort * anOutPort = aNode->GetNodeInGate()->GetOutPort() ;
+ if ( anOutPort ) {
+ GraphBase::ComputingNode * aLinkedNode ;
+ aLinkedNode = GetChangeGraphNode( anOutPort->NodeName() ) ;
+ if ( aLinkedNode->IsGOTONode() ) {
+ ((GraphBase::GOTONode * ) aLinkedNode)->CoupledNodeName( aNode->Name() ) ;
+ }
+ }
+ }
}
else {
cdebug << "ERROR Node not found" << endl ;
<< aNode->LinkedFromNodes( i )->Name() << endl ;
}
}
+//PAL8177-PAL8509
+//JR 24.03.2005 : Debug : CoupledNode field of GOTONodes was not erased
+ if ( aNode->IsInLineNode() ) {
+ GraphBase::OutPort * anOutPort = aNode->GetNodeInGate()->GetOutPort() ;
+ if ( anOutPort ) {
+ GraphBase::ComputingNode * aLinkedNode ;
+ aLinkedNode = GetChangeGraphNode( anOutPort->NodeName() ) ;
+ if ( aLinkedNode->IsGOTONode() ) {
+ cdebug << "Graph::RemoveNode erase CoupledNode " << aLinkedNode->Name() << endl ;
+ ((GraphBase::GOTONode * ) aLinkedNode)->CoupledNode( NULL ) ;
+ ((GraphBase::GOTONode * ) aLinkedNode)->CoupledNodeName( "" ) ;
+ }
+ }
+ }
if ( !aNode->IsEndSwitchNode() ) {
if ( aNode->GetNodeInPortsSize() ) {
for ( i = aNode->GetNodeInPortsSize()-1 ; i >= 0 ; i-- ) {
int k ;
for ( k = anOutPort->InPortsSize() - 1 ; k >= 0 ; k-- ) {
GraphBase::InPort * anInPort = anOutPort->ChangeInPorts( k ) ;
- if ( strcmp( anInPort->NodeName() , aNode->Name() ) == 0 ) {
+ if ( !strcmp( anInPort->NodeName() , aNode->Name() ) ) {
// InPort of the EndSwitchNode
cdebug << " to InPort" << j << ". " << anInPort->NodeName() << "( "
<< anInPort->PortName() << ") "
if ( !anInPort->IsExternConnected() ) {
GraphBase::ComputingNode * ToNode = GetChangeGraphNode( anInPort->NodeName() ) ;
RetVal = anInPort->RemoveOutPort() ;
+// JR 04.02.2005 : Bug if it is a link to an EndSwitchNode. The InPort may be multiple linked !!!
+// PAL7990
if ( !RetVal ) {
cdebug << "anOutPort->RemoveOutPort Error RetVal " << RetVal << endl ;
break ;
cdebug << "anOutPort->RemoveInPort( anInPort ) Error RetVal " << RetVal << endl ;
break ;
}
+ if ( ToNode->IsEndSwitchNode() ) {
+ int i ;
+ int done = false ;
+ for ( i = 0 ; i < ToNode->LinkedFromNodesSize() ; i++ ) {
+ GraphBase::StreamNode * fromNode = ToNode->LinkedFromNodes( i ) ;
+// Not the node that we are deleting ... :
+ if ( strcmp( fromNode->Name() , aNode->Name() ) ) {
+ int j ;
+ for ( j = 0 ; j < fromNode->GetNodeOutPortsSize() ; j++ ) {
+ GraphBase::OutPort * fromOutPort = fromNode->GetChangeNodeOutPort( j ) ;
+ int k ;
+ for ( k = 0 ; k < fromOutPort->InPortsSize() ; k++ ) {
+ if ( strcmp( ToNode->Name() , fromOutPort->InPorts( k )->NodeName() ) == 0 ) {
+ if ( strcmp( anInPort->PortName() , fromOutPort->InPorts( k )->PortName() ) == 0 ) {
+// Restore an OutPort in the InPort
+ anInPort->ChangeOutPort( fromOutPort ) ;
+ cdebug << "Graph::RemoveNode reestablish " << fromOutPort->NodeName() << "( "
+ << fromOutPort->PortName() << " ) in the InPort of EndSwitch : "
+ << ToNode->Name() << "( " << anInPort->PortName() << " )"
+ << anInPort->Kind() << " " << anInPort->PortStatus() << endl;
+ done = true ;
+ break ;
+ }
+ }
+ }
+ if ( done ) {
+ break ;
+ }
+ }
+ if ( done ) {
+ break ;
+ }
+ }
+ }
+ }
}
}
if ( !RetVal ) {
}
}
}
+ if ( aNode->LinkedNodesSize() || aNode->LinkedFromNodesSize() ) {
+ RetVal = 0 ;
+ }
cdebug << "Graph::RemoveNode " << aNode->Name() << " : " << aNode->GetNodeInPortsSize()
<< " InPorts " << aNode->GetNodeOutPortsSize() << " OutPorts "
<< aNode->LinkedNodesSize() << " LinkedNodes " << aNode->LinkedFromNodesSize()
char * theCoupledNodeName = NULL ;
int CoupledIndex = -1 ;
if ( aNode->IsEndLoopNode() || aNode->IsEndSwitchNode() ) {
- theCoupledNode = ((GraphBase::GOTONode * ) aNode)->CoupledNode() ;
theCoupledNodeName = ((GraphBase::GOTONode * ) aNode)->CoupledNodeName() ;
- CoupledIndex = GetGraphNodeIndex( theCoupledNode->Name() ) ;
+ theCoupledNode = ((GraphBase::GOTONode * ) aNode)->CoupledNode() ;
}
+ cdebug << "Node" << index << " " << _GraphNodes[ index ]->Name() << " will be deleted"
+ << endl ;
delete aNode ;
_GraphNodesSize -= 1 ;
for ( i = index ; i < _GraphNodesSize ; i++ ) {
}
_GraphNodes.resize( _GraphNodesSize+1 ) ;
_MapOfGraphNodes.erase( aNodeName ) ;
+// PAL8510
// Delete of the LoopNode of that EndLoopNode or of the SwitchNode of that EndSwitchNode :
if ( theCoupledNode ) {
+//JR 02.02.2005 DEBUG : CoupledIndex must be here after the delete of aNode (not before)
+ CoupledIndex = GetGraphNodeIndex( theCoupledNodeName ) ;
+ cdebug << "CoupledNode" << CoupledIndex << " " << _GraphNodes[ CoupledIndex ]->Name()
+ << " will be deleted" << endl ;
delete theCoupledNode ;
_GraphNodesSize -= 1 ;
for ( i = CoupledIndex ; i < _GraphNodesSize ; i++ ) {
}
}
else {
- cdebug << "Node not found ERROR " << index << endl ;
+ cdebug << "Graph::RemoveNode Node not found ERROR " << index << endl ;
}
- cdebug_out << "GraphBase::Graph::RemoveNode " << RetVal << endl;
+#if 1
+ cdebug << "Graph::RemoveNode " << _GraphNodesSize << " known nodes" << endl;
+ for ( i = 0 ; i < _GraphNodesSize ; i++ ) {
+ cdebug << "Node" << i << _GraphNodes[ i ]->Name() << endl ;
+ }
+ map< string , int >::iterator aMapOfGraphNodesIterator ;
+ i = 0 ;
+ for ( aMapOfGraphNodesIterator = _MapOfGraphNodes.begin() ;
+ aMapOfGraphNodesIterator != _MapOfGraphNodes.end() ; aMapOfGraphNodesIterator++ ) {
+ cdebug << "MapOfGraphNodes " << i++ << " " << aMapOfGraphNodesIterator->first << " --> "
+ << aMapOfGraphNodesIterator->second << " - 1" << endl ;
+ }
+#endif
+
+ cdebug_out << "Graph::RemoveNode " << RetVal << endl;
return RetVal ;
}
return false ;
}
- cdebug_in << "GraphBase::Graph::AddLink(" << fromNode->Name() << "("
- << fromPort->PortName() << " " << fromPort->PortStatus() << ") ---> " << toNode->Name() << "("
- << toPort->PortName() << " " << toPort->PortStatus() << ") )" << endl;
+ cdebug_in << "Graph::AddLink( " << fromNode->Name() << "("
+ << fromPort->PortName() << " " << fromPort->PortStatus() << ") " << fromPort->Kind()
+ << " ---> " << toNode->Name() << "(" << toPort->PortName() << " " << toPort->PortStatus()
+ << ") " << toPort->Kind() << " )" << endl;
if ( fromPort->IsDataConnected() || fromPort->IsExternConnected() ) {
if ( !fromPort->RemoveInPort() ) { // There is only one ===> RemoveOutPort()
cdebug_out << "GraphBase::Graph::AddLink(" << fromNode->Name() << "("
}
}
}
- else if ( !toNode->IsEndSwitchNode() ||
- ( toNode->IsEndSwitchNode() && toPort->IsGate() ) ) {
- if ( !RemoveLink( fromNode->Name() , fromPort->PortName() ,
+//PAL8511
+// JR 17.01.2005 : toPort is already linked : RemoveLink
+ else if ( !toNode->IsEndSwitchNode() ) {
+// else if ( !toNode->IsEndSwitchNode() ||
+// ( toNode->IsEndSwitchNode() && toPort->IsGate() ) ) {
+//JR Debug : the fromPort was wrong !
+// if ( !RemoveLink( fromNode->Name() , fromPort->PortName() ,
+ if ( !RemoveLink( toPort->GetOutPort()->NodeName() , toPort->GetOutPort()->PortName() ,
toNode->Name() , toPort->PortName() ) ) {
cdebug << "RemoveLink(AddLink) toNode->IsEndSwitchNode Error." << endl ;
cdebug_out << "GraphBase::Graph::AddLink" << endl;
return false ;
}
}
+//PAL8511
+//JR Debug 15.02.2005 : Not multiple links in that case except if toPort is the DefaultPort
+ else if ( fromNode->IsSwitchNode() && toNode->IsEndSwitchNode() && !toPort->IsGate() ) {
+ cdebug << "fromNode->IsSwitchNode() && toNode->IsEndSwitchNode toPort(NotGate)Error."
+ << endl ;
+ cdebug_out << "GraphBase::Graph::AddLink" << endl;
+ return false ;
+ }
+ }
+//PAL7990
+//JR 24.03.2005 : No Link between OutPort of SwitchNode to InPort of EndSwitchNode except if
+// they have the same name for a special case :
+// Switch with no branch ==> Default is applied always : GraphSyrControl example
+ else if ( fromNode->IsSwitchNode() && !fromPort->IsGate() &&
+ toNode->IsEndSwitchNode() && !toPort->IsGate() &&
+ strcmp( fromPort->PortName() , toPort->PortName() ) ) {
+ cdebug << "fromNode->IsSwitchNode() && toNode->IsEndSwitchNode Error." << endl ;
+ cdebug_out << "GraphBase::Graph::AddLink" << endl;
+ return false ;
}
else if ( fromNode->IsGOTONode() && fromPort->InPortsSize() ) {
if ( !RemoveLink( fromNode->Name() , fromPort->PortName() ,
}
- if ( toNode->IsEndSwitchNode() && !toPort->IsGate() ) {
+// JR 12.01.2005 : an OutPort of a SwitchNode connected to a Gate can be connected only to Gate
+ if ( !toNode->IsDataFlowNode() && !toNode->IsDataStreamNode() &&
+ fromNode->IsSwitchNode() && fromPort->IsSwitch() && !toPort->IsGate() ) {
+ cdebug << "toPort->AddLink Error( fromPort->IsSwitch() && !toPort->IsGate())." << endl ;
+ cdebug_out << "GraphBase::Graph::AddLink 0" << endl;
+ return false ;
+ }
+//JR 11.02.2005 : SwitchNode(Default) may be only linked to EndSwitchNode(Default)
+// SwitchNode(Param) may be linked to EndSwitchNode(Param)
+// SwitchNode(Param-UserDefault) may be linked to EndSwitchNode(Default)
+ else if ( fromNode->IsSwitchNode() && toNode->IsEndSwitchNode() &&
+ !( ( fromPort->IsGate() && toPort->IsGate() ) ||
+ ( !fromPort->IsGate() ) ) ) {
+// ( !fromPort->IsGate() && !toPort->IsGate() ) ) ) {
+ cdebug << "SwitchNode(Default) may be only linked to EndSwitchNode(Default) AddLink Error."
+ << endl ;
+ cdebug_out << "GraphBase::Graph::AddLink 0" << endl;
+ return false ;
+ }
+ else if ( toNode->IsEndSwitchNode() && !toPort->IsGate() ) {
// if ( !toPort->IsEndSwitch() || !fromPort->AddInPort( toPort ) ) {
if ( !fromPort->AddInPort( toPort ) ) {
cdebug << "toNode->IsEndSwitchNode() : !fromPort->AddInPort( toPort ) AddLink Error."
toPort->Kind( SUPERV::EndSwitchParameter ) ;
}
}
-// JR 12.01.2005 : an OutPort of a SwitchNode connected to a Gate can be connected only to Gate
- else if ( fromNode->IsSwitchNode() && fromPort->IsSwitch() && !toPort->IsGate() ) {
- cdebug << "toPort->AddLink Error( fromPort->IsSwitch() && !toPort->IsGate())." << endl ;
- cdebug_out << "GraphBase::Graph::AddLink 0" << endl;
- return false ;
- }
else if ( !fromPort->AddInPort( toPort ) ) { // --> MapOfInports in the OutPort
cdebug << "!fromPort->AddLink Error." << endl ;
cdebug_out << "GraphBase::Graph::AddLink 0" << endl;
}
if ( fromNode->IsSwitchNode() ) {
if ( !fromPort->IsDataStream() ) {
- if ( fromPort->IsInLine() && toPort->IsGate() && !toNode->IsEndSwitchNode() ) {
+//JR 08.02.2005 if ( fromPort->IsInLine() && toPort->IsGate() && !toNode->IsEndSwitchNode() ) {
+ if ( fromPort->IsInLine() && toPort->IsGate() ) {
fromPort->Kind( SUPERV::SwitchParameter ) ;
}
else if ( !fromPort->IsGate() && !toPort->IsGate() ){
if ( anInPort && ( anInPort->IsPortConnected() ||
anInPort->IsDataConnected() ||
anInPort->IsExternConnected() ) ) {
-// JR 13.01.2005 : Bug if it is a link to an EndSwitchNode. The OutPort may be an other one !!!
+// JR 13.01.2005 : DeBug : if it is a link to an EndSwitchNode. The OutPort may be an other one !!!
GraphBase::ComputingNode * fromNode = GetChangeGraphNode( FromNodeName ) ;
GraphBase::OutPort * anOutPort = NULL ;
if ( toNode->IsEndSwitchNode() ) {
fromNode->RemoveLinkedNode( toNode ) ;
}
}
- if ( fromNode->IsSwitchNode() && !anOutPort->IsGate() && !toNode->IsEndSwitchNode() ) {
- anOutPort->Kind( SUPERV::InLineParameter ) ;
+//JR PAL7990 : a SwitchPort is an OutPort of a SwitchNode connected to a InGate Port
+//Debug : change the kind only if there is no other InGate connected to the OutPort
+ if ( fromNode->IsSwitchNode() && !anOutPort->IsGate() && anOutPort->InPortsSize() == 0 ) {
+ if ( !toNode->IsEndSwitchNode() ) {
+ anOutPort->Kind( SUPERV::InLineParameter ) ;
+ }
+ else if ( !anInPort->IsGate() ) {
+ anOutPort->Kind( SUPERV::InLineParameter ) ;
+ }
}
-// JR 13.01.2005 : Bug if it is a link to an EndSwitchNode. The InPort may be linked !!!
+// JR 13.01.2005 : DeBug : if it is a link to an EndSwitchNode. The InPort may be multiple linked !!!
if ( toNode->IsEndSwitchNode() ) {
int i ;
int done = false ;
int k ;
for ( k = 0 ; k < fromOutPort->InPortsSize() ; k++ ) {
if ( strcmp( toNode->Name() , fromOutPort->InPorts( k )->NodeName() ) == 0 ) {
+ if ( strcmp( anInPort->PortName() , fromOutPort->InPorts( k )->PortName() ) == 0 ) {
// Restore an OutPort in the InPort
- anInPort->ChangeOutPort( fromOutPort ) ;
- cdebug << "Graph::RemoveLink reestablish " << fromOutPort->NodeName() << "( "
- << fromOutPort->PortName() << " ) in the InPort of EndSwitch : "
- << toNode->Name() << "( " << anInPort->PortName() << " )" << endl;
- done = true ;
- break ;
+ anInPort->ChangeOutPort( fromOutPort ) ;
+ cdebug << "Graph::RemoveLink reestablish " << fromOutPort->NodeName() << "( "
+ << fromOutPort->PortName() << " ) in the InPort of EndSwitch : "
+ << toNode->Name() << "( " << anInPort->PortName() << " )"
+ << anInPort->Kind() << " " << anInPort->PortStatus() << endl;
+ done = true ;
+ break ;
+ }
}
}
if ( done ) {
GraphBase::InPort * anInPort = toNode->GetChangeInPort( ToServiceParameterName ) ;
if ( anInPort && !anInPort->IsNotConnected() ) {
GraphBase::OutPort * anOutPort = anInPort->GetOutPort() ;
- *FromNodeName = my_strdup( anOutPort->NodeName() ) ;
- *FromServiceParameterName = my_strdup( anOutPort->PortName() ) ;
+//JR 17.02.2005 Memory Leak *FromNodeName = my_strdup( anOutPort->NodeName() ) ;
+ *FromNodeName = (char * ) anOutPort->NodeName() ;
+//JR 17.02.2005 Memory Leak *FromServiceParameterName = my_strdup( anOutPort->PortName() ) ;
+ *FromServiceParameterName = (char * ) anOutPort->PortName() ;
RetVal = true ;
}
else {
RetVal = true ;
fromPort->Value( aValue ) ;
fromPort->PortStatus( DataConnected ) ;
- toPort->State( SUPERV::ReadyState ) ;
+ toPort->PortState( SUPERV::ReadyState ) ;
}
else {
cdebug << "ERROR ChangeInputData fromPort not found" << endl ;
return RetVal ;
}
+#if 0
// To restore InputData in CreateService
bool GraphBase::Graph::AddInputData( const char* ToNodeName ,
const char* ToServiceParameterName ,
cdebug_out << "GraphBase::Graph::AddInputData " << RetVal << endl;
return RetVal ;
}
+#endif
bool GraphBase::Graph::AddOutputData( const char* FromNodeName ,
const char* FromServiceParameterName ,
// RetVal = AddLink( fromNode , fromPort ,
// (GraphBase::ComputingNode * ) this , toDataNodePort ) ;
anOutPort->Value( aValue ) ;
- anOutPort->State( SUPERV::ReadyState ) ;
- anOutPort->Done( true ) ;
+ anOutPort->PortState( SUPERV::ReadyState ) ;
+ anOutPort->PortDone( true ) ;
cdebug << *anOutPort ;
#ifdef _DEBUG_
anOutPort->StringValue( *_fdebug ) ;
return RetVal ;
}
+//JR This is used by StreamGraphs to list "CODES" and after that there is instances
+// for each Code (Nodes).
map< string , GraphBase::Service * > GraphBase::Graph::MapOfServiceNames() {
return _MapOfServiceNames ; }
return true ;
}
-int GraphBase::Graph::GetServiceNameNumber( SALOME_ModuleCatalog::Service aService ) {
- GraphBase::Service * theService = _MapOfServiceNames[ (char * ) aService.ServiceName ] ;
- if ( theService == NULL ) {
- return 1 ;
- }
- return theService->NewInstance() ;
+//PAL7961
+//JR Debug 25.03.2005 : with multiple instances et delete of instances, it was wrong
+//Bug created with the developpement of StreamGraphs
+int GraphBase::Graph::GetNewServiceInstanceNumber( char * aServiceName ) {
+ int InstanceNumber = _MapOfServiceInstanceNumber[ aServiceName ] + 1 ;
+ _MapOfServiceInstanceNumber[ aServiceName ] = InstanceNumber ;
+ return InstanceNumber ;
}
void GraphBase::Graph::SetGraphPorts() {
for ( i = 0 ; i < GetNodeInDataNodePortsSize() ; i++ ) {
GraphBase::OutPort * anOutPort = GetChangeNodeInDataNodePort( i ) ;
cdebug << "SetGraphPorts Out" << i << " " << anOutPort->PortName() << " " << anOutPort->PortType()
- << " " << anOutPort->Kind() << " " << anOutPort->PortStatus() << " " << anOutPort->State() << endl ;
+ << " " << anOutPort->Kind() << " " << anOutPort->PortStatus() << " " << anOutPort->PortState() << endl ;
if ( !anOutPort->IsGate() ) {
anOutPort->PortStatus( ExternConnected ) ;
}
for ( i = 0 ; i < GetNodeOutDataNodePortsSize() ; i++ ) {
GraphBase::InPort * anInPort = GetChangeNodeOutDataNodePort( i ) ;
cdebug << "SetGraphPorts In" << i << " " << anInPort->PortName() << " " << anInPort->PortType()
- << " " << anInPort->Kind() << " " << anInPort->PortStatus() << " " << anInPort->State() << endl ;
+ << " " << anInPort->Kind() << " " << anInPort->PortStatus() << " " << anInPort->PortState() << endl ;
if ( !anInPort->IsGate() ) {
GraphBase::OutPort * anOutPort = anInPort->GetOutPort() ;
anOutPort->PortStatus( ExternConnected ) ;
// if ( GraphMacroLevel() == 0 ) {
for ( dostore = 0 ; dostore <= 2 ; dostore++ ) {
if ( dostore == 1 ) {
- aService.ServiceName = Name() ;
+//JR 17.02.2005 Memory Leak aService.ServiceName = Name() ;
+ aService.ServiceName = my_strdup( Name() ) ;
aService.ServiceinParameter.length( 0 ) ;
aService.ServiceinParameter.length( innbr ) ;
aService.ServiceoutParameter.length( 0 ) ;
OutNumberOfValues.resize( outnbr ) ;
}
else if ( dostore == 2 ) {
+//JR Creation of the Service (and of the Ports) with GraphBase::DataNode::DataService :
cdebug << "GraphBase::Graph::CreateService ->DataService innbr " << innbr
<< " instreamnbr " << instreamnbr << " outnbr " << outnbr
<< " outstreamnbr " << outstreamnbr << endl ;
}
// }
-#if 0
+#if 1
cdebug << "DataFlowNode ServiceName " << aService.ServiceName << " InPorts " << innbr
<< " OutPorts " << outnbr << endl ;
for ( i = 0 ; i < innbr ; i++ ) {
if ( !anInPort->IsGate() && anInPort->IsDataConnected() ) {
if ( !AddInputData( anInPort->NodeName() ,
anInPort->PortName() ,
- anInPort->GetOutPort()->ValuePtr() ) ) {
+//JR 21.02.2005 Debug Memory leak : anInPort->GetOutPort()->ValuePtr() ) ) {
+//JR 30.03.2005 *anInPort->GetOutPort()->Value() ) ) {
+ anInPort->GetOutPort()->Value() ) ) {
cdebug << "CreateService In" << j << " " << anInPort->NodeName() << "(" << anInPort->PortName() << ") "
<< anInPort->PortStatus() << " --> AddInputData ERROR" << endl ;
RetVal = false ;
}
}
+#ifdef _DEBUG_
+ ListPorts( *_Graph_fdebug , 0 ) ;
+#endif
+
cdebug_out << "GraphBase::Graph::CreateService " << RetVal << endl;
return RetVal ;
}
}
bool GraphBase::Graph::Sort( int & SubStreamGraphsNumber ) {
+#ifdef _DEBUG_
+ ListPorts( *_Graph_fdebug , 0 ) ;
+#endif
+
int i ;
int j ;
int NotSortedNumber = GraphNodesSize() ;
return false ; // Loop in the Graph
}
+ cdebug << "Graph::Sort " << _NodesNumber[ 0 ] << " HeadNodes :" << endl ;
for ( i= 0 ; i <= _NodesNumber[ 0 ] ; i++ ) {
(_SortedNodes[ 0 ])[ i ]->HeadNode( true ) ;
+ cdebug << " " << i << ". : " << (_SortedNodes[ 0 ])[ i ]->Name() << endl ;
}
// Give a subgraph/substreamgraph number > 0 to HeadNodes (level 0)
return true ;
}
+bool GraphBase::Graph::ValidSwitchs() const {
+ cdebug_in << "GraphBase::Graph::ValidSwitchs" << endl;
+
+ int i ;
+ GraphBase::ComputingNode * aNode ;
+ for ( i = 0 ; i < GraphNodesSize() ; i++ ) {
+ aNode = GraphNodes( i ) ;
+ if ( aNode->IsSwitchNode() ) {
+ GraphBase::SwitchNode * aSwitchNode = (GraphBase::SwitchNode * ) aNode ;
+ if ( !aSwitchNode->CheckSwitch() ) {
+ cdebug_out << "GraphBase::Graph::ValidSwitchs false aSwitchNode " << aSwitchNode->Name()
+ << endl;
+ return false ;
+ }
+ }
+ }
+ cdebug_out << "GraphBase::Graph::ValidSwitchs true" << endl;
+ return true ;
+}
+
// Controle de la coherence des noeuds de calcul
// Enregistrement dans la liste des noeuds "tete" de graphe
bool GraphBase::Graph::ComputingNodes() const {
bool RetVal = true ;
- cdebug << "GraphExecutor::GraphControl::ComputingNodes ()" << endl;
+ cdebug << "GraphExecutor::Graph::ComputingNodes ()" << endl;
// list<GraphEditor::Node *> aComputingNodesList = _G->ComputingNodesList() ;
// list<GraphEditor::Node *>::iterator aNode = aComputingNodesList.begin();
GraphBase::ComputingNode * aNode ;
for ( i = 0 ; i < GraphNodesSize() ; i++ ) {
aNode = GraphNodes( i ) ;
+ cdebug << "Graph::ComputingNodes " << i << ". " << aNode->Name() << " Head " << aNode->IsHeadNode()
+ << endl ;
// Tous les ports d'entree de tous les noeuds de calcul sont bien connectes
// Enregistrement eventuel dans la liste des noeuds "tete" de graphe
// if ((*aNode)->GetNodeInPortsSize() == 0)
GraphBase::GOTONode * aGOTONode = (GraphBase::GOTONode * ) aNode ;
GraphBase::OutPort *anOutGate = aGOTONode->GetChangeNodeOutGate() ;
if ( anOutGate->IsNotConnected() ) {
- RetVal = aGOTONode->CoupledNode() != NULL;
- if ( RetVal ) {
- RetVal = AddLink( aGOTONode , anOutGate ,
- aGOTONode->CoupledNode() , aGOTONode->CoupledNode()->GetChangeNodeInGate() );
+ if ( aGOTONode->CoupledNode() ) {
+ cdebug << "Graph::LinkLoopNodes aNode " << aNode << " : " << aNode->Name()
+ << aGOTONode->CoupledNode() << " : " << aGOTONode->CoupledNode()->Name()
+ << endl ;
+ RetVal = AddLink( aGOTONode , anOutGate , aGOTONode->CoupledNode() ,
+ aGOTONode->CoupledNode()->GetChangeNodeInGate() );
// cdebug << "GraphBase::Graph::CreateService AddLink ERROR " << aGOTONode->Name() << "( "
// << anOutGate->PortName() << " ) --> " << aGOTONode->CoupledNode()->Name() << "( "
// << aGOTONode->CoupledNode()->GetChangeNodeInGate()->PortName() << " )" << endl ;
}
}
if ( anOutPort ) {
- aRet = anOutPort->State() ;
+ aRet = anOutPort->PortState() ;
// cdebug << "GraphBase::Graph::PortState --> " << aRet << endl ;
}
}
return aRet ;
}
-const CORBA::Any * GraphBase::Graph::PortInData( const char* ToNodeName ,
- const char* ToServiceParameterName ) {
- const CORBA::Any * aRet = new CORBA::Any() ;
+#define TracePortInOutData 0
+//JR 30.03.2005const CORBA::Any * GraphBase::Graph::PortInData( const char* ToNodeName ,
+const CORBA::Any GraphBase::Graph::PortInData( const char* ToNodeName ,
+ const char* ToServiceParameterName ) {
+//JR 30.03.2005 const CORBA::Any * aRet = new CORBA::Any() ;
+ CORBA::Any aRet = CORBA::Any() ;
char *theNode ;
char *aPort ;
-// cdebug_in << "GraphBase::Graph::PortInData " << ToNodeName << " "
-// << ToServiceParameterName << endl ;
+#if TracePortInOutData
+ cdebug_in << "GraphBase::Graph::PortInData " << ToNodeName << " "
+ << ToServiceParameterName << endl ;
+#endif
NodePort( ToNodeName , ToServiceParameterName , &theNode , &aPort ) ;
GraphBase::ComputingNode * aNode = GetChangeGraphNode( theNode ) ;
if ( anInPort ) {
anOutPort = anInPort->GetOutPort() ;
if ( anOutPort ) {
+#if TracePortInOutData
+ cdebug << "-->PortInData " << ToNodeName << " " << ToServiceParameterName << " "
+ << endl ;
+#endif
aRet = anOutPort->Value() ;
+#if TracePortInOutData
+ cdebug << "<--PortInData " << ToNodeName << " " << ToServiceParameterName << " " ;
+ anOutPort->StringValue( *GraphBase::Base::_fdebug ) ;
+ cdebug << endl ;
cdebug << "Graph::PortInData OutPort value " << anOutPort->NodeName() << "("
<< anOutPort->PortName() << ") --> InPort " << anInPort->NodeName()
<< "(" << anInPort->PortName() << ") " << anInPort->PortStatus() << endl ;
+#endif
}
else {
cdebug << "Graph::PortInData GraphBase::Graph::PortInData " << ToNodeName << " "
}
delete theNode ;
delete aPort ;
-// cdebug_out << "GraphBase::Graph::PortInData " << endl ;
+#if TracePortInOutData
+ cdebug_out << "GraphBase::Graph::PortInData " << endl ;
+#endif
return aRet ;
}
-const CORBA::Any * GraphBase::Graph::PortOutData( const char* FromNodeName ,
- const char* FromServiceParameterName ) {
- const CORBA::Any * aRet = new CORBA::Any() ;
+//JR 30.03.2005const CORBA::Any * GraphBase::Graph::PortOutData( const char* FromNodeName ,
+const CORBA::Any GraphBase::Graph::PortOutData( const char* FromNodeName ,
+ const char* FromServiceParameterName ) {
+//JR 30.03.2005 const CORBA::Any * aRet = new CORBA::Any() ;
+ CORBA::Any aRet = CORBA::Any() ;
char *theNode ;
char *aPort ;
-// cdebug_in << "GraphBase::Graph::PortOutData " << FromNodeName << " "
-// << FromServiceParameterName << endl ;
+#if TracePortInOutData
+ cdebug_in << "GraphBase::Graph::PortOutData " << FromNodeName << " "
+ << FromServiceParameterName << endl ;
+#endif
NodePort( FromNodeName , FromServiceParameterName , &theNode , &aPort ) ;
GraphBase::ComputingNode * aNode = GetChangeGraphNode( theNode ) ;
GraphBase::OutPort *anOutPort ;
anOutPort = aNode->GetChangeOutPort( aPort );
if ( anOutPort ) {
+#if TracePortInOutData
+ cdebug << "-->PortOutData " << FromNodeName << " " << FromServiceParameterName << " "
+ << endl ;
+#endif
aRet = anOutPort->Value() ;
+#if TracePortInOutData
+ cdebug << "<--PortOutData " << FromNodeName << " " << FromServiceParameterName << " " ;
+ anOutPort->StringValue( *GraphBase::Base::_fdebug ) ;
+ cdebug << endl ;
+#endif
}
else {
cdebug << "GraphBase::Graph::PortOutData " << FromNodeName << " "
}
delete theNode ;
delete aPort ;
-// cdebug_out << "GraphBase::Graph::PortOutData " << endl ;
+#if TracePortInOutData
+ cdebug_out << "GraphBase::Graph::PortOutData " << endl ;
+#endif
return aRet ;
}
}
}
*/
- cdebug_out << aThread << " GraphBase::Graph::StartComponent " << RetVal << endl;
+ cdebug_out << aThread << " GraphBase::Graph::StartComponent " << RetVal << endl;
return RetVal ;
}