diff options
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/Slice/CPlusPlusUtil.cpp | 14 | ||||
-rw-r--r-- | cpp/src/slice2cpp/Gen.cpp | 23 |
2 files changed, 28 insertions, 9 deletions
diff --git a/cpp/src/Slice/CPlusPlusUtil.cpp b/cpp/src/Slice/CPlusPlusUtil.cpp index f0d77d96fe1..6909df3d44d 100644 --- a/cpp/src/Slice/CPlusPlusUtil.cpp +++ b/cpp/src/Slice/CPlusPlusUtil.cpp @@ -422,14 +422,13 @@ Slice::writeMarshalUnmarshalCode(Output& out, const TypePtr& type, const string& if(cl) { out << sb; + string scope = fixKwd(cl->scope()); if(marshal) { - string scope = fixKwd(cl->scope()); out << nl << scope << "__write(" << stream << ", " << fixedParam << ");"; } else { - out << nl << "::Ice::ObjectPtr " << obj << ';'; ClassDefPtr def = cl->definition(); string factory; string type; @@ -445,8 +444,7 @@ Slice::writeMarshalUnmarshalCode(Output& out, const TypePtr& type, const string& factory = "0"; type = "\"\""; } - out << nl << stream << deref << func << type << ", " << factory << ", " << obj << ");"; - out << nl << fixedParam << " = " << fixKwd(cl->scoped()) << "Ptr::dynamicCast(" << obj << ");"; + out << nl << scope << "__read(" << stream << ", " << type << ", " << factory << ", " << fixedParam << ");"; } out << eb; @@ -640,16 +638,15 @@ Slice::writeGenericMarshalUnmarshalCode(Output& out, const TypePtr& type, const ClassDeclPtr cl = ClassDeclPtr::dynamicCast(type); if(cl) { + string scope = fixKwd(cl->scope()); out << sb; if(marshal) { - string scope = fixKwd(cl->scope()); out << nl << scope << "__" << streamFunc << "Object(" << stream << ", " << tagName << ", " << fixedParam << ");"; } else { - out << nl << "::Ice::ObjectPtr " << obj << ';'; ClassDefPtr def = cl->definition(); string factory; string type; @@ -665,9 +662,8 @@ Slice::writeGenericMarshalUnmarshalCode(Output& out, const TypePtr& type, const factory = "0"; type = "\"\""; } - out << nl << obj << " = " << stream << deref << streamFunc << "Object(" << tagName << ", " - << type << ", " << factory << ");"; - out << nl << fixedParam << " = " << fixKwd(cl->scoped()) << "Ptr::dynamicCast(" << obj << ");"; + out << nl << scope << "__" << streamFunc << "Object(" << stream << ", " << tagName << ", " + << type << ", " << factory << ", " << fixedParam << ");"; } out << eb; diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp index e478ca79e59..ef0ae358582 100644 --- a/cpp/src/slice2cpp/Gen.cpp +++ b/cpp/src/slice2cpp/Gen.cpp @@ -2252,6 +2252,15 @@ Slice::Gen::ObjectVisitor::visitClassDefEnd(const ClassDefPtr& p) C << eb; C << sp; + C << nl << "void" << nl << scope.substr(2) << "__read(::IceInternal::BasicStream* __is, " + << "const ::std::string& __st, const ::Ice::ObjectFactoryPtr& __f, " << scoped << "Ptr& v)"; + C << sb; + C << nl << "::Ice::ObjectPtr __obj;"; + C << nl << "__is->read(__st, __f, __obj);"; + C << nl << "v = " << scoped << "Ptr::dynamicCast(__obj);"; + C << eb; + + C << sp; C << nl << "void" << nl << scoped.substr(2) << "::__marshal(const ::Ice::StreamPtr& __os) const"; C << sb; @@ -2267,6 +2276,16 @@ Slice::Gen::ObjectVisitor::visitClassDefEnd(const ClassDefPtr& p) C << eb; C << sp; + C << nl << "void" << nl << scope.substr(2) << "__readObject(const ::Ice::StreamPtr& __is, " + << "const ::std::string& __n, const ::std::string& __st, const ::Ice::ObjectFactoryPtr& __f, " + << scoped << "Ptr& v)"; + C << sb; + C << nl << "::Ice::ObjectPtr __obj;"; + C << nl << "__obj = __is->readObject(__n, __st, __f);"; + C << nl << "v = " << scoped << "Ptr::dynamicCast(__obj);"; + C << eb; + + C << sp; C << nl << "void" << nl << scoped.substr(2) << "::ice_unmarshal(const ::std::string& __name, " << "const ::Ice::StreamPtr& __is, " << scoped << "Ptr& value)"; C << sb; @@ -2804,8 +2823,12 @@ Slice::Gen::HandleVisitor::visitClassDecl(const ClassDeclPtr& p) H << nl << _dllExport << "void __write(::IceInternal::BasicStream*, const " << name << "Prx&);"; H << nl << _dllExport << "void __read(::IceInternal::BasicStream*, " << name << "Prx&);"; H << nl << _dllExport << "void __write(::IceInternal::BasicStream*, const " << name << "Ptr&);"; + H << nl << _dllExport << "void __read(::IceInternal::BasicStream*, const ::std::string&, " + << "const ::Ice::ObjectFactoryPtr&, " << name << "Ptr&);"; H << nl << _dllExport << "void __writeObject(const ::Ice::StreamPtr&, const ::std::string&, const " << name << "Ptr&);"; + H << nl << _dllExport << "void __readObject(const ::Ice::StreamPtr&, const ::std::string&, " + << "const ::std::string&, const ::Ice::ObjectFactoryPtr&, " << name << "Ptr&);"; H << sp; H << nl << _dllExport << "void ice_marshal(const ::std::string&, const ::Ice::StreamPtr&, const " |