diff --git a/bin/linux/tars2node b/bin/linux/tars2node index 55d08b8..65972e3 100755 Binary files a/bin/linux/tars2node and b/bin/linux/tars2node differ diff --git a/src/gen_server.cpp b/src/gen_server.cpp index a1d296b..66566f0 100644 --- a/src/gen_server.cpp +++ b/src/gen_server.cpp @@ -212,15 +212,48 @@ string CodeGenerator::generateDispatch(const NamespacePtr &nPtr, const Interface { if (vParamDecl[i]->isOut()) { - dstr << TAB << vParamDecl[i]->getTypeIdPtr()->getId() + //taf_data.rsp ? rsp.readFromObject(taf_data.rsp) : rsp; + StructPtr sPtr = StructPtr::dynamicCast(vParamDecl[i]->getTypeIdPtr()->getTypePtr()); + if (sPtr) + { + dstr << TAB << vParamDecl[i]->getTypeIdPtr()->getId() + << " = " << getDefault(vParamDecl[i]->getTypeIdPtr(), "", nPtr->getId(), true) + << ";" << endl; + dstr << TAB << "_data_." << vParamDecl[i]->getTypeIdPtr()->getId() << " ? " << vParamDecl[i]->getTypeIdPtr()->getId() << ".readFromObject(" + << "_data_." << vParamDecl[i]->getTypeIdPtr()->getId() << ") : " << vParamDecl[i]->getTypeIdPtr()->getId() + << ";" << endl; + } + else + { + dstr << TAB << vParamDecl[i]->getTypeIdPtr()->getId() << " = _data_." << vParamDecl[i]->getTypeIdPtr()->getId() << " || " << getDefault(vParamDecl[i]->getTypeIdPtr(), "", nPtr->getId(), true) << ";" << endl; + } + // dstr << TAB << vParamDecl[i]->getTypeIdPtr()->getId() + // << " = _data_." << vParamDecl[i]->getTypeIdPtr()->getId() << " || " << getDefault(vParamDecl[i]->getTypeIdPtr(), "", nPtr->getId(), true) + // << ";" << endl; } else { - dstr << TAB << vParamDecl[i]->getTypeIdPtr()->getId() - << " = _data_." << vParamDecl[i]->getTypeIdPtr()->getId() - << ";" << endl; + // dstr << TAB << vParamDecl[i]->getTypeIdPtr()->getId() + // << " = _data_." << vParamDecl[i]->getTypeIdPtr()->getId() + // << ";" << endl; + StructPtr sPtr = StructPtr::dynamicCast(vParamDecl[i]->getTypeIdPtr()->getTypePtr()); + if (sPtr) + { + dstr << TAB << "var " << vParamDecl[i]->getTypeIdPtr()->getId() + << " = " << getDefault(vParamDecl[i]->getTypeIdPtr(), "", nPtr->getId(), true) + << ";" << endl; + dstr << TAB << vParamDecl[i]->getTypeIdPtr()->getId() << ".readFromObject(" + << "_data_." << vParamDecl[i]->getTypeIdPtr()->getId() << ")" + << ";" << endl; + } + else + { + dstr << TAB << "var " << vParamDecl[i]->getTypeIdPtr()->getId() + << " = _data_." << vParamDecl[i]->getTypeIdPtr()->getId() + << ";" << endl; + } } } DEL_TAB;