X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=scripts%2Fparse3.awk;h=620587b0286092b276fef9a800f680b28b2923e0;hb=f72f139d4fdf5da305b22f8a3c44d57d95534c75;hp=79038ed9f73614fb27fecfbbae7521bd7219de0e;hpb=1eda7ee52765a1ddcbed31ff058914c18817e548;p=tools%2Fhxx2salome.git diff --git a/scripts/parse3.awk b/scripts/parse3.awk index 79038ed..620587b 100644 --- a/scripts/parse3.awk +++ b/scripts/parse3.awk @@ -33,6 +33,8 @@ BEGIN { idl_arg_type["std::string&"]="out string" idl_arg_type["const MEDMEM::MESH&"]="in SALOME_MED::MESH" idl_arg_type["const MEDMEM::MESH*"]="in SALOME_MED::MESH" + idl_arg_type["const MEDMEM::SUPPORT&"]="in SALOME_MED::SUPPORT" + idl_arg_type["const MEDMEM::SUPPORT*"]="in SALOME_MED::SUPPORT" idl_arg_type["const MEDMEM::FIELD*"]="in SALOME_MED::FIELDDOUBLE" idl_arg_type["const MEDMEM::FIELD&"]="in SALOME_MED::FIELDDOUBLE" idl_arg_type["MEDMEM::FIELD*&"]="out SALOME_MED::FIELDDOUBLE" @@ -62,6 +64,7 @@ BEGIN { idl_rtn_type["MEDMEM::MESH&"]="SALOME_MED::MESH" idl_rtn_type["MEDMEM::MESH*"]="SALOME_MED::MESH" idl_rtn_type["const MEDMEM::MESH*"]="SALOME_MED::MESH" + idl_rtn_type["MEDMEM::SUPPORT*"]="SALOME_MED::SUPPORT" idl_rtn_type["const MEDMEM::FIELD*"]="SALOME_MED::FIELDDOUBLE" idl_rtn_type["MEDMEM::FIELD*"]="SALOME_MED::FIELDDOUBLE" idl_rtn_type["MEDMEM::FIELD&"]="SALOME_MED::FIELDDOUBLE" @@ -90,6 +93,7 @@ BEGIN { idl_impl_hxx["out unsigned long"]="CORBA::ULong_out" idl_impl_hxx["out string"]="CORBA::String_out" idl_impl_hxx["in SALOME_MED::MESH"]="SALOME_MED::MESH_ptr" + idl_impl_hxx["in SALOME_MED::SUPPORT"]="SALOME_MED::SUPPORT_ptr" idl_impl_hxx["in SALOME_MED::FIELDDOUBLE"]="SALOME_MED::FIELDDOUBLE_ptr" idl_impl_hxx["out SALOME_MED::FIELDDOUBLE"]="SALOME_MED::FIELDDOUBLE_out" idl_impl_hxx["in SALOME::SenderDouble"]="SALOME::SenderDouble_ptr" @@ -105,6 +109,7 @@ BEGIN { idl_impl_hxx["unsigned long"]="CORBA::ULong" idl_impl_hxx["string"]="char*" idl_impl_hxx["SALOME_MED::MESH"]="SALOME_MED::MESH_ptr" + idl_impl_hxx["SALOME_MED::SUPPORT"]="SALOME_MED::SUPPORT_ptr" idl_impl_hxx["SALOME_MED::FIELDDOUBLE"]="SALOME_MED::FIELDDOUBLE_ptr" idl_impl_hxx["SALOME::SenderDouble"]="SALOME::SenderDouble_ptr" idl_impl_hxx["SALOME::Matrix"]="SALOME::Matrix_ptr" @@ -131,6 +136,8 @@ BEGIN { cpp_impl_a["std::string&"]="std::string _%s;\n" cpp_impl_a["const MEDMEM::MESH&"]="\tMEDMEM::MESHClient* _%s = new MEDMEM::MESHClient(%s);\n" # MESHClient cannot be created on the stack (private constructor), so we create it on the heap and dereference it later (in treatment 4) cpp_impl_a["const MEDMEM::MESH*"]="\tMEDMEM::MESHClient* _%s = new MEDMEM::MESHClient(%s);\n" + cpp_impl_a["const MEDMEM::SUPPORT&"]="\tMEDMEM::SUPPORTClient* _%s = new MEDMEM::SUPPORTClient(%s);\n" # SUPPORTClient cannot be created on the stack (protected destructor), so we create it on the heap and dereference it later (in treatment 4) + cpp_impl_a["const MEDMEM::SUPPORT*"]="\tMEDMEM::SUPPORTClient* _%s = new MEDMEM::SUPPORTClient(%s);\n" cpp_impl_a["MEDMEM::FIELD*&"]="\tMEDMEM::FIELD* _%s;\n" cpp_impl_a["const MEDMEM::FIELD*"]="\tstd::auto_ptr > _%s ( new MEDMEM::FIELDClient(%s) );\n" cpp_impl_a["const MEDMEM::FIELD&"]="\tMEDMEM::FIELDClient _%s(%s);\n" @@ -139,7 +146,7 @@ BEGIN { cpp_impl_a["std::vector*&"]="\tstd::vector* _%s;\n" cpp_impl_a["const std::vector >&"]="\tMatrixClient _%s_client;\n\tint _%s_nbRow;\n\tint _%s_nbCol;\n"\ "\tdouble* _%s_tab = _%s_client.getValue(%s,_%s_nbCol,_%s_nbRow);\n\tstd::vector > _%s(_%s_nbRow);\n"\ - "\tfor (int i=0; i!=_%s_nbRow; ++i)\n\t{\n\t _%s.reserve(_%s_nbCol);\n"\ + "\tfor (int i=0; i!=_%s_nbRow; ++i)\n\t{\n\t _%s[i].resize(_%s_nbCol);\n"\ "\t std::copy(_%s_tab+_%s_nbCol*i,_%s_tab+_%s_nbCol*(i+1), _%s[i].begin());\n\t}\n\tdelete [] _%s_tab;\n" cpp_impl_a["MEDMEM::FIELD*&"]="\tMEDMEM::FIELD* _%s;\n" cpp_impl_a["const MEDMEM::FIELD*"]="\tstd::auto_ptr > _%s ( new MEDMEM::FIELDClient(%s) );\n" @@ -175,6 +182,9 @@ BEGIN { cpp_impl_b["const MEDMEM::MESH*"]=\ "\tMEDMEM::MESH_i * _rtn_mesh_i = new MEDMEM::MESH_i(const_cast(_rtn_cpp));\n"\ "\tSALOME_MED::MESH_ptr _rtn_ior = _rtn_mesh_i->_this();\n" + cpp_impl_b["MEDMEM::SUPPORT*"]=\ + "\tMEDMEM::SUPPORT_i * _rtn_support_i = new MEDMEM::SUPPORT_i(_rtn_cpp);\n"\ + "\tSALOME_MED::SUPPORT_ptr _rtn_ior = _rtn_support_i->_this();\n" cpp_impl_b["const MEDMEM::FIELD*"]=\ "\tMEDMEM::FIELDTEMPLATE_I * _rtn_field_i = new MEDMEM::FIELDTEMPLATE_I(const_cast*>(_rtn_cpp),false);\n"\ "\tSALOME_MED::FIELDDOUBLE_ptr _rtn_ior = _rtn_field_i->_this();\n" @@ -193,7 +203,7 @@ BEGIN { "\tint _rtn_cpp_i=(*_rtn_cpp).size();\n\tint _rtn_cpp_j=(*_rtn_cpp)[0].size();\n"\ "\tdouble* _rtn_tab = new double[_rtn_cpp_i*_rtn_cpp_j];\n"\ "\tfor (int i=0; i!=_rtn_cpp_i; ++i)\n\t std::copy((*_rtn_cpp)[i].begin(),(*_rtn_cpp)[i].end(),_rtn_tab+i*_rtn_cpp_j);\n"\ - "\tSALOME_Matrix_i* _rtn_matrix_i = new SALOME_Matrix_i(*this,_rtn_tab,_rtn_cpp_j,_rtn_cpp_i,true);\n"\ + "\tSALOME_Matrix_i* _rtn_matrix_i = new SALOME_Matrix_i(*this,_rtn_tab,_rtn_cpp_i,_rtn_cpp_j,true);\n"\ "\tSALOME::Matrix_ptr _rtn_ior = _rtn_matrix_i->_this();\n\tdelete _rtn_cpp;\n" cpp_impl_b["const MEDMEM::FIELD*"]=\ "\tMEDMEM::FIELDINT_i * _rtn_field_i = new MEDMEM::FIELDINT_i(const_cast*>(_rtn_cpp),false);\n"\ @@ -225,18 +235,20 @@ BEGIN { cpp_impl_c["std::vector*&"]=\ "\t%s = SenderFactory::buildSender(*this,&(*_%s)[0],(*_%s).size(),true);\n" cpp_impl_c["std::string&"]="\t%s = CORBA::string_dup(_%s.c_str());\n" - cpp_impl_c["int&"]="\t%s = _%s" - cpp_impl_c["double&"]="\t%s = _%s" - cpp_impl_c["float&"]="\t%s = _%s" - cpp_impl_c["long&"]="\t%s = _%s" - cpp_impl_c["short&"]="\t%s = _%s" - cpp_impl_c["unsigned&"]="\t%s = _%s" + cpp_impl_c["int&"]="\t%s = _%s;\n" + cpp_impl_c["double&"]="\t%s = _%s;\n" + cpp_impl_c["float&"]="\t%s = _%s;\n" + cpp_impl_c["long&"]="\t%s = _%s;\n" + cpp_impl_c["short&"]="\t%s = _%s;\n" + cpp_impl_c["unsigned&"]="\t%s = _%s;\n" cpp_impl_c["const MEDMEM::MESH&"]="\t_%s->removeReference();\n" cpp_impl_c["const MEDMEM::MESH*"]="\t_%s->removeReference();\n" + cpp_impl_c["const MEDMEM::SUPPORT&"]="\t_%s->removeReference();\n" + cpp_impl_c["const MEDMEM::SUPPORT*"]="\t_%s->removeReference();\n" # # # record sep is ");\n" whith blanks all around, and optional "(" at the beginning - RS="[(]?[ \t]*\)[ \t]*;[ \t]*\n" + RS="[(]?[ \t]*[)][ \t]*[;][ \t]*[\n]" FS="[ \t]*[(,][ \t]*" # field sep is either "(" or "," surrounded by blanks } @@ -362,7 +374,7 @@ BEGIN { pre="" if ( cpp_impl_a[type[i]] ~ "auto_ptr" ) post=".get()" # for auto_ptr argument, retrieve the raw pointer behind - if ( type[i] == "const MEDMEM::MESH&" ) + if ( type[i] == "const MEDMEM::MESH&" || type[i] == "const MEDMEM::SUPPORT&" ) pre="*" # we cannot create MESHClient on the stack (private constructor), so we create it on the heap and dereference it if ( i < NF ) post=post"," # separator between arguments