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 #define ExitWhenNodeAborted 1
54 extern char *SuperVision_Version ;
56 extern char *NULLSTRING ;
58 extern char *FACTORYSERVER ;
60 inline char * my_strdup( const char * s ) {
61 if (s == NULL) return NULL;
63 size_t l = strlen(s) + 1;
64 char * t = new char[l];
69 inline char * my_strblkdup( const char * s ) {
70 if (s == NULL) return NULL ;
72 size_t l = strlen(s) + 1 ;
74 for ( i = l - 2 ; i >= 0 ; i-- ) {
80 char * t = new char[l] ;
86 string DataStreamTypeToString( const SALOME_ModuleCatalog::DataStreamType aDataStreamType ) ;
87 SALOME_ModuleCatalog::DataStreamType StringToDataStreamType( const char * aIdlType ) ;
89 string KindOfDataStreamTraceToString( SUPERV::KindOfDataStreamTrace aDataStreamTrace ) ;
91 string DataStreamDependencyToString( const SALOME_ModuleCatalog::DataStreamDependency aDataStreamDependency ) ;
93 string DataStreamToString( const SALOME_ModuleCatalog::DataStreamType aDataStreamType ) ;
95 //enum StatusOfPort { NotConnected , PortConnected , PortAndDataConnected ,
96 enum StatusOfPort { NotConnected , PortConnected ,
97 DataConnected , ExternConnected } ;
106 typedef vector<SCoord> ListOfCoords;
108 typedef string FuncName ;
110 typedef vector< FuncName > ListOfFuncName ;
112 typedef vector<const SUPERV::ListOfStrings *> ListOfPythonFunctions ;
114 typedef vector<SALOME_ModuleCatalog::ServicesParameter> ListOfParameters;
116 struct InDataStreamParameter {
117 SALOME_ModuleCatalog::ServicesDataStreamParameter theDataStreamParameter ;
118 SUPERV::KindOfSchema theKindOfSchema ;
119 SUPERV::KindOfInterpolation theKindOfInterpolation ;
120 SUPERV::KindOfExtrapolation theKindOfExtrapolation ;
122 typedef vector<InDataStreamParameter> ListOfInDataStreamParameters;
124 struct OutDataStreamParameter {
125 SALOME_ModuleCatalog::ServicesDataStreamParameter theDataStreamParameter ;
126 long theNumberOfValues ;
128 typedef vector<OutDataStreamParameter> ListOfOutDataStreamParameters;
131 string theComponentName ;
132 string theInterfaceName ;
134 SUPERV::KindOfNode theKind ;
136 SUPERV::KindOfDataStreamTrace theDataStreamTrace ;
137 double theDeltaTime ;
138 string theCoupledNode ;
139 // int theDataStreamInArgsNumber ;
140 // int theDataStreamOutArgsNumber ;
141 SALOME_ModuleCatalog::Service theService ;
142 ListOfInDataStreamParameters theListOfInDataStreams ;
143 ListOfOutDataStreamParameters theListOfOutDataStreams ;
144 ListOfFuncName theListOfFuncName ;
145 ListOfPythonFunctions theListOfPythonFunctions ;
146 SUPERV::SDate theFirstCreation ;
147 SUPERV::SDate theLastModification ;
148 string theEditorRelease ;
155 typedef vector<SNode> ListOfSNodes;
157 struct ServicesData {
158 SALOME_ModuleCatalog::ServicesParameter aDataParameter ;
159 CORBA::Any aDataValue;
162 typedef vector<ServicesData> ListOfServicesData;
165 string FromNodeName ;
166 string FromServiceParameterName ;
168 string ToServiceParameterName ;
169 CORBA::Any aLinkValue;
170 ListOfCoords aListOfCoords ;
173 typedef vector<SLink> ListOfSLinks;
182 typedef vector<SGraph> ListOfSGraphs;
188 CORBA::ORB_ptr _Orb ;
198 void SetDebug( CORBA::ORB_ptr ORB ,
199 int * prof_debug , ofstream * fdebug ) ;
201 char * ObjectToString( CORBA::Object_ptr obj ) const ;
202 CORBA::Object_ptr StringToObject(char * obj ) const ;
204 ostream & AnyValue( const CORBA::Any & anAny );
210 # define cdebug if ( GraphBase::Base::_fdebug ) *GraphBase::Base::_fdebug << " "
211 # define cdebug_in if ( GraphBase::Base::_fdebug ) *GraphBase::Base::_fdebug << endl << "-->" << " "
212 # define cdebug_out if ( GraphBase::Base::_fdebug ) *GraphBase::Base::_fdebug << endl << "<--" << " "
216 # define cdebug while (false) std::cerr
217 # define cdebug_in cdebug
218 # define cdebug_out cdebug
219 # define debugFile(x)
225 ostream & operator<< (ostream &,const SALOME_ModuleCatalog::DataStreamType &);