From 53d6613111b6853c0426069a5a823644fa581dd7 Mon Sep 17 00:00:00 2001 From: crouzet Date: Tue, 19 Oct 2010 14:04:57 +0000 Subject: [PATCH] hxx2salome integration: MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit ajout de nouveaux types : boolean, void, SALOME/Matrix, SALOME_MED/MEDCouplingFieldDoubleCorbaInterface, SALOME_MED/MEDCouplingUMeshCorbaInterface ajout d'un nouveau champ corbaRtnType décrivant le type c++ à retourner dans l'implémentation ajout d'une fonction : corba_rtn_type (similaire aux fonctions corba_in_type et corba_out_type) --- module_generator/yacstypes.py | 49 ++++++++++++++++++++++++----------- 1 file changed, 34 insertions(+), 15 deletions(-) diff --git a/module_generator/yacstypes.py b/module_generator/yacstypes.py index 125254e..e0cd355 100644 --- a/module_generator/yacstypes.py +++ b/module_generator/yacstypes.py @@ -23,17 +23,24 @@ corbaTypes = {"double":"CORBA::Double", "long":"CORBA::Long", "string":"const char*", "dblevec":"const %s::dblevec&", "stringvec":"const %s::stringvec&", "intvec":"const %s::intvec&", - "file":None + "file":None, "boolean":"CORBA::Boolean", "void":"void" } corbaOutTypes = {"double":"CORBA::Double&", "long":"CORBA::Long&", "string":"CORBA::String_out", "dblevec":"%s::dblevec_out", "stringvec":"%s::stringvec_out", "intvec":"%s::intvec_out", - "file":None + "file":None, "boolean":"CORBA::Boolean_out", "void":None } -moduleTypes = {"double":"", "long":"", "string":"", "dblevec":"", "stringvec":"", "intvec":"", "file":"" } -idlTypes = {"double":"double", "long":"long", "string":"string", "dblevec":"dblevec", "stringvec":"stringvec", "intvec":"intvec", "file":"" } +corbaRtnTypes = {"double":"CORBA::Double", "long":"CORBA::Long", + "string":"char*", "dblevec":"%s::dblevec*", + "stringvec":"%s::stringvec*", "intvec":"%s::intvec*", + "file":None, "boolean":"CORBA::Boolean", "void":"void" + } + +moduleTypes = {"double":"", "long":"", "string":"", "dblevec":"", "stringvec":"", "intvec":"", "file":"", "boolean":"", "void":"" } + +idlTypes = {"double":"double", "long":"long", "string":"string", "dblevec":"dblevec", "stringvec":"stringvec", "intvec":"intvec", "file":"", "boolean":"boolean", "void":"void" } def corba_in_type(typ, module): if corbaTypes[typ].count("%s")>0: @@ -47,10 +54,16 @@ def corba_out_type(typ, module): else: return corbaOutTypes[typ] +def corba_rtn_type(typ, module): + if corbaRtnTypes[typ].count("%s")>0: + return corbaRtnTypes[typ] % module + else: + return corbaRtnTypes[typ] + ValidTypes = corbaTypes.keys() PyValidTypes = ValidTypes+["pyobj"] -def add_type(typename, corbaType, corbaOutType, module, idltype): +def add_type(typename, corbaType, corbaOutType, module, idltype, corbaRtnType): """ add a data type YACS from other module than KERNEL to the list of available types :param typename: YACS data type name @@ -63,9 +76,12 @@ def add_type(typename, corbaType, corbaOutType, module, idltype): :type module: string :param idltype: representation for CORBA idl :type idltype: string + :param corbaRtnType: representation for C++ CORBA return parameter + :type corbaRtnType: string """ corbaTypes[typename] = corbaType corbaOutTypes[typename] = corbaOutType + corbaRtnTypes[typename] = corbaRtnType moduleTypes[typename] = module idlTypes[typename] = idltype ValidTypes.append(typename) @@ -88,13 +104,16 @@ ValidStreamTypes = calciumTypes.keys() ValidParallelStreamTypes = DatastreamParallelTypes.keys() ValidDependencies = ("I", "T") -add_type("dataref", "const Engines::dataref&", "Engines::dataref_out", "", "dataref") -add_type("GEOM_Object", "GEOM::GEOM_Object_ptr", "GEOM::GEOM_Object_out", "GEOM", "GEOM::GEOM_Object") -add_type("SMESH_Mesh", "SMESH::SMESH_Mesh_ptr", "SMESH::SMESH_Mesh_out", "SMESH", "SMESH::SMESH_Mesh") -add_type("SMESH_Hypothesis", "SMESH::SMESH_Hypothesis_ptr", "SMESH::SMESH_Hypothesis_out", "SMESH", "SMESH::SMESH_Hypothesis") -add_type("SALOME_MED/MED", "SALOME_MED::MED_ptr", "SALOME_MED::MED_out", "MED", "SALOME_MED::MED") -add_type("SALOME_MED/MESH", "SALOME_MED::MESH_ptr", "SALOME_MED::MESH_out", "MED", "SALOME_MED::MESH") -add_type("SALOME_MED/SUPPORT", "SALOME_MED::SUPPORT_ptr", "SALOME_MED::SUPPORT_out", "MED", "SALOME_MED::SUPPORT") -add_type("SALOME_MED/FIELD", "SALOME_MED::FIELD_ptr", "SALOME_MED::FIELD_out", "MED", "SALOME_MED::FIELD") -add_type("SALOME_MED/FIELDDOUBLE", "SALOME_MED::FIELDDOUBLE_ptr", "SALOME_MED::FIELDDOUBLE_out", "MED", "SALOME_MED::FIELDDOUBLE") -add_type("SALOME_MED/FIELDINT", "SALOME_MED::FIELDINT_ptr", "SALOME_MED::FIELDINT_out", "MED", "SALOME_MED::FIELDINT") +add_type("dataref", "const Engines::dataref&", "Engines::dataref_out", "", "dataref","Engines::dataref*") +add_type("GEOM_Object", "GEOM::GEOM_Object_ptr", "GEOM::GEOM_Object_out", "GEOM", "GEOM::GEOM_Object","GEOM::GEOM_Object_ptr") +add_type("SMESH_Mesh", "SMESH::SMESH_Mesh_ptr", "SMESH::SMESH_Mesh_out", "SMESH", "SMESH::SMESH_Mesh","SMESH::SMESH_Mesh_ptr") +add_type("SMESH_Hypothesis", "SMESH::SMESH_Hypothesis_ptr", "SMESH::SMESH_Hypothesis_out", "SMESH", "SMESH::SMESH_Hypothesis", "SMESH::SMESH_Hypothesis_ptr") +add_type("SALOME_MED/MED", "SALOME_MED::MED_ptr", "SALOME_MED::MED_out", "MED", "SALOME_MED::MED", "SALOME_MED::MED_ptr") +add_type("SALOME_MED/MESH", "SALOME_MED::MESH_ptr", "SALOME_MED::MESH_out", "MED", "SALOME_MED::MESH", "SALOME_MED::MESH_ptr") +add_type("SALOME_MED/SUPPORT", "SALOME_MED::SUPPORT_ptr", "SALOME_MED::SUPPORT_out", "MED", "SALOME_MED::SUPPORT", "SALOME_MED::SUPPORT_ptr") +add_type("SALOME_MED/FIELD", "SALOME_MED::FIELD_ptr", "SALOME_MED::FIELD_out", "MED", "SALOME_MED::FIELD", "SALOME_MED::FIELD_ptr") +add_type("SALOME_MED/FIELDDOUBLE", "SALOME_MED::FIELDDOUBLE_ptr", "SALOME_MED::FIELDDOUBLE_out", "MED", "SALOME_MED::FIELDDOUBLE", "SALOME_MED::FIELDDOUBLE_ptr") +add_type("SALOME_MED/FIELDINT", "SALOME_MED::FIELDINT_ptr", "SALOME_MED::FIELDINT_out", "MED", "SALOME_MED::FIELDINT", "SALOME_MED::FIELDINT_ptr") +add_type("SALOME/Matrix", "SALOME::Matrix_ptr", "SALOME::Matrix_out", "", "SALOME::Matrix", "SALOME::Matrix_ptr") +add_type("SALOME_MED/MEDCouplingFieldDoubleCorbaInterface", "SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr", "SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_out", "MED", "SALOME_MED::MEDCouplingFieldDoubleCorbaInterface", "SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr") +add_type("SALOME_MED/MEDCouplingUMeshCorbaInterface", "SALOME_MED::MEDCouplingUMeshCorbaInterface_ptr", "SALOME_MED::MEDCouplingUMeshCorbaInterface_out", "MED", "SALOME_MED::MEDCouplingUMeshCorbaInterface", "SALOME_MED::MEDCouplingUMeshCorbaInterface_ptr") -- 2.39.2