1 // SUPERV GraphExecutor : contains classes that permit execution of graphs and particularly the execution automaton
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_DynInvoke.cxx
25 // Author : Marc Tajchman, CEA
33 #include "DataFlowExecutor_InNode.hxx"
35 using namespace CORBA ;
39 void GraphExecutor::InNode::DynInvoke(Engines::Component_ptr obj ,
41 ServicesAnyData * inParams , int nInParams ,
42 ServicesAnyData * outParams , int nOutParams ) {
43 Request_var req = obj->_request( method ) ;
46 NVList_ptr arguments =req->arguments() ;
50 int n_in = nInParams ;
51 int n_out = nOutParams ;
53 for ( i = 0 ; i < n_in ; i++ ) {
54 CORBA::Any & data = inParams[i].Value ;
55 s = inParams[i].Name.c_str() ;
56 arguments->add_value( s , data , CORBA::ARG_IN ) ;
58 switch ( data.type()->kind() ) {
59 case CORBA::tk_string :
62 MESSAGE( "ArgIn" << i << " : " << s << " Value " << t << " (string)") ;
64 case CORBA::tk_double :
67 MESSAGE( "ArgIn" << i << " : " << s << " Value " << d << " (double)") ;
72 MESSAGE( "ArgIn" << i << " : " << s << " Value " << l << " (long)") ;
74 case CORBA::tk_objref :
75 MESSAGE( "ArgIn" << i << " : " << s << " Value " << "(object reference)") ;
78 MESSAGE( "ArgIn" << i << " : " << s << " Value " << "(other ERROR)") ;
84 for ( i = 0 ; i < n_out ; i++ ) {
85 CORBA::Any & data = outParams[i].Value ;
86 s = outParams[i].Name.c_str() ;
87 arguments->add_value( s , data , CORBA::ARG_OUT ) ;
89 switch ( data.type()->kind() ) {
90 case CORBA::tk_string :
93 MESSAGE( "ArgOut" << i << " : " << s << " Value " << t << " (string)") ;
95 case CORBA::tk_double :
98 MESSAGE( "ArgOut" << i << " : " << s << " Value " << d << " (double)") ;
100 case CORBA::tk_long :
103 MESSAGE( "ArgOut" << i << " : " << s << " Value " << l << " (long)") ;
105 case CORBA::tk_objref :
106 MESSAGE( "ArgOut" << i << " : " << s << " Value " << "(object reference)") ;
109 MESSAGE( "ArgOut" << i << " : " << s << " Value " << "(other ERROR)") ;
117 if( req->env()->exception() ) {
118 req->env()->exception()->_raise() ;
119 return ; // pas utile ?
122 for ( i = 0 ; i < n_out ; i++ ) {
124 outParams[i].Value = *( arguments->item( i + n_in )->value() ) ;
131 void GraphExecutor::InNode::DynInvoke( Engines::Component_ptr obj ,
133 const char * aGraphName ,
134 const char * aNodeName ) {
135 Request_var req = obj->_request( method ) ;
138 NVList_ptr arguments =req->arguments() ;
141 graph <<= aGraphName ;
142 arguments->add_value( "aGraphName" , graph , CORBA::ARG_IN ) ;
145 arguments->add_value( "aNodeName" , node , CORBA::ARG_IN ) ;
149 if( req->env()->exception() ) {
150 req->env()->exception()->_raise();