1 // SUPERV GraphBase : contains fondamental classes for Services, Input Ports, Output Ports Links and Nodes.
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : DataFlowBase_Base.hxx
25 // Author : Jean Rahuel, CEA
29 #ifndef _DATAFLOW_BASE_HXX
30 #define _DATAFLOW_BASE_HXX
32 //#include <strstream>
46 #include <SALOMEconfig.h>
47 #include CORBA_CLIENT_HEADER(SUPERV)
49 #include "utilities.h"
52 extern char *SuperVision_Version ;
54 extern char *NULLSTRING ;
56 extern char *FACTORYSERVER ;
58 inline char * my_strdup( const char * s ) {
59 if (s == NULL) return NULL;
61 size_t l = strlen(s) + 1;
62 char * t = new char[l];
67 inline char * my_strblkdup( const char * s ) {
68 if (s == NULL) return NULL ;
70 size_t l = strlen(s) + 1 ;
72 for ( i = l - 2 ; i >= 0 ; i-- ) {
78 char * t = new char[l] ;
84 string DataStreamTypeToString( const SALOME_ModuleCatalog::DataStreamType aDataStreamType ) ;
85 SALOME_ModuleCatalog::DataStreamType StringToDataStreamType( const char * aIdlType ) ;
87 string KindOfDataStreamTraceToString( SUPERV::KindOfDataStreamTrace aDataStreamTrace ) ;
89 string DataStreamDependencyToString( const SALOME_ModuleCatalog::DataStreamDependency aDataStreamDependency ) ;
91 string DataStreamToString( const SALOME_ModuleCatalog::DataStreamType aDataStreamType ) ;
93 //enum StatusOfPort { NotConnected , PortConnected , PortAndDataConnected ,
94 enum StatusOfPort { NotConnected , PortConnected ,
95 DataConnected , ExternConnected } ;
104 typedef vector<SCoord> ListOfCoords;
106 typedef string FuncName ;
108 typedef vector< FuncName > ListOfFuncName ;
110 typedef vector<const SUPERV::ListOfStrings *> ListOfPythonFunctions ;
112 typedef vector<SALOME_ModuleCatalog::ServicesParameter> ListOfParameters;
114 struct InDataStreamParameter {
115 SALOME_ModuleCatalog::ServicesDataStreamParameter theDataStreamParameter ;
116 SUPERV::KindOfSchema theKindOfSchema ;
117 SUPERV::KindOfInterpolation theKindOfInterpolation ;
118 SUPERV::KindOfExtrapolation theKindOfExtrapolation ;
120 typedef vector<InDataStreamParameter> ListOfInDataStreamParameters;
122 struct OutDataStreamParameter {
123 SALOME_ModuleCatalog::ServicesDataStreamParameter theDataStreamParameter ;
124 long theNumberOfValues ;
126 typedef vector<OutDataStreamParameter> ListOfOutDataStreamParameters;
129 string theComponentName ;
130 string theInterfaceName ;
132 SUPERV::KindOfNode theKind ;
134 SUPERV::KindOfDataStreamTrace theDataStreamTrace ;
135 double theDeltaTime ;
136 string theCoupledNode ;
137 // int theDataStreamInArgsNumber ;
138 // int theDataStreamOutArgsNumber ;
139 SALOME_ModuleCatalog::Service theService ;
140 ListOfInDataStreamParameters theListOfInDataStreams ;
141 ListOfOutDataStreamParameters theListOfOutDataStreams ;
142 ListOfFuncName theListOfFuncName ;
143 ListOfPythonFunctions theListOfPythonFunctions ;
144 SUPERV::SDate theFirstCreation ;
145 SUPERV::SDate theLastModification ;
146 string theEditorRelease ;
153 typedef vector<SNode> ListOfSNodes;
155 struct ServicesData {
156 SALOME_ModuleCatalog::ServicesParameter aDataParameter ;
157 CORBA::Any aDataValue;
160 typedef vector<ServicesData> ListOfServicesData;
163 string FromNodeName ;
164 string FromServiceParameterName ;
166 string ToServiceParameterName ;
167 CORBA::Any aLinkValue;
168 ListOfCoords aListOfCoords ;
171 typedef vector<SLink> ListOfSLinks;
180 typedef vector<SGraph> ListOfSGraphs;
186 CORBA::ORB_ptr _Orb ;
196 void SetDebug( CORBA::ORB_ptr ORB ,
197 int * prof_debug , ofstream * fdebug ) ;
199 char * ObjectToString( CORBA::Object_ptr obj ) const ;
200 CORBA::Object_ptr StringToObject(char * obj ) const ;
206 # define cdebug if ( GraphBase::Base::_fdebug ) *GraphBase::Base::_fdebug << " "
207 # define cdebug_in if ( GraphBase::Base::_fdebug ) *GraphBase::Base::_fdebug << endl << "-->" << " "
208 # define cdebug_out if ( GraphBase::Base::_fdebug ) *GraphBase::Base::_fdebug << endl << "<--" << " "
212 # define cdebug while (false) std::cerr
213 # define cdebug_in cdebug
214 # define cdebug_out cdebug
215 # define debugFile(x)
221 ostream & operator<< (ostream &,const SALOME_ModuleCatalog::DataStreamType &);