1 # Copyright (C) 2009-2016 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, or (at your option) any later version.
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 module_generator.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 MEDCoupling::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 #compoMakefile=Template(compoMakefile)
207 # CMakeLists.txt in src/<component>
208 # template parameters:
209 # module : module name
210 # component : component name
211 # componentlib : name of the target library
212 # includes : additional headers, separated by spaces or \n. can be empty
213 # libs : additional libraries
214 # find_libs : find_library commands
215 # target_properties : additional properties of the target
216 cmake_src_compo_hxxpara = """
218 # additional include directories
220 $${KERNEL_INCLUDE_DIRS}
221 $${OMNIORB_INCLUDE_DIR}
222 $${PROJECT_BINARY_DIR}
223 $${PROJECT_BINARY_DIR}/idl
224 $${MEDCOUPLING_INCLUDE_DIRS}
228 # --- definitions ---
230 $${OMNIORB_DEFINITIONS}
233 # find additional libraries
236 # libraries to link to
238 $${OMNIORB_LIBRARIES}
239 $${KERNEL_SalomeIDLKernel}
241 $${KERNEL_SalomeContainer}
242 $${KERNEL_SalomeMPIContainer}
243 $${MED_paramedmemcompo}
244 $${MED_paramedcouplingcorba}
251 # header files / no moc processing
253 SET(${module}_HEADERS
260 SET(${module}_SOURCES
266 ADD_LIBRARY(${componentlib} $${${module}_SOURCES})
267 TARGET_LINK_LIBRARIES(${componentlib} $${_link_LIBRARIES} )
270 INSTALL(TARGETS ${componentlib} EXPORT $${PROJECT_NAME}TargetGroup DESTINATION $${SALOME_INSTALL_LIBS})
272 INSTALL(FILES $${${module}_HEADERS} DESTINATION $${SALOME_INSTALL_HEADERS})
274 cmake_src_compo_hxxpara = Template(cmake_src_compo_hxxpara)
276 #, SALOME_MED::MED_Gen_Driver, SALOME::MultiCommClass
278 interface ${component}_Gen: ${inherited}
283 interfaceidlhxx=Template(interfaceidlhxx)