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 enum StatusOfPort { NotConnected , PortConnected , PortAndDataConnected ,
94 typedef vector<SCoord> ListOfCoords;
96 typedef string FuncName ;
98 typedef vector< FuncName > ListOfFuncName ;
100 typedef vector<const SUPERV::ListOfStrings *> ListOfPythonFunctions ;
102 struct NodeParameter {
103 SALOME_ModuleCatalog::ServicesParameter theInParameter ;
104 SALOME_ModuleCatalog::ServicesParameter theOutParameter ;
107 typedef vector<NodeParameter> ListOfParameters;
110 string theComponentName ;
111 string theInterfaceName ;
113 SUPERV::KindOfNode theKind ;
114 string theCoupledNode ;
115 SALOME_ModuleCatalog::Service theService ;
116 ListOfParameters theListOfParameters ;
117 ListOfFuncName theListOfFuncName ;
118 ListOfPythonFunctions theListOfPythonFunctions ;
119 SUPERV::SDate theFirstCreation ;
120 SUPERV::SDate theLastModification ;
121 string theEditorRelease ;
128 typedef vector<SNode> ListOfNodes;
130 struct ServicesData {
131 SALOME_ModuleCatalog::ServicesParameter aDataParameter ;
132 CORBA::Any aDataValue;
135 typedef vector<ServicesData> ListOfServicesData;
138 string FromNodeName ;
139 string FromServiceParameterName ;
141 string ToServiceParameterName ;
142 CORBA::Any aLinkValue;
143 ListOfCoords aListOfCoords ;
146 typedef vector<SLink> ListOfLinks;
155 typedef vector<SGraph> ListOfGraphs;
161 CORBA::ORB_ptr _Orb ;
171 void SetDebug( CORBA::ORB_ptr ORB ,
172 int * prof_debug , ofstream * fdebug ) ;
174 char * ObjectToString( CORBA::Object_ptr obj ) const ;
175 CORBA::Object_ptr StringToObject(char * obj ) const ;
180 // *GraphBase::Base::_fdebug << " " /*<< setw(3*(*GraphBase::Base::_prof_debug)) */<< " "
182 # define cdebug if ( GraphBase::Base::_fdebug ) *GraphBase::Base::_fdebug << " " << " "
184 # define cdebug_in if ( GraphBase::Base::_fdebug ) *GraphBase::Base::_fdebug << endl << "-->" << " "
186 # define cdebug_out if ( GraphBase::Base::_fdebug ) *GraphBase::Base::_fdebug << endl << "<--" << " "
190 # define cdebug while (false) std::cerr
191 # define cdebug_in cdebug
192 # define cdebug_out cdebug
193 # define debugFile(x)