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 omniORB_4_0_5 1
54 #define ExitWhenNodeAborted 1
56 extern char *SuperVision_Version ;
58 extern char *NULLSTRING ;
60 extern char *FACTORYSERVER ;
62 inline char * my_strdup( const char * s ) {
63 if (s == NULL) return NULL;
65 size_t l = strlen(s) + 1;
66 char * t = new char[l];
71 inline char * my_strblkdup( const char * s ) {
72 if (s == NULL) return NULL ;
74 size_t l = strlen(s) + 1 ;
76 for ( i = l - 2 ; i >= 0 ; i-- ) {
82 char * t = new char[l] ;
88 string DataStreamTypeToString( const SALOME_ModuleCatalog::DataStreamType aDataStreamType ) ;
89 SALOME_ModuleCatalog::DataStreamType StringToDataStreamType( const char * aIdlType ) ;
91 string KindOfDataStreamTraceToString( SUPERV::KindOfDataStreamTrace aDataStreamTrace ) ;
93 string DataStreamDependencyToString( const SALOME_ModuleCatalog::DataStreamDependency aDataStreamDependency ) ;
95 string DataStreamToString( const SALOME_ModuleCatalog::DataStreamType aDataStreamType ) ;
97 //enum StatusOfPort { NotConnected , PortConnected , PortAndDataConnected ,
98 enum StatusOfPort { NotConnected , PortConnected ,
99 DataConnected , ExternConnected } ;
101 namespace GraphBase {
108 typedef vector<SCoord> ListOfCoords;
110 typedef string FuncName ;
112 typedef vector< FuncName > ListOfFuncName ;
114 typedef vector<const SUPERV::ListOfStrings *> ListOfPythonFunctions ;
116 typedef vector<SALOME_ModuleCatalog::ServicesParameter> ListOfParameters;
118 struct InDataStreamParameter {
119 SALOME_ModuleCatalog::ServicesDataStreamParameter theDataStreamParameter ;
120 SUPERV::KindOfSchema theKindOfSchema ;
121 SUPERV::KindOfInterpolation theKindOfInterpolation ;
122 SUPERV::KindOfExtrapolation theKindOfExtrapolation ;
124 typedef vector<InDataStreamParameter> ListOfInDataStreamParameters;
126 struct OutDataStreamParameter {
127 SALOME_ModuleCatalog::ServicesDataStreamParameter theDataStreamParameter ;
128 long theNumberOfValues ;
130 typedef vector<OutDataStreamParameter> ListOfOutDataStreamParameters;
133 string theComponentName ;
134 string theInterfaceName ;
136 SUPERV::KindOfNode theKind ;
138 SUPERV::KindOfDataStreamTrace theDataStreamTrace ;
139 double theDeltaTime ;
140 string theCoupledNode ;
141 // int theDataStreamInArgsNumber ;
142 // int theDataStreamOutArgsNumber ;
143 SALOME_ModuleCatalog::Service theService ;
144 ListOfInDataStreamParameters theListOfInDataStreams ;
145 ListOfOutDataStreamParameters theListOfOutDataStreams ;
146 ListOfFuncName theListOfFuncName ;
147 ListOfPythonFunctions theListOfPythonFunctions ;
148 SUPERV::SDate theFirstCreation ;
149 SUPERV::SDate theLastModification ;
150 string theEditorRelease ;
157 typedef vector<SNode> ListOfSNodes;
159 struct ServicesData {
160 SALOME_ModuleCatalog::ServicesParameter aDataParameter ;
161 CORBA::Any aDataValue;
164 typedef vector<ServicesData> ListOfServicesData;
167 string FromNodeName ;
168 string FromServiceParameterName ;
170 string ToServiceParameterName ;
171 CORBA::Any aLinkValue;
172 ListOfCoords aListOfCoords ;
175 typedef vector<SLink> ListOfSLinks;
184 typedef vector<SGraph> ListOfSGraphs;
190 CORBA::ORB_ptr _Orb ;
200 void SetDebug( CORBA::ORB_ptr ORB ,
201 int * prof_debug , ofstream * fdebug ) ;
203 char * ObjectToString( CORBA::Object_ptr obj ) const ;
204 CORBA::Object_ptr StringToObject(char * obj ) const ;
206 ostream & AnyValue( const CORBA::Any & anAny );
212 # define cdebug if ( GraphBase::Base::_fdebug ) *GraphBase::Base::_fdebug << " "
213 # define cdebug_in if ( GraphBase::Base::_fdebug ) *GraphBase::Base::_fdebug << endl << "-->" << " "
214 # define cdebug_out if ( GraphBase::Base::_fdebug ) *GraphBase::Base::_fdebug << endl << "<--" << " "
218 # define cdebug while (false) std::cerr
219 # define cdebug_in cdebug
220 # define cdebug_out cdebug
221 # define debugFile(x)
227 ostream & operator<< (ostream &,const SALOME_ModuleCatalog::DataStreamType &);