summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2016-11-17 18:05:33 -0500
committerBernard Normier <bernard@zeroc.com>2016-11-17 18:05:33 -0500
commitf0c21cb5f22a369e6f2b22b730801c40acae8de0 (patch)
treedaae93cce2ef67aa84432641de7bf5694046143a /cpp
parentReplaced double-underscores in java and java-compat (diff)
downloadice-f0c21cb5f22a369e6f2b22b730801c40acae8de0.tar.bz2
ice-f0c21cb5f22a369e6f2b22b730801c40acae8de0.tar.xz
ice-f0c21cb5f22a369e6f2b22b730801c40acae8de0.zip
Resync stream API for generated structs/enums in Java and C#
Diffstat (limited to 'cpp')
-rw-r--r--cpp/src/Slice/JavaUtil.cpp44
-rw-r--r--cpp/src/slice2cs/CsUtil.cpp14
-rw-r--r--cpp/src/slice2cs/Gen.cpp132
-rw-r--r--cpp/src/slice2cs/Gen.h4
-rw-r--r--cpp/src/slice2java/Gen.cpp20
-rw-r--r--cpp/src/slice2java/GenCompat.cpp20
6 files changed, 133 insertions, 101 deletions
diff --git a/cpp/src/Slice/JavaUtil.cpp b/cpp/src/Slice/JavaUtil.cpp
index ba141e904c0..7441b60aca4 100644
--- a/cpp/src/Slice/JavaUtil.cpp
+++ b/cpp/src/Slice/JavaUtil.cpp
@@ -1783,13 +1783,13 @@ Slice::JavaCompatGenerator::writeMarshalUnmarshalCode(Output& out,
if(st->isVariableLength())
{
out << nl << "int pos = " << stream << ".startSize();";
- out << nl << typeS << ".write(" << stream << ", " << val << ");";
+ out << nl << typeS << ".ice_write(" << stream << ", " << val << ");";
out << nl << stream << ".endSize(pos);";
}
else
{
out << nl << stream << ".writeSize(" << st->minWireSize() << ");";
- out << nl << typeS << ".write(" << stream << ", " << val << ");";
+ out << nl << typeS << ".ice_write(" << stream << ", " << val << ");";
}
if(optionalParam)
{
@@ -1798,7 +1798,7 @@ Slice::JavaCompatGenerator::writeMarshalUnmarshalCode(Output& out,
}
else
{
- out << nl << typeS << ".write(" << stream << ", " << v << ");";
+ out << nl << typeS << ".ice_write(" << stream << ", " << v << ");";
}
}
else
@@ -1818,7 +1818,7 @@ Slice::JavaCompatGenerator::writeMarshalUnmarshalCode(Output& out,
}
out << nl << typeS << " tmpOpt = new " << typeS << "();";
- out << nl << "tmpOpt.read(" << stream << ");";
+ out << nl << "tmpOpt.ice_readMembers(" << stream << ");";
out << nl << v << ".set(tmpOpt);";
out << eb;
@@ -1841,11 +1841,11 @@ Slice::JavaCompatGenerator::writeMarshalUnmarshalCode(Output& out,
{
out << nl << stream << ".skipSize();";
}
- out << nl << v << " = " << typeS << ".read(" << stream << ", " << v << ");";
+ out << nl << v << " = " << typeS << ".ice_read(" << stream << ", " << v << ");";
}
else
{
- out << nl << v << " = " << typeS << ".read(" << stream << ", " << v << ");";
+ out << nl << v << " = " << typeS << ".ice_read(" << stream << ", " << v << ");";
}
}
return;
@@ -1864,20 +1864,20 @@ Slice::JavaCompatGenerator::writeMarshalUnmarshalCode(Output& out,
out << nl << "if(" << v << " != null && " << v << ".isSet() && " << stream << ".writeOptional("
<< tag << ", " << getOptionalFormat(type) << "))";
out << sb;
- out << nl << typeS << ".write(" << stream << ", " << v << ".get());";
+ out << nl << typeS << ".ice_write(" << stream << ", " << v << ".get());";
out << eb;
}
else
{
out << nl << "if(" << stream << ".writeOptional(" << tag << ", " << getOptionalFormat(type) << "))";
out << sb;
- out << nl << typeS << ".write(" << stream << ", " << v << ");";
+ out << nl << typeS << ".ice_write(" << stream << ", " << v << ");";
out << eb;
}
}
else
{
- out << nl << typeS << ".write(" << stream << ", " << v << ");";
+ out << nl << typeS << ".ice_write(" << stream << ", " << v << ");";
}
}
else
@@ -1886,7 +1886,7 @@ Slice::JavaCompatGenerator::writeMarshalUnmarshalCode(Output& out,
{
out << nl << "if(" << stream << ".readOptional(" << tag << ", " << getOptionalFormat(type) << "))";
out << sb;
- out << nl << v << ".set(" << typeS << ".read(" << stream << "));";
+ out << nl << v << ".set(" << typeS << ".ice_read(" << stream << "));";
out << eb;
if(mode == OptionalOutParam)
{
@@ -1898,7 +1898,7 @@ Slice::JavaCompatGenerator::writeMarshalUnmarshalCode(Output& out,
}
else
{
- out << nl << v << " = " << typeS << ".read(" << stream << ");";
+ out << nl << v << " = " << typeS << ".ice_read(" << stream << ");";
}
}
return;
@@ -4140,13 +4140,13 @@ Slice::JavaGenerator::writeMarshalUnmarshalCode(Output& out,
if(st->isVariableLength())
{
out << nl << "int pos = " << stream << ".startSize();";
- out << nl << typeS << ".write(" << stream << ", " << val << ");";
+ out << nl << typeS << ".ice_write(" << stream << ", " << val << ");";
out << nl << stream << ".endSize(pos);";
}
else
{
out << nl << stream << ".writeSize(" << st->minWireSize() << ");";
- out << nl << typeS << ".write(" << stream << ", " << val << ");";
+ out << nl << typeS << ".ice_write(" << stream << ", " << val << ");";
}
if(optionalParam)
{
@@ -4155,7 +4155,7 @@ Slice::JavaGenerator::writeMarshalUnmarshalCode(Output& out,
}
else
{
- out << nl << typeS << ".write(" << stream << ", " << param << ");";
+ out << nl << typeS << ".ice_write(" << stream << ", " << param << ");";
}
}
else
@@ -4174,7 +4174,7 @@ Slice::JavaGenerator::writeMarshalUnmarshalCode(Output& out,
out << nl << stream << ".skipSize();";
}
- out << nl << param << " = java.util.Optional.of(" << typeS << ".read(" << stream
+ out << nl << param << " = java.util.Optional.of(" << typeS << ".ice_read(" << stream
<< ", null));";
out << eb;
@@ -4193,11 +4193,11 @@ Slice::JavaGenerator::writeMarshalUnmarshalCode(Output& out,
{
out << nl << stream << ".skipSize();";
}
- out << nl << param << " = " << typeS << ".read(" << stream << ", " << param << ");";
+ out << nl << param << " = " << typeS << ".ice_read(" << stream << ", " << param << ");";
}
else
{
- out << nl << param << " = " << typeS << ".read(" << stream << ", " << param << ");";
+ out << nl << param << " = " << typeS << ".ice_read(" << stream << ", " << param << ");";
}
}
return;
@@ -4216,20 +4216,20 @@ Slice::JavaGenerator::writeMarshalUnmarshalCode(Output& out,
out << nl << "if(" << param << " != null && " << param << ".isPresent() && " << stream
<< ".writeOptional(" << tag << ", " << getOptionalFormat(type) << "))";
out << sb;
- out << nl << typeS << ".write(" << stream << ", " << param << ".get());";
+ out << nl << typeS << ".ice_write(" << stream << ", " << param << ".get());";
out << eb;
}
else
{
out << nl << "if(" << stream << ".writeOptional(" << tag << ", " << getOptionalFormat(type) << "))";
out << sb;
- out << nl << typeS << ".write(" << stream << ", " << param << ");";
+ out << nl << typeS << ".ice_write(" << stream << ", " << param << ");";
out << eb;
}
}
else
{
- out << nl << typeS << ".write(" << stream << ", " << param << ");";
+ out << nl << typeS << ".ice_write(" << stream << ", " << param << ");";
}
}
else
@@ -4238,7 +4238,7 @@ Slice::JavaGenerator::writeMarshalUnmarshalCode(Output& out,
{
out << nl << "if(" << stream << ".readOptional(" << tag << ", " << getOptionalFormat(type) << "))";
out << sb;
- out << nl << param << " = java.util.Optional.of(" << typeS << ".read(" << stream << "));";
+ out << nl << param << " = java.util.Optional.of(" << typeS << ".ice_read(" << stream << "));";
out << eb;
out << nl << "else";
out << sb;
@@ -4247,7 +4247,7 @@ Slice::JavaGenerator::writeMarshalUnmarshalCode(Output& out,
}
else
{
- out << nl << param << " = " << typeS << ".read(" << stream << ");";
+ out << nl << param << " = " << typeS << ".ice_read(" << stream << ");";
}
}
return;
diff --git a/cpp/src/slice2cs/CsUtil.cpp b/cpp/src/slice2cs/CsUtil.cpp
index a9ac2f94042..af0e5305b70 100644
--- a/cpp/src/slice2cs/CsUtil.cpp
+++ b/cpp/src/slice2cs/CsUtil.cpp
@@ -688,22 +688,22 @@ Slice::CsGenerator::writeMarshalUnmarshalCode(Output &out,
{
if(!isValueType(st))
{
- out << nl << typeToString(st) << ".write(" << stream << ", " << param << ");";
+ out << nl << typeToString(st) << ".ice_write(" << stream << ", " << param << ");";
}
else
{
- out << nl << param << ".iceWrite(" << stream << ");";
+ out << nl << param << ".ice_writeMembers(" << stream << ");";
}
}
else
{
if(!isValueType(st))
{
- out << nl << param << " = " << typeToString(type) << ".read(" << stream << ");";
+ out << nl << param << " = " << typeToString(type) << ".ice_read(" << stream << ");";
}
else
{
- out << nl << param << ".iceRead(" << stream << ");";
+ out << nl << param << ".ice_readMembers(" << stream << ");";
}
}
return;
@@ -1542,7 +1542,7 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out,
}
}
call += ".";
- call += "iceWrite";
+ call += "ice_writeMembers";
call += "(" + stream + ");";
out << nl << call;
out << eb;
@@ -1587,12 +1587,12 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out,
{
out << nl << v << "[ix] = new " << typeS << "();";
}
- out << nl << v << "[ix].iceRead(" << stream << ");";
+ out << nl << v << "[ix].ice_readMembers(" << stream << ");";
}
else
{
out << nl << typeS << " val = new " << typeS << "();";
- out << nl << "val.iceRead(" << stream << ");";
+ out << nl << "val.ice_readMembers(" << stream << ");";
out << nl << param << "." << addMethod << "(val);";
}
out << eb;
diff --git a/cpp/src/slice2cs/Gen.cpp b/cpp/src/slice2cs/Gen.cpp
index ac2a5eb988b..a614e7e73a9 100644
--- a/cpp/src/slice2cs/Gen.cpp
+++ b/cpp/src/slice2cs/Gen.cpp
@@ -111,10 +111,25 @@ emitDeprecate(const ContainedPtr& p1, const ContainedPtr& p2, Output& out, const
}
}
-template<class List>
-string getEscapedParamName(const List& params, const string& name)
+string
+getEscapedParamName(const OperationPtr& p, const string& name)
+{
+ ParamDeclList params = p->parameters();
+
+ for(ParamDeclList::const_iterator i = params.begin(); i != params.end(); ++i)
+ {
+ if((*i)->name() == name)
+ {
+ return name + "_";
+ }
+ }
+ return name;
+}
+
+string
+getEscapedParamName(const DataMemberList& params, const string& name)
{
- for(typename List::const_iterator i = params.begin(); i != params.end(); ++i)
+ for(DataMemberList::const_iterator i = params.begin(); i != params.end(); ++i)
{
if((*i)->name() == name)
{
@@ -312,21 +327,29 @@ Slice::CsVisitor::writePostUnmarshalParams(const ParamDeclList& params, const Op
}
void
-Slice::CsVisitor::writeMarshalDataMember(const DataMemberPtr& member, const string& name, const string& customStream)
+Slice::CsVisitor::writeMarshalDataMember(const DataMemberPtr& member, const string& name, bool forStruct)
{
if(member->optional())
{
- writeOptionalMarshalUnmarshalCode(_out, member->type(), name, member->tag(), true, customStream);
+ assert(!forStruct);
+ writeOptionalMarshalUnmarshalCode(_out, member->type(), name, member->tag(), true, "ostr_");
}
else
{
- writeMarshalUnmarshalCode(_out, member->type(), name, true, customStream);
+ string stream = forStruct ? "" : "ostr_";
+ string memberName = fixId(member->name());
+ if(forStruct)
+ {
+ memberName = "this." + memberName;
+ }
+
+ writeMarshalUnmarshalCode(_out, member->type(), name, true, stream);
}
}
void
Slice::CsVisitor::writeUnmarshalDataMember(const DataMemberPtr& member, const string& name, bool needPatcher,
- int& patchIter, const string& customStream)
+ int& patchIter, bool forStruct)
{
const bool classType = isClassType(member->type());
@@ -345,12 +368,21 @@ Slice::CsVisitor::writeUnmarshalDataMember(const DataMemberPtr& member, const st
if(member->optional())
{
+ assert(!forStruct);
+
writeOptionalMarshalUnmarshalCode(_out, member->type(), classType ? patcher : name, member->tag(), false,
- customStream);
+ "istr_");
}
else
{
- writeMarshalUnmarshalCode(_out, member->type(), classType ? patcher : name, false, customStream);
+ string stream = forStruct ? "" : "istr_";
+ string memberName = fixId(member->name());
+ if(forStruct)
+ {
+ memberName = "this." + memberName;
+ }
+
+ writeMarshalUnmarshalCode(_out, member->type(), classType ? patcher : name, false, stream);
}
}
@@ -822,12 +854,12 @@ Slice::CsVisitor::writeMarshaling(const ClassDefPtr& p)
{
if(!(*d)->optional())
{
- writeMarshalDataMember(*d, fixId(*d, DotNet::ICloneable, true), "ostr_");
+ writeMarshalDataMember(*d, fixId(*d, DotNet::ICloneable, true));
}
}
for(DataMemberList::const_iterator d = optionalMembers.begin(); d != optionalMembers.end(); ++d)
{
- writeMarshalDataMember(*d, fixId(*d, DotNet::ICloneable, true), "ostr_");
+ writeMarshalDataMember(*d, fixId(*d, DotNet::ICloneable, true));
}
_out << nl << "ostr_.endSlice();";
if(base)
@@ -986,12 +1018,12 @@ Slice::CsVisitor::writeMarshaling(const ClassDefPtr& p)
{
if(!(*d)->optional())
{
- writeUnmarshalDataMember(*d, fixId(*d, DotNet::ICloneable, true), needCustomPatcher, patchIter, "istr_");
+ writeUnmarshalDataMember(*d, fixId(*d, DotNet::ICloneable, true), needCustomPatcher, patchIter);
}
}
for(DataMemberList::const_iterator d = optionalMembers.begin(); d != optionalMembers.end(); ++d)
{
- writeUnmarshalDataMember(*d, fixId(*d, DotNet::ICloneable, true), needCustomPatcher, patchIter, "istr_");
+ writeUnmarshalDataMember(*d, fixId(*d, DotNet::ICloneable, true), needCustomPatcher, patchIter);
}
_out << nl << "istr_.endSlice();";
if(base)
@@ -1154,9 +1186,9 @@ Slice::CsVisitor::getDispatchParams(const OperationPtr& op, string& retS, vector
retS = typeToString(op->returnType(), op->returnIsOptional());
}
- string current = getEscapedParamName(paramDecls, "current");
- params.push_back("Ice.Current " + current + " = null");
- args.push_back(current);
+ string currentParamName = getEscapedParamName(op, "current");
+ params.push_back("Ice.Current " + currentParamName + " = null");
+ args.push_back(currentParamName);
return name;
}
@@ -2577,8 +2609,8 @@ Slice::Gen::TypesVisitor::visitOperation(const OperationPtr& p)
}
_out << taskResultType(p);
- string progress = getEscapedParamName(inParamDecls, "progress");
- string cancel = getEscapedParamName(inParamDecls, "cancel");
+ string progress = getEscapedParamName(p, "progress");
+ string cancel = getEscapedParamName(p, "cancel");
_out << " " << name << "Async" << spar << inParams
<< ("_System.IProgress<bool> " + progress + " = null")
@@ -2597,8 +2629,8 @@ Slice::Gen::TypesVisitor::visitOperation(const OperationPtr& p)
_out << "public abstract ";
}
_out << "Ice.AsyncResult begin_" << name << spar << inParams
- << "Ice.AsyncCallback " + getEscapedParamName(inParamDecls, "callback") + " = null"
- << "object " + getEscapedParamName(inParamDecls, "cookie") + " = null" << epar << ';';
+ << "Ice.AsyncCallback " + getEscapedParamName(p, "callback") + " = null"
+ << "object " + getEscapedParamName(p, "cookie") + " = null" << epar << ';';
_out << sp;
emitAttributes(p);
@@ -2609,7 +2641,7 @@ Slice::Gen::TypesVisitor::visitOperation(const OperationPtr& p)
_out << "public abstract ";
}
_out << retS << " end_" << name << spar << getOutParams(p, false, true)
- << "Ice.AsyncResult " + getEscapedParamName(p->outParameters(), "asyncResult") << epar << ';';
+ << "Ice.AsyncResult " + getEscapedParamName(p, "asyncResult") << epar << ';';
}
}
}
@@ -2930,7 +2962,7 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p)
_out << nl << "ostr_.startSlice(\"" << scoped << "\", -1, " << (!base ? "true" : "false") << ");";
for(DataMemberList::const_iterator q = dataMembers.begin(); q != dataMembers.end(); ++q)
{
- writeMarshalDataMember(*q, fixId((*q)->name(), DotNet::Exception), "ostr_");
+ writeMarshalDataMember(*q, fixId((*q)->name(), DotNet::Exception));
}
_out << nl << "ostr_.endSlice();";
if(base)
@@ -3095,7 +3127,7 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p)
const bool needCustomPatcher = classMembers.size() > 1;
for(DataMemberList::const_iterator q = dataMembers.begin(); q != dataMembers.end(); ++q)
{
- writeUnmarshalDataMember(*q, fixId((*q)->name(), DotNet::Exception), needCustomPatcher, patchIter, "istr_");
+ writeUnmarshalDataMember(*q, fixId((*q)->name(), DotNet::Exception), needCustomPatcher, patchIter);
}
_out << nl << "istr_.endSlice();";
if(base)
@@ -3326,11 +3358,11 @@ Slice::Gen::TypesVisitor::visitStructEnd(const StructPtr& p)
_out << sp;
emitGeneratedCodeAttribute();
- _out << nl << "public void iceWrite(Ice.OutputStream ostr_)";
+ _out << nl << "public void ice_writeMembers(Ice.OutputStream ostr)";
_out << sb;
for(DataMemberList::const_iterator q = dataMembers.begin(); q != dataMembers.end(); ++q)
{
- writeMarshalDataMember(*q, fixId(*q, isClass ? DotNet::ICloneable : 0), "ostr_");
+ writeMarshalDataMember(*q, fixId(*q, isClass ? DotNet::ICloneable : 0), true);
}
_out << eb;
@@ -3411,44 +3443,44 @@ Slice::Gen::TypesVisitor::visitStructEnd(const StructPtr& p)
_out << sp;
emitGeneratedCodeAttribute();
- _out << nl << "public void iceRead(Ice.InputStream istr_)";
+ _out << nl << "public void ice_readMembers(Ice.InputStream istr)";
_out << sb;
int patchIter = 0;
const bool needCustomPatcher = classMembers.size() > 1;
for(DataMemberList::const_iterator q = dataMembers.begin(); q != dataMembers.end(); ++q)
{
writeUnmarshalDataMember(*q, fixId(*q, isClass ? DotNet::ICloneable : 0), needCustomPatcher,
- patchIter, "istr_");
+ patchIter, true);
}
_out << eb;
_out << sp;
emitGeneratedCodeAttribute();
- _out << nl << "public static void write(Ice.OutputStream ostr, " << name << " v)";
+ _out << nl << "public static void ice_write(Ice.OutputStream ostr, " << name << " v)";
_out << sb;
if(isClass)
{
_out << nl << "if(v == null)";
_out << sb;
- _out << nl << "_nullMarshalValue.iceWrite(ostr);";
+ _out << nl << "_nullMarshalValue.ice_writeMembers(ostr);";
_out << eb;
_out << nl << "else";
_out << sb;
- _out << nl << "v.iceWrite(ostr);";
+ _out << nl << "v.ice_writeMembers(ostr);";
_out << eb;
}
else
{
- _out << nl << "v.iceWrite(ostr);";
+ _out << nl << "v.ice_writeMembers(ostr);";
}
_out << eb;
_out << sp;
emitGeneratedCodeAttribute();
- _out << nl << "public static " << name << " read(Ice.InputStream istr)";
+ _out << nl << "public static " << name << " ice_read(Ice.InputStream istr)";
_out << sb;
- _out << nl << name << " v = new " << name << "();";
- _out << nl << "v.iceRead(istr);";
+ _out << nl << "var v = new " << name << "();";
+ _out << nl << "v.ice_readMembers(istr);";
_out << nl << "return v;";
_out << eb;
@@ -3972,7 +4004,7 @@ Slice::Gen::ProxyVisitor::visitOperation(const OperationPtr& p)
//
// Write the synchronous version of the operation.
//
- string context = getEscapedParamName(p->parameters(), "context");
+ string context = getEscapedParamName(p, "context");
_out << sp;
writeDocComment(p, deprecateReason,
"<param name=\"" + context + " \">The Context map to send with the invocation.</param>");
@@ -3988,9 +4020,9 @@ Slice::Gen::ProxyVisitor::visitOperation(const OperationPtr& p)
//
// Write the async version of the operation (using Async Task API)
//
- string context = getEscapedParamName(inParamDecls, "context");
- string cancel = getEscapedParamName(inParamDecls, "cancel");
- string progress = getEscapedParamName(inParamDecls, "progress");
+ string context = getEscapedParamName(p, "context");
+ string cancel = getEscapedParamName(p, "cancel");
+ string progress = getEscapedParamName(p, "progress");
_out << sp;
writeDocCommentTaskAsyncAMI(p, deprecateReason,
@@ -4016,10 +4048,10 @@ Slice::Gen::ProxyVisitor::visitOperation(const OperationPtr& p)
string clScope = fixId(cl->scope());
string delType = clScope + "Callback_" + cl->name() + "_" + p->name();
- string context = getEscapedParamName(inParamDecls, "context");
- string callback = getEscapedParamName(inParamDecls, "callback");
- string cookie = getEscapedParamName(inParamDecls, "cookie");
- string asyncResult = getEscapedParamName(p->outParameters(), "asyncResult");
+ string context = getEscapedParamName(p, "context");
+ string callback = getEscapedParamName(p, "callback");
+ string cookie = getEscapedParamName(p, "cookie");
+ string asyncResult = getEscapedParamName(p, "asyncResult");
_out << sp;
writeDocCommentAMI(p, InParam, deprecateReason,
@@ -4320,7 +4352,7 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p)
throws.sort(Slice::DerivedToBaseCompare());
#endif
- string context = getEscapedParamName(op->parameters(), "context");
+ string context = getEscapedParamName(op, "context");
_out << sp;
_out << nl << "public " << retS << " " << opName << spar << params
@@ -4402,9 +4434,9 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p)
ParamDeclList inParams = op->inParameters();
ParamDeclList outParams = op->outParameters();
- string context = getEscapedParamName(inParams, "context");
- string cancel = getEscapedParamName(inParams, "cancel");
- string progress = getEscapedParamName(inParams, "progress");
+ string context = getEscapedParamName(op, "context");
+ string cancel = getEscapedParamName(op, "cancel");
+ string progress = getEscapedParamName(op, "progress");
TypePtr ret = op->returnType();
@@ -4636,9 +4668,9 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p)
//
string delType = clScope + "Callback_" + cl->name() + "_" + op->name();
- string context = getEscapedParamName(inParams, "context");
- string callback = getEscapedParamName(inParams, "callback");
- string cookie = getEscapedParamName(inParams, "cookie");
+ string context = getEscapedParamName(op, "context");
+ string callback = getEscapedParamName(op, "callback");
+ string cookie = getEscapedParamName(op, "cookie");
_out << sp;
_out << nl << "public Ice.AsyncResult<" << delType << "> begin_" << opName << spar << paramsAMI
@@ -4669,7 +4701,7 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p)
// Write the end_ method.
//
string flatName = "_" + opName + "_name";
- string asyncResult = getEscapedParamName(outParams, "asyncResult");
+ string asyncResult = getEscapedParamName(op, "asyncResult");
_out << sp << nl << "public " << retS << " end_" << opName << spar << getOutParams(op, false, true)
<< "Ice.AsyncResult " + asyncResult << epar;
diff --git a/cpp/src/slice2cs/Gen.h b/cpp/src/slice2cs/Gen.h
index d4de81b812c..d061616693d 100644
--- a/cpp/src/slice2cs/Gen.h
+++ b/cpp/src/slice2cs/Gen.h
@@ -28,8 +28,8 @@ protected:
void writeMarshalUnmarshalParams(const ParamDeclList&, const OperationPtr&, bool, bool = false,
bool = false, const std::string& = "");
void writePostUnmarshalParams(const ParamDeclList&, const OperationPtr&);
- void writeMarshalDataMember(const DataMemberPtr&, const std::string&, const std::string& = "");
- void writeUnmarshalDataMember(const DataMemberPtr&, const std::string&, bool, int&, const std::string& = "");
+ void writeMarshalDataMember(const DataMemberPtr&, const std::string&, bool = false);
+ void writeUnmarshalDataMember(const DataMemberPtr&, const std::string&, bool, int&, bool = false);
virtual void writeInheritedOperations(const ClassDefPtr&);
virtual void writeDispatch(const ClassDefPtr&);
diff --git a/cpp/src/slice2java/Gen.cpp b/cpp/src/slice2java/Gen.cpp
index 0e196df0626..d91af385c73 100644
--- a/cpp/src/slice2java/Gen.cpp
+++ b/cpp/src/slice2java/Gen.cpp
@@ -3320,7 +3320,7 @@ Slice::Gen::TypesVisitor::visitStructEnd(const StructPtr& p)
if(!p->isLocal())
{
- out << sp << nl << "public void write(com.zeroc.Ice.OutputStream ostr)";
+ out << sp << nl << "public void ice_writeMembers(com.zeroc.Ice.OutputStream ostr)";
out << sb;
iter = 0;
for(DataMemberList::const_iterator d = members.begin(); d != members.end(); ++d)
@@ -3331,7 +3331,7 @@ Slice::Gen::TypesVisitor::visitStructEnd(const StructPtr& p)
DataMemberList classMembers = p->classDataMembers();
- out << sp << nl << "public void read(com.zeroc.Ice.InputStream istr)";
+ out << sp << nl << "public void ice_readMembers(com.zeroc.Ice.InputStream istr)";
out << sb;
iter = 0;
for(DataMemberList::const_iterator d = members.begin(); d != members.end(); ++d)
@@ -3340,25 +3340,25 @@ Slice::Gen::TypesVisitor::visitStructEnd(const StructPtr& p)
}
out << eb;
- out << sp << nl << "static public void write(com.zeroc.Ice.OutputStream ostr, " << name << " v)";
+ out << sp << nl << "static public void ice_write(com.zeroc.Ice.OutputStream ostr, " << name << " v)";
out << sb;
out << nl << "if(v == null)";
out << sb;
- out << nl << "_nullMarshalValue.write(ostr);";
+ out << nl << "_nullMarshalValue.ice_writeMembers(ostr);";
out << eb;
out << nl << "else";
out << sb;
- out << nl << "v.write(ostr);";
+ out << nl << "v.ice_writeMembers(ostr);";
out << eb;
out << eb;
- out << sp << nl << "static public " << name << " read(com.zeroc.Ice.InputStream istr, " << name << " v)";
+ out << sp << nl << "static public " << name << " ice_read(com.zeroc.Ice.InputStream istr, " << name << " v)";
out << sb;
out << nl << "if(v == null)";
out << sb;
out << nl << " v = new " << name << "();";
out << eb;
- out << nl << "v.read(istr);";
+ out << nl << "v.ice_readMembers(istr);";
out << nl << "return v;";
out << eb;
@@ -3821,12 +3821,12 @@ Slice::Gen::TypesVisitor::visitEnum(const EnumPtr& p)
if(!p->isLocal())
{
- out << sp << nl << "public void write(com.zeroc.Ice.OutputStream ostr)";
+ out << sp << nl << "public void ice_write(com.zeroc.Ice.OutputStream ostr)";
out << sb;
out << nl << "ostr.writeEnum(_value, " << p->maxValue() << ");";
out << eb;
- out << sp << nl << "public static void write(com.zeroc.Ice.OutputStream ostr, " << name << " v)";
+ out << sp << nl << "public static void ice_write(com.zeroc.Ice.OutputStream ostr, " << name << " v)";
out << sb;
out << nl << "if(v == null)";
out << sb;
@@ -3839,7 +3839,7 @@ Slice::Gen::TypesVisitor::visitEnum(const EnumPtr& p)
out << eb;
out << eb;
- out << sp << nl << "public static " << name << " read(com.zeroc.Ice.InputStream istr)";
+ out << sp << nl << "public static " << name << " ice_read(com.zeroc.Ice.InputStream istr)";
out << sb;
out << nl << "int v = istr.readEnum(" << p->maxValue() << ");";
out << nl << "return validate(v);";
diff --git a/cpp/src/slice2java/GenCompat.cpp b/cpp/src/slice2java/GenCompat.cpp
index d5894291f3e..a2347ae3b08 100644
--- a/cpp/src/slice2java/GenCompat.cpp
+++ b/cpp/src/slice2java/GenCompat.cpp
@@ -3689,7 +3689,7 @@ Slice::GenCompat::TypesVisitor::visitStructEnd(const StructPtr& p)
if(!p->isLocal())
{
- out << sp << nl << "public void" << nl << "write(Ice.OutputStream ostr)";
+ out << sp << nl << "public void" << nl << "ice_writeMembers(Ice.OutputStream ostr)";
out << sb;
iter = 0;
for(DataMemberList::const_iterator d = members.begin(); d != members.end(); ++d)
@@ -3705,7 +3705,7 @@ Slice::GenCompat::TypesVisitor::visitStructEnd(const StructPtr& p)
writePatcher(out, package, classMembers, DataMemberList());
}
- out << sp << nl << "public void" << nl << "read(Ice.InputStream istr)";
+ out << sp << nl << "public void" << nl << "ice_readMembers(Ice.InputStream istr)";
out << sb;
iter = 0;
int patchIter = 0;
@@ -3716,25 +3716,25 @@ Slice::GenCompat::TypesVisitor::visitStructEnd(const StructPtr& p)
}
out << eb;
- out << sp << nl << "static public void" << nl << "write(Ice.OutputStream ostr, " << name << " v)";
+ out << sp << nl << "static public void" << nl << "ice_write(Ice.OutputStream ostr, " << name << " v)";
out << sb;
out << nl << "if(v == null)";
out << sb;
- out << nl << "_nullMarshalValue.write(ostr);";
+ out << nl << "_nullMarshalValue.ice_writeMembers(ostr);";
out << eb;
out << nl << "else";
out << sb;
- out << nl << "v.write(ostr);";
+ out << nl << "v.ice_writeMembers(ostr);";
out << eb;
out << eb;
- out << sp << nl << "static public " << name << nl << "read(Ice.InputStream istr, " << name << " v)";
+ out << sp << nl << "static public " << name << nl << "ice_read(Ice.InputStream istr, " << name << " v)";
out << sb;
out << nl << "if(v == null)";
out << sb;
out << nl << " v = new " << name << "();";
out << eb;
- out << nl << "v.read(istr);";
+ out << nl << "v.ice_readMembers(istr);";
out << nl << "return v;";
out << eb;
@@ -4104,12 +4104,12 @@ Slice::GenCompat::TypesVisitor::visitEnum(const EnumPtr& p)
if(!p->isLocal())
{
- out << sp << nl << "public void write(Ice.OutputStream ostr)";
+ out << sp << nl << "public void ice_write(Ice.OutputStream ostr)";
out << sb;
out << nl << "ostr.writeEnum(_value, " << p->maxValue() << ");";
out << eb;
- out << sp << nl << "public static void write(Ice.OutputStream ostr, " << name << " v)";
+ out << sp << nl << "public static void ice_write(Ice.OutputStream ostr, " << name << " v)";
out << sb;
out << nl << "if(v == null)";
out << sb;
@@ -4122,7 +4122,7 @@ Slice::GenCompat::TypesVisitor::visitEnum(const EnumPtr& p)
out << eb;
out << eb;
- out << sp << nl << "public static " << name << " read(Ice.InputStream istr)";
+ out << sp << nl << "public static " << name << " ice_read(Ice.InputStream istr)";
out << sb;
out << nl << "int v = istr.readEnum(" << p->maxValue() << ");";
out << nl << "return validate(v);";