#include "DataFlowBase_EndOfSwitchNode.hxx"
#include "DataFlowBase_DataNode.hxx"
-class Graph_Impl ;
-
namespace GraphBase {
class Graph : public DataNode {
// int _Graph_prof_debug;
// ofstream * _Graph_fdebug;
CORBA::ORB_ptr _Orb ;
- SUPERV::Graph_var _Graph ;
- Graph_Impl * _GraphImpl ;
+// SUPERV::Graph_var _Graph ;
+// Graph_Impl * _GraphImpl ;
// Map of Nodes of the Graph
map< string , int > _MapOfGraphNodes ;
vector<ComputingNode *> _QueueNodes ;
bool _ParallelExecutionNodes ;
-// For generated NodeNames with ServiceName : number of Nodes using
-// the same ServiceName. It is not the same Service if it belongs to
+// For StreamGraphs. It is not the same Service if it belongs to
// a different Interface and/or a different Component ...
map< string , GraphBase::Service * > _MapOfServiceNames ;
+// For automactic rename of nodes if unique names in graphs
+ map< string , int > _MapOfServiceInstanceNumber ;
+
// Total number of SubGraphs
int _SubGraphsNumber ;
// _SubGraphs[ SubGraphNumero ] [ NodeNumero ]
// int _SubStreamGraphsSize ;
// vector<vector<ComputingNode *> > _SubStreamGraphs ;
+ string _Messages ;
+
bool AddLink( GraphBase::ComputingNode *fromNode ,
GraphBase::OutPort *fromPort ,
GraphBase::ComputingNode *toNode ,
return _prof_debug ; } ;
ofstream * Graph_fdebug() { return _fdebug ; } ;
- SUPERV::Graph_var ObjRef() const { return _Graph ; } ;
- void SetObjRef( SUPERV::Graph_var aGraph ) {
- _Graph = aGraph ; } ;
- Graph_Impl * ObjImpl() const { return _GraphImpl ; } ;
- void SetObjImpl( Graph_Impl * aGraphImpl ) {
- _GraphImpl = aGraphImpl ; } ;
+// SUPERV::Graph_var ObjRef() const { return _Graph ; } ;
+// void SetObjRef( SUPERV::Graph_var aGraph ) {
+// _Graph = aGraph ; } ;
+// Graph_Impl * ObjImpl() const { return _GraphImpl ; } ;
+// void SetObjImpl( Graph_Impl * aGraphImpl ) {
+// _GraphImpl = aGraphImpl ; } ;
void AddLinkedNode( const char* FromNodeName , GraphBase::ComputingNode * anOutNode ) {
GetChangeGraphNode( FromNodeName )->AddLinkedNode( anOutNode ) ; } ;
// cdebug << "GetGraphNodeIndex of " << name << " in _MapOfGraphNodes : "
// << index << " Node " << hex << (void *) _GraphNodes[ index ]
// << dec << " '" << _GraphNodes[ index ]->Name() << "'" << endl ;
+#if 0
+ cdebug << "Graph::GetGraphNodeIndex " << _GraphNodesSize << " known nodes" << endl;
+ int i ;
+ 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
return index ; } ;
void SetGraphNodeIndex( const char *name , const int index ) {
_MapOfGraphNodes[ name ] = index + 1 ;
cdebug << "SetGraphNodeIndex of " << name << " in _MapOfGraphNodes : "
- << index << " Node " << hex << (void *) _GraphNodes[ index ]
- << " '" << _GraphNodes[ index ]->Name() << "'" << endl ;
+ << index << " Node " << (void *) _GraphNodes[ index ]
+ << " '" << _GraphNodes[ index ]->Name() << "' MapOfGraphNodessize "
+ << GetGraphNodeSize() << endl ;
+#if 1
+ cdebug << "Graph::SetGraphNodeIndex " << _GraphNodesSize << " known nodes" << endl;
+ int i ;
+ 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
} ;
void DelGraphNodeIndex( const char *name ) {
_MapOfGraphNodes.erase( name ) ; } ;
+ int GetGraphNodeSize() const {
+ return _MapOfGraphNodes.size() ; }
const GraphBase::ComputingNode * GetGraphNode( const int index ) const {
const ComputingNode * aNode = GetChangeGraphNode( index ) ;
return aNode ; } ;
if ( aState == SUPERV::DoneState )
aRet = true ;
return aRet ; } ;
- const CORBA::Any * PortInData( const char* ToNodeName ,
- const char* ToServiceParameterName ) ;
- const CORBA::Any * PortOutData( const char* FromNodeName ,
- const char* FromServiceParameterName ) ;
+//JR 30.03.2005 const CORBA::Any * PortInData( const char* ToNodeName ,
+ const CORBA::Any PortInData( const char* ToNodeName ,
+ const char* ToServiceParameterName ) ;
+//JR 30.03.2005 const CORBA::Any * PortOutData( const char* FromNodeName ,
+ const CORBA::Any PortOutData( const char* FromNodeName ,
+ const char* FromServiceParameterName ) ;
bool LoadXml( CORBA::ORB_ptr Orb , const char* anXmlFile ,
GraphBase::ListOfSGraphs & aListOfDataFlows ) ;
bool ChangeInputData( const char* ToNodeName ,
const char* ToParameterName ,
const CORBA::Any aValue ) ;
- bool AddInputData( const char* ToNodeName ,
- const char* ToParameterName ,
- const CORBA::Any ** aValue ) ;
+// bool AddInputData( const char* ToNodeName ,
+// const char* ToParameterName ,
+// const CORBA::Any ** aValue ) ;
bool AddOutputData( const char* FromNodeName ,
const char* FromParameterName ,
void SetGraphPorts() ;
+ string Messages() ;
+ void ReSetMessages() ;
+ void SetMessages( string anErrorMessage ) ;
+
bool CreateService() ;
bool InLineServices() ;
bool Sort( int & SubStreamGraphsNumber ) ;
+ bool ValidLoops() const ;
+ bool ValidSwitchs() const ;
bool ComputingNodes() const ;
bool LinkLoopNodes(bool & NewLink ) ;
bool DataServerNodes() const ;
map< string , GraphBase::Service * > MapOfServiceNames() ;
GraphBase::Service * GetServiceOfMap( char * name ) ;
bool SetServiceOfMap( GraphBase::Service * aService ) ;
- int GetServiceNameNumber( SALOME_ModuleCatalog::Service aService ) ;
+ int GetNewServiceInstanceNumber( char * aServiceName ) ;
SUPERV::ListOfStrings * LevelNodes(long aLevel ) ;
long ThreadsMax() {