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 []
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)
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:
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=""