Salome HOME
Fix for bug IPAL9558 : Maintainance Mandrake porting: black rectangle in table view.
[modules/superv.git] / src / GraphBase / DataFlowBase_Base.hxx
index 174a1ea18397e0a1917c3eec899a4ca46e292b9e..495d795f8bff95ac31241c37d3a60ecfd326e9ef 100644 (file)
 #ifndef _DATAFLOW_BASE_HXX
 #define _DATAFLOW_BASE_HXX
 
+//#include <strstream>
 #include <iostream>
 #include <fstream>
-#include <strstream>
+#include <sstream>
 #include <iomanip>
 #include <string>
 #include <map>
@@ -48,8 +49,6 @@
 #include "utilities.h"
 #include "OpUtil.hxx"
 
-#include "SALOME_NamingService.hxx"
-
 extern char *SuperVision_Version ;
 
 extern char *NULLSTRING ;
@@ -65,8 +64,35 @@ inline char * my_strdup( const char * s ) {
   return t;
 }
 
-enum StatusOfPort { NotConnected , PortConnected , PortAndDataConnected ,
-                    DataConnected } ;
+inline char * my_strblkdup( const char * s ) {
+  if (s == NULL) return NULL ;
+
+  size_t l = strlen(s) + 1 ;
+  int i ;
+  for ( i = l - 2 ; i >= 0 ; i-- ) {
+    if ( s[i] != ' ' ) {
+      break ;
+    }
+    l = l - 1 ;
+  }
+  char * t = new char[l] ;
+  strncpy(t, s , l-1) ;
+  t[l-1] = '\0' ;
+  return t;
+}
+
+string DataStreamTypeToString( const SALOME_ModuleCatalog::DataStreamType aDataStreamType ) ;
+SALOME_ModuleCatalog::DataStreamType StringToDataStreamType( const char * aIdlType ) ;
+
+string KindOfDataStreamTraceToString( SUPERV::KindOfDataStreamTrace aDataStreamTrace ) ;
+
+string DataStreamDependencyToString( const SALOME_ModuleCatalog::DataStreamDependency aDataStreamDependency ) ;
+
+string DataStreamToString( const SALOME_ModuleCatalog::DataStreamType aDataStreamType ) ;
+
+//enum StatusOfPort { NotConnected , PortConnected , PortAndDataConnected ,
+enum StatusOfPort { NotConnected , PortConnected ,
+                    DataConnected , ExternConnected } ;
 
 namespace GraphBase {
 
@@ -83,21 +109,36 @@ namespace GraphBase {
 
   typedef vector<const SUPERV::ListOfStrings *> ListOfPythonFunctions ;
 
-  struct NodeParameter {
-    SALOME_ModuleCatalog::ServicesParameter theInParameter ;
-    SALOME_ModuleCatalog::ServicesParameter theOutParameter ;
-  };
+  typedef vector<SALOME_ModuleCatalog::ServicesParameter> ListOfParameters;
 
-  typedef vector<NodeParameter> ListOfParameters;
+  struct InDataStreamParameter {
+     SALOME_ModuleCatalog::ServicesDataStreamParameter theDataStreamParameter ;
+     SUPERV::KindOfSchema                              theKindOfSchema ;
+     SUPERV::KindOfInterpolation                       theKindOfInterpolation ;
+     SUPERV::KindOfExtrapolation                       theKindOfExtrapolation ;
+   };
+  typedef vector<InDataStreamParameter> ListOfInDataStreamParameters;
+
+  struct OutDataStreamParameter {
+     SALOME_ModuleCatalog::ServicesDataStreamParameter theDataStreamParameter ;
+     long                                              theNumberOfValues ;
+   };
+  typedef vector<OutDataStreamParameter> ListOfOutDataStreamParameters;
 
   struct SNode {
     string                        theComponentName ;
     string                        theInterfaceName ;
     string                        theName ;
     SUPERV::KindOfNode            theKind ;
+    long                          theTimeout ;
+    SUPERV::KindOfDataStreamTrace theDataStreamTrace ;
+    double                        theDeltaTime ;
     string                        theCoupledNode ;
+//    int                           theDataStreamInArgsNumber ;
+//    int                           theDataStreamOutArgsNumber ;
     SALOME_ModuleCatalog::Service theService ;
-    ListOfParameters              theListOfParameters ;
+    ListOfInDataStreamParameters  theListOfInDataStreams ;
+    ListOfOutDataStreamParameters theListOfOutDataStreams ;
     ListOfFuncName                theListOfFuncName ;
     ListOfPythonFunctions         theListOfPythonFunctions ;
     SUPERV::SDate                 theFirstCreation ;
@@ -109,7 +150,7 @@ namespace GraphBase {
     SCoord                        theCoords ;
   };
 
-  typedef vector<SNode> ListOfNodes;
+  typedef vector<SNode> ListOfSNodes;
 
   struct ServicesData {
     SALOME_ModuleCatalog::ServicesParameter aDataParameter ;
@@ -127,16 +168,16 @@ namespace GraphBase {
     ListOfCoords aListOfCoords ;
   };
 
-  typedef vector<SLink> ListOfLinks;
+  typedef vector<SLink> ListOfSLinks;
 
   struct SGraph {
     SNode        Info ;
-    ListOfNodes  Nodes ;
-    ListOfLinks  Links ;
-    ListOfLinks  Datas ;
+    ListOfSNodes  Nodes ;
+    ListOfSLinks  Links ;
+    ListOfSLinks  Datas ;
   };
 
-  typedef vector<SGraph> ListOfGraphs;
+  typedef vector<SGraph> ListOfSGraphs;
 
   class Base {
 
@@ -146,32 +187,26 @@ namespace GraphBase {
 
     public:   
 
-      int *     _prof_debug;
-      ostream * _fdebug;
+      int      * _prof_debug ;
+      ofstream * _fdebug ;
                      
       Base() ;
       virtual ~Base() {} ;
 
       void SetDebug( CORBA::ORB_ptr ORB ,
-                     int * prof_debug , ostream * fdebug ) ;
+                     int * prof_debug , ofstream * fdebug ) ;
 
       char * ObjectToString( CORBA::Object_ptr obj ) const ;
       CORBA::Object_ptr StringToObject(char * obj ) const ;
 
   } ;
-# ifdef _DEBUG_
 
-#   define cdebug \
-           if ( GraphBase::Base::_prof_debug ) \
-             *GraphBase::Base::_fdebug << "      " /*<< setw(3*(*GraphBase::Base::_prof_debug)) */<< " "
+# ifdef _DEBUG_
 
-#   define cdebug_in \
-           if ( GraphBase::Base::_prof_debug ) \
-             *GraphBase::Base::_fdebug << endl << "-->" /*<< setw(3*((*GraphBase::Base::_prof_debug)++)) */<< " "
+#   define cdebug if ( GraphBase::Base::_fdebug )  *GraphBase::Base::_fdebug << "      "
+#   define cdebug_in if ( GraphBase::Base::_fdebug ) *GraphBase::Base::_fdebug << endl << "-->" << " "
+#   define cdebug_out if ( GraphBase::Base::_fdebug ) *GraphBase::Base::_fdebug << endl << "<--" << " "
 
-#   define cdebug_out \
-           if ( GraphBase::Base::_prof_debug ) \
-             *GraphBase::Base::_fdebug << endl << "<--" /*<< setw(3*(--(*GraphBase::Base::_prof_debug)))*/ << " "
 # else
 
 #   define cdebug while (false) std::cerr
@@ -179,8 +214,10 @@ namespace GraphBase {
 #   define cdebug_out cdebug
 #   define debugFile(x) 
 
-# endif
+#endif
 
 } ;
 
+ostream & operator<< (ostream &,const SALOME_ModuleCatalog::DataStreamType &);
+
 #endif