1 # Copyright (C) 2009-2014 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 compat import Template,set
26 // this cxx file was generated by yacsgen
27 #include "${component}_i.hxx"
28 #include "${component}.hxx"
32 #include "SenderFactory.hxx"
33 #include "MultiCommException.hxx"
34 #include "ReceiverFactory.hxx"
35 #include "SALOME_Matrix_i.hxx"
36 #include "MatrixClient.hxx"
37 #include "Utils_CorbaException.hxx"
43 //=============================================================================
45 * standard constructor
47 //=============================================================================
48 ${component}_i::${component}_i(CORBA::ORB_ptr orb,
49 PortableServer::POA_ptr poa,
50 PortableServer::ObjectId * contId,
51 const char *instanceName,
52 const char *interfaceName) :
53 Engines_Component_i(orb, poa, contId, instanceName, interfaceName),${inheritedconstructor}cppCompo_(new ${component})
55 MESSAGE("activate object");
57 _id = _poa->activate_object(_thisObj);
60 ${component}_i::~${component}_i()
66 char* ${component}_i::ComponentDataType()
68 return CORBA::string_dup("${component}");
71 Engines::EngineComponent_ptr ${component}_i::GetComponentInstance()
73 return ${component}_Gen::_this();
78 PortableServer::ObjectId * ${component}Engine_factory(
80 PortableServer::POA_ptr poa,
81 PortableServer::ObjectId * contId,
82 const char *instanceName,
83 const char *interfaceName)
85 MESSAGE("PortableServer::ObjectId * ${component}Engine_factory()");
86 SCRUTE(interfaceName);
87 ${component}_i * my${component}
88 = new ${component}_i(orb, poa, contId, instanceName, interfaceName);
89 return my${component}->getId() ;
93 cxxCompo=Template(cxxCompo)
96 //this file was generated by yacsgen
97 #ifndef __${component}_hxx2salome__
98 #define __${component}_hxx2salome__
100 #include <SALOMEconfig.h>
101 #include CORBA_SERVER_HEADER(${module})
102 #include "SALOME_Component_i.hxx"
103 #include "SALOMEMultiComm.hxx"
104 #include <memory> // for std::auto_ptr
109 class ${component}; // forward declaration
111 class ${component}_i: ${inheritedclass}
112 public POA_${module}_ORB::${component}_Gen,
113 public Engines_Component_i
117 ${component}_i(CORBA::ORB_ptr orb,
118 PortableServer::POA_ptr poa,
119 PortableServer::ObjectId * contId,
120 const char *instanceName,
121 const char *interfaceName);
122 virtual ~${component}_i();
126 // (re)defined methods of Driver
127 virtual Engines::EngineComponent_ptr GetComponentInstance();
128 char* ComponentDataType();
131 std::auto_ptr<${component}> cppCompo_;
137 PortableServer::ObjectId * ${component}Engine_factory(
139 PortableServer::POA_ptr poa,
140 PortableServer::ObjectId * contId,
141 const char *instanceName,
142 const char *interfaceName);
147 hxxCompo=Template(hxxCompo)
150 ${ret} ${component}_i::${service}(${parameters}) throw (SALOME::SALOME_Exception)
152 beginService("${component}_i::${service}");
153 BEGIN_OF("${component}_i::${service}");
158 catch (std::exception& ex)
160 THROW_SALOME_CORBA_EXCEPTION( ex.what(), SALOME::INTERNAL_ERROR );
164 cxxService=Template(cxxService)
169 dist_lib${component}Engine_la_SOURCES = \
172 lib${component}Engine_la_CXXFLAGS = -I$$(top_builddir)/idl $$(SALOME_INCLUDES) ${includes}
173 lib${component}Engine_la_LIBADD = ${libs} -L$$(top_builddir)/idl -lSalomeIDL${module} $${SALOME_LIBS} $$(FLIBS)
178 #, SALOME_MED::MED_Gen_Driver, SALOME::MultiCommClass
180 interface ${component}_Gen: ${inherited}
185 interfaceidlhxx=Template(interfaceidlhxx)
188 compoMakefile=Template(compoMakefile)