From 6f0d71f000b20d2cb7c7a16e0398aa151e890fca Mon Sep 17 00:00:00 2001 From: crouzet Date: Tue, 19 Oct 2010 14:03:08 +0000 Subject: [PATCH] =?utf8?q?hxx2salome=20integration:=20=20=20=20ajout=20d'u?= =?utf8?q?n=20membre=20ret=20=C3=83=C2=A0=20la=20classe=20Service=20pour?= =?utf8?q?=20g=C3=83=C2=A9rer=20les=20service=20avec=20retour.=20=20=20=20?= =?utf8?q?pour=20les=20composants=20fais=20avec=20HXX2SALOMEComponent=20et?= =?utf8?q?=20utilisant=20des=20classes=20MEDMEM,=20ajout=20de=20l'h=C3=83?= =?utf8?q?=C2=A9ritage=20=C3=83=C2=A0=20=20SALOME=5FMED::MED=5FGen=5FDrive?= =?utf8?q?r?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- module_generator/gener.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/module_generator/gener.py b/module_generator/gener.py index 131a181..fe88916 100644 --- a/module_generator/gener.py +++ b/module_generator/gener.py @@ -129,11 +129,12 @@ class Component(object): return {} class Service(object): - def __init__(self, name, inport=None, outport=None, instream=None, + def __init__(self, name, inport=None, outport=None, ret="void", instream=None, outstream=None, parallel_instream=None, parallel_outstream=None, body="", defs="", impl_type="sequential"): self.name = name self.inport = inport or [] self.outport = outport or [] + self.ret = ret self.instream = instream or [] self.outstream = outstream or [] self.parallel_instream = parallel_instream or [] @@ -276,7 +277,7 @@ AM_CFLAGS=$(SALOME_INCLUDES) -fexceptions modules = {} for compo in module.components: for serv in compo.services: - for name, typ in serv.inport + serv.outport: + for name, typ in serv.inport + serv.outport + [ ("return",serv.ret) ] : mod = moduleTypes[typ] if mod: get_dependent_modules(mod,modules) @@ -578,6 +579,8 @@ echo " Qt ..................... : $qt_ok" params = [] for name, typ in serv.outport: params.append(cataOutparam.substitute(name=name, type=typ)) + if serv.ret != "void" : + params.append(cataOutparam.substitute(name="return", type=serv.ret)) outparams = "\n".join(params) streams = [] for name, typ, dep in serv.instream: @@ -633,10 +636,18 @@ echo " Qt ..................... : $qt_ok" else: typ=idlTypes[typ] params.append("out %s %s" % (typ, name)) - service = " void %s(" % serv.name + service = " %s %s(" % (idlTypes[serv.ret],serv.name) service = service+",".join(params)+") raises (SALOME::SALOME_Exception);" services.append(service) - interfaces.append(interface.substitute(component=compo.name, services="\n".join(services))) + from hxxcompo import HXX2SALOMEComponent + if isinstance(compo,HXX2SALOMEComponent): + from hxx_tmpl import interfaceidlhxx + Inherited="" + if compo.use_medmem==True: + Inherited=", SALOME_MED::MED_Gen_Driver" + interfaces.append(interfaceidlhxx.substitute(component=compo.name,inherited=Inherited, services="\n".join(services))) + else: + interfaces.append(interface.substitute(component=compo.name, services="\n".join(services))) #build idl includes for SALOME modules idldefs="" -- 2.39.2