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.salome-platform.org/ or email : webmaster.salome@opencascade.com
24 // File : DataFlowBase_Base.hxx
25 // Author : Jean Rahuel, CEA
28 #ifndef _DATAFLOW_BASE_HXX
29 #define _DATAFLOW_BASE_HXX
31 //#include <strstream>
45 #include <SALOMEconfig.h>
46 #include CORBA_CLIENT_HEADER(SUPERV)
48 #include "utilities.h"
51 #define ExitWhenNodeAborted 1
53 extern char *SuperVision_Version ;
55 extern char *NULLSTRING ;
57 extern char *FACTORYSERVER ;
59 inline char * my_strdup( const char * s ) {
60 if (s == NULL) return NULL;
62 size_t l = strlen(s) + 1;
63 char * t = new char[l];
68 inline char * my_strblkdup( const char * s ) {
69 if (s == NULL) return NULL ;
71 size_t l = strlen(s) + 1 ;
73 for ( i = l - 2 ; i >= 0 ; i-- ) {
79 char * t = new char[l] ;
85 string DataStreamTypeToString( const SALOME_ModuleCatalog::DataStreamType aDataStreamType ) ;
86 SALOME_ModuleCatalog::DataStreamType StringToDataStreamType( const char * aIdlType ) ;
88 string KindOfDataStreamTraceToString( SUPERV::KindOfDataStreamTrace aDataStreamTrace ) ;
90 string DataStreamDependencyToString( const SALOME_ModuleCatalog::DataStreamDependency aDataStreamDependency ) ;
92 string DataStreamToString( const SALOME_ModuleCatalog::DataStreamType aDataStreamType ) ;
94 //enum StatusOfPort { NotConnected , PortConnected , PortAndDataConnected ,
95 enum StatusOfPort { NotConnected , PortConnected ,
96 DataConnected , ExternConnected } ;
105 typedef vector<SCoord> ListOfCoords;
107 typedef string FuncName ;
109 typedef vector< FuncName > ListOfFuncName ;
111 typedef vector<const SUPERV::ListOfStrings *> ListOfPythonFunctions ;
113 typedef vector<SALOME_ModuleCatalog::ServicesParameter> ListOfParameters;
115 struct InDataStreamParameter {
116 SALOME_ModuleCatalog::ServicesDataStreamParameter theDataStreamParameter ;
117 SUPERV::KindOfSchema theKindOfSchema ;
118 SUPERV::KindOfInterpolation theKindOfInterpolation ;
119 SUPERV::KindOfExtrapolation theKindOfExtrapolation ;
121 typedef vector<InDataStreamParameter> ListOfInDataStreamParameters;
123 struct OutDataStreamParameter {
124 SALOME_ModuleCatalog::ServicesDataStreamParameter theDataStreamParameter ;
125 long theNumberOfValues ;
127 typedef vector<OutDataStreamParameter> ListOfOutDataStreamParameters;
130 string theComponentName ;
131 string theInterfaceName ;
133 SUPERV::KindOfNode theKind ;
135 SUPERV::KindOfDataStreamTrace theDataStreamTrace ;
136 double theDeltaTime ;
137 string theCoupledNode ;
138 // int theDataStreamInArgsNumber ;
139 // int theDataStreamOutArgsNumber ;
140 SALOME_ModuleCatalog::Service theService ;
141 ListOfInDataStreamParameters theListOfInDataStreams ;
142 ListOfOutDataStreamParameters theListOfOutDataStreams ;
143 ListOfFuncName theListOfFuncName ;
144 ListOfPythonFunctions theListOfPythonFunctions ;
145 SUPERV::SDate theFirstCreation ;
146 SUPERV::SDate theLastModification ;
147 string theEditorRelease ;
154 typedef vector<SNode> ListOfSNodes;
156 struct ServicesData {
157 SALOME_ModuleCatalog::ServicesParameter aDataParameter ;
158 CORBA::Any aDataValue;
161 typedef vector<ServicesData> ListOfServicesData;
164 string FromNodeName ;
165 string FromServiceParameterName ;
167 string ToServiceParameterName ;
168 CORBA::Any aLinkValue;
169 ListOfCoords aListOfCoords ;
172 typedef vector<SLink> ListOfSLinks;
181 typedef vector<SGraph> ListOfSGraphs;
187 CORBA::ORB_ptr _Orb ;
197 void SetDebug( CORBA::ORB_ptr ORB ,
198 int * prof_debug , ofstream * fdebug ) ;
200 char * ObjectToString( CORBA::Object_ptr obj ) const ;
201 CORBA::Object_ptr StringToObject(char * obj ) const ;
203 ostream & AnyValue( const CORBA::Any & anAny );
209 # define cdebug if ( GraphBase::Base::_fdebug ) *GraphBase::Base::_fdebug << " "
210 # define cdebug_in if ( GraphBase::Base::_fdebug ) *GraphBase::Base::_fdebug << endl << "-->" << " "
211 # define cdebug_out if ( GraphBase::Base::_fdebug ) *GraphBase::Base::_fdebug << endl << "<--" << " "
215 # define cdebug while (false) std::cerr
216 # define cdebug_in cdebug
217 # define cdebug_out cdebug
218 # define debugFile(x)
224 ostream & operator<< (ostream &,const SALOME_ModuleCatalog::DataStreamType &);