1 # Copyright (C) 2009-2013 EDF R&D
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License.
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 # Lesser General Public License for more details.
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 from string import Template
23 from compat import Template,set
26 // this cxx file was generated by yacsgen
27 #include "${component}_i.hxx"
28 #include "${cxx_include_file}"
33 #include "SenderFactory.hxx"
34 #include "MultiCommException.hxx"
35 #include "ReceiverFactory.hxx"
36 #include "SALOME_Matrix_i.hxx"
37 #include "MatrixClient.hxx"
38 #include "Utils_CorbaException.hxx"
39 #include "MEDCouplingFieldDouble.hxx"
52 //=============================================================================
54 * standard constructor
56 //=============================================================================
57 ${component}_i::${component}_i(CORBA::ORB_ptr orb,
58 PortableServer::POA_ptr poa,
59 PortableServer::ObjectId * contId,
60 const char *instanceName,
61 const char *interfaceName,
63 ParaMEDMEMComponent_i(orb,poa,contId,instanceName,interfaceName,regist),${inheritedconstructor}cppCompo_(new ${component})
65 MESSAGE("activate object");
67 _id = _poa->activate_object(_thisObj);
70 ${component}_i::~${component}_i()
80 PortableServer::ObjectId * ${component}Engine_factory(
82 PortableServer::POA_ptr poa,
83 PortableServer::ObjectId * contId,
84 const char *instanceName,
85 const char *interfaceName)
92 MPI_Initialized(&flag);
96 MPI_Init(&argc, &argv);
99 MPI_Comm_rank( MPI_COMM_WORLD, &numproc );
104 ${component}_i * my${component} = new ${component}_i(orb, poa, contId, instanceName, interfaceName, regist);
105 return my${component}->getId();
109 cxxCompo=Template(cxxCompo)
112 //this file was generated by yacsgen
113 #ifndef __${component}_hxx2salome__
114 #define __${component}_hxx2salome__
116 #include <SALOMEconfig.h>
117 #include "Utils_CorbaException.hxx"
118 #include CORBA_SERVER_HEADER(${module})
119 #include "Utils_CorbaException.hxx"
120 #include <memory> // for std::auto_ptr
124 // thread functions declaration
127 // thread structures declaration
130 class ${component}; // forward declaration
132 class ${component}_i: ${inheritedclass}
133 public POA_${module}_ORB::${component}_Gen,
134 public ParaMEDMEM::ParaMEDMEMComponent_i
138 ${component}_i(CORBA::ORB_ptr orb,
139 PortableServer::POA_ptr poa,
140 PortableServer::ObjectId * contId,
141 const char *instanceName,
142 const char *interfaceName,
144 virtual ~${component}_i();
148 // (re)defined methods of Driver
151 std::auto_ptr<${component}> cppCompo_;
157 PortableServer::ObjectId * ${component}Engine_factory(
159 PortableServer::POA_ptr poa,
160 PortableServer::ObjectId * contId,
161 const char *instanceName,
162 const char *interfaceName);
167 hxxCompo=Template(hxxCompo)
170 ${ret} ${component}_i::${service}(${parameters}) throw (SALOME::SALOME_Exception)
172 beginService("${component}_i::${service}");
173 BEGIN_OF("${component}_i::${service}");
180 endService("${component}_i::${service}");
181 END_OF("${component}_i::${service}");
184 catch (std::exception& ex)
186 THROW_SALOME_CORBA_EXCEPTION( ex.what(), SALOME::INTERNAL_ERROR );
190 cxxService=Template(cxxService)
195 dist_lib${component}Engine_la_SOURCES = \
198 lib${component}Engine_la_CXXFLAGS = -I$$(top_builddir)/idl $$(SALOME_INCLUDES) $$(MPI_INCLUDES) ${includes}
199 lib${component}Engine_la_LIBADD = ${libs} -L$$(top_builddir)/idl -lSalomeIDL${module} $${SALOME_LIBS} -lSalomeMPIContainer -lparamedmemcompo $$(FLIBS)
204 #, SALOME_MED::MED_Gen_Driver, SALOME::MultiCommClass
206 interface ${component}_Gen: ${inherited}
211 interfaceidlhxx=Template(interfaceidlhxx)
214 compoMakefile=Template(compoMakefile)