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_Service.cxx
25 // Author : Jean Rahuel, CEA
30 #include "DataFlowBase_Service.hxx"
32 void GraphBase::Service::SetService( const SALOME_ModuleCatalog::Service aService ) {
34 _Service.ServiceName = CORBA::string_dup( aService.ServiceName ) ;
35 _Service.ServiceinParameter.length( aService.ServiceinParameter.length() ) ;
36 _Service.ServiceoutParameter.length( aService.ServiceoutParameter.length() ) ;
38 for ( i = 0 ; i < (int ) _Service.ServiceinParameter.length() ; i++ ) {
39 _Service.ServiceinParameter[ i ].Parametertype = CORBA::string_dup( aService.ServiceinParameter[ i ].Parametertype ) ;
40 _Service.ServiceinParameter[ i ].Parametername = CORBA::string_dup( aService.ServiceinParameter[ i ].Parametername ) ;
42 for ( i = 0 ; i < (int ) _Service.ServiceoutParameter.length() ; i++ ) {
43 _Service.ServiceoutParameter[ i ].Parametertype = CORBA::string_dup( aService.ServiceoutParameter[ i ].Parametertype ) ;
44 _Service.ServiceoutParameter[ i ].Parametername = CORBA::string_dup( aService.ServiceoutParameter[ i ].Parametername ) ;
46 cdebug << "GraphBase::Service::SetService : " << _Service << endl ;
50 ostream & operator<< (ostream & f ,const SALOME_ModuleCatalog::Service & s ) {
51 f << "Name " << s.ServiceName << endl ;
53 for ( i = 0 ; i < (int ) s.ServiceinParameter.length() ; i++ ) {
55 f << " Inparameters " << i ;
58 f << ". " << s.ServiceinParameter[i].Parametername
59 << ". " << s.ServiceinParameter[i].Parametertype << endl ;
61 for ( i = 0 ; i < (int ) s.ServiceoutParameter.length() ; i++ ) {
63 f << " Outparameters " << i ;
66 f << ". " << s.ServiceoutParameter[i].Parametername
67 << ". " << s.ServiceoutParameter[i].Parametertype << endl ;