diff options
author | Bernard Normier <bernard@zeroc.com> | 2016-11-10 14:07:23 -0500 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2016-11-10 14:07:23 -0500 |
commit | 4e06be13bf710ec95f5d207c59b90a0584b857b4 (patch) | |
tree | 5bff3948e1c2db2809ac03ef8f4aa8ba14d03c3f | |
parent | Visual Studio settings for C++/C# languages (diff) | |
download | ice-4e06be13bf710ec95f5d207c59b90a0584b857b4.tar.bz2 ice-4e06be13bf710ec95f5d207c59b90a0584b857b4.tar.xz ice-4e06be13bf710ec95f5d207c59b90a0584b857b4.zip |
Replaced all double-underscores in C#
43 files changed, 1449 insertions, 1408 deletions
diff --git a/cpp/src/slice2cs/CsUtil.cpp b/cpp/src/slice2cs/CsUtil.cpp index 3487cde3fce..a9ac2f94042 100644 --- a/cpp/src/slice2cs/CsUtil.cpp +++ b/cpp/src/slice2cs/CsUtil.cpp @@ -145,7 +145,7 @@ Slice::CsGenerator::fixId(const ContainedPtr& cont, int baseTypes, bool mangleCa if(contained && contained->hasMetaData("clr:property") && (contained->containedType() == Contained::ContainedTypeClass || contained->containedType() == Contained::ContainedTypeStruct)) { - return cont->name() + "__prop"; + return "_" + cont->name(); } else { @@ -507,9 +507,14 @@ void Slice::CsGenerator::writeMarshalUnmarshalCode(Output &out, const TypePtr& type, const string& param, - bool marshal) + bool marshal, + const string& customStream) { - string stream = marshal ? "os__" : "is__"; + string stream = customStream; + if(stream.empty()) + { + stream = marshal ? "ostr" : "istr"; + } BuiltinPtr builtin = BuiltinPtr::dynamicCast(type); if(builtin) @@ -687,7 +692,7 @@ Slice::CsGenerator::writeMarshalUnmarshalCode(Output &out, } else { - out << nl << param << ".write__(" << stream << ");"; + out << nl << param << ".iceWrite(" << stream << ");"; } } else @@ -698,7 +703,7 @@ Slice::CsGenerator::writeMarshalUnmarshalCode(Output &out, } else { - out << nl << param << ".read__(" << stream << ");"; + out << nl << param << ".iceRead(" << stream << ");"; } } return; @@ -722,7 +727,7 @@ Slice::CsGenerator::writeMarshalUnmarshalCode(Output &out, SequencePtr seq = SequencePtr::dynamicCast(type); if(seq) { - writeSequenceMarshalUnmarshalCode(out, seq, param, marshal, true); + writeSequenceMarshalUnmarshalCode(out, seq, param, marshal, true, stream); return; } @@ -752,9 +757,14 @@ Slice::CsGenerator::writeOptionalMarshalUnmarshalCode(Output &out, const TypePtr& type, const string& param, int tag, - bool marshal) + bool marshal, + const string& customStream) { - string stream = marshal ? "os__" : "is__"; + string stream = customStream; + if(stream.empty()) + { + stream = marshal ? "ostr" : "istr"; + } BuiltinPtr builtin = BuiltinPtr::dynamicCast(type); if(builtin) @@ -901,9 +911,9 @@ Slice::CsGenerator::writeOptionalMarshalUnmarshalCode(Output &out, out << nl << "if(" << param << ".HasValue && " << stream << ".writeOptional(" << tag << ", Ice.OptionalFormat.FSize))"; out << sb; - out << nl << "int pos__ = " << stream << ".startSize();"; - writeMarshalUnmarshalCode(out, type, param + ".Value", marshal); - out << nl << stream << ".endSize(pos__);"; + out << nl << "int pos = " << stream << ".startSize();"; + writeMarshalUnmarshalCode(out, type, param + ".Value", marshal, customStream); + out << nl << stream << ".endSize(pos);"; out << eb; } else @@ -911,10 +921,10 @@ Slice::CsGenerator::writeOptionalMarshalUnmarshalCode(Output &out, out << nl << "if(" << stream << ".readOptional(" << tag << ", Ice.OptionalFormat.FSize))"; out << sb; out << nl << stream << ".skip(4);"; - string tmp = "tmpVal__"; + string tmp = "tmpVal"; string typeS = typeToString(type); out << nl << typeS << ' ' << tmp << ';'; - writeMarshalUnmarshalCode(out, type, tmp, marshal); + writeMarshalUnmarshalCode(out, type, tmp, marshal, customStream); out << nl << param << " = new Ice.Optional<" << typeS << ">(" << tmp << ");"; out << eb; out << nl << "else"; @@ -949,16 +959,16 @@ Slice::CsGenerator::writeOptionalMarshalUnmarshalCode(Output &out, out << sb; if(st->isVariableLength()) { - out << nl << "int pos__ = " << stream << ".startSize();"; + out << nl << "int pos = " << stream << ".startSize();"; } else { out << nl << stream << ".writeSize(" << st->minWireSize() << ");"; } - writeMarshalUnmarshalCode(out, type, param + ".Value", marshal); + writeMarshalUnmarshalCode(out, type, param + ".Value", marshal, customStream); if(st->isVariableLength()) { - out << nl << stream << ".endSize(pos__);"; + out << nl << stream << ".endSize(pos);"; } out << eb; } @@ -975,7 +985,7 @@ Slice::CsGenerator::writeOptionalMarshalUnmarshalCode(Output &out, out << nl << stream << ".skipSize();"; } string typeS = typeToString(type); - string tmp = "tmpVal__"; + string tmp = "tmpVal"; if(isValueType(st)) { out << nl << typeS << ' ' << tmp << " = new " << typeS << "();"; @@ -984,7 +994,7 @@ Slice::CsGenerator::writeOptionalMarshalUnmarshalCode(Output &out, { out << nl << typeS << ' ' << tmp << " = null;"; } - writeMarshalUnmarshalCode(out, type, tmp, marshal); + writeMarshalUnmarshalCode(out, type, tmp, marshal, customStream); out << nl << param << " = new Ice.Optional<" << typeS << ">(" << tmp << ");"; out << eb; out << nl << "else"; @@ -1011,9 +1021,9 @@ Slice::CsGenerator::writeOptionalMarshalUnmarshalCode(Output &out, out << nl << "if(" << stream << ".readOptional(" << tag << ", Ice.OptionalFormat.Size))"; out << sb; string typeS = typeToString(type); - string tmp = "tmpVal__"; + string tmp = "tmpVal"; out << nl << typeS << ' ' << tmp << ';'; - writeMarshalUnmarshalCode(out, type, tmp, marshal); + writeMarshalUnmarshalCode(out, type, tmp, marshal, customStream); out << nl << param << " = new Ice.Optional<" << typeS << ">(" << tmp << ");"; out << eb; out << nl << "else"; @@ -1027,7 +1037,7 @@ Slice::CsGenerator::writeOptionalMarshalUnmarshalCode(Output &out, SequencePtr seq = SequencePtr::dynamicCast(type); if(seq) { - writeOptionalSequenceMarshalUnmarshalCode(out, seq, param, tag, marshal); + writeOptionalSequenceMarshalUnmarshalCode(out, seq, param, tag, marshal, stream); return; } @@ -1042,7 +1052,7 @@ Slice::CsGenerator::writeOptionalMarshalUnmarshalCode(Output &out, out << sb; if(keyType->isVariableLength() || valueType->isVariableLength()) { - out << nl << "int pos__ = " << stream << ".startSize();"; + out << nl << "int pos = " << stream << ".startSize();"; } else { @@ -1050,10 +1060,10 @@ Slice::CsGenerator::writeOptionalMarshalUnmarshalCode(Output &out, << (keyType->minWireSize() + valueType->minWireSize()) << " + (" << param << ".Value.Count > 254 ? 5 : 1));"; } - writeMarshalUnmarshalCode(out, type, param + ".Value", marshal); + writeMarshalUnmarshalCode(out, type, param + ".Value", marshal, customStream); if(keyType->isVariableLength() || valueType->isVariableLength()) { - out << nl << stream << ".endSize(pos__);"; + out << nl << stream << ".endSize(pos);"; } out << eb; } @@ -1070,9 +1080,9 @@ Slice::CsGenerator::writeOptionalMarshalUnmarshalCode(Output &out, out << nl << stream << ".skipSize();"; } string typeS = typeToString(type); - string tmp = "tmpVal__"; + string tmp = "tmpVal"; out << nl << typeS << ' ' << tmp << " = new " << typeS << "();"; - writeMarshalUnmarshalCode(out, type, tmp, marshal); + writeMarshalUnmarshalCode(out, type, tmp, marshal, customStream); out << nl << param << " = new Ice.Optional<" << typeS << ">(" << tmp << ");"; out << eb; out << nl << "else"; @@ -1087,9 +1097,14 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out, const SequencePtr& seq, const string& param, bool marshal, - bool useHelper) + bool useHelper, + const string& customStream) { - string stream = marshal ? "os__" : "is__"; + string stream = customStream; + if(stream.empty()) + { + stream = marshal ? "ostr" : "istr"; + } if(useHelper) { @@ -1175,30 +1190,30 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out, // cannot contain Ice.Object. // out << nl << "Ice.ObjectPrx[] " << param << "_tmp = " << param << ".ToArray();"; - out << nl << "for(int ix__ = 0; ix__ < " << param << "_tmp.Length; ++ix__)"; + out << nl << "for(int ix = 0; ix < " << param << "_tmp.Length; ++ix)"; out << sb; - out << nl << stream << ".writeProxy(" << param << "_tmp[ix__]);"; + out << nl << stream << ".writeProxy(" << param << "_tmp[ix]);"; out << eb; } else { out << nl << "_System.Collections.Generic.IEnumerator<" << typeS - << "> e__ = " << param << ".GetEnumerator();"; - out << nl << "while(e__.MoveNext())"; + << "> e = " << param << ".GetEnumerator();"; + out << nl << "while(e.MoveNext())"; out << sb; string func = (builtin->kind() == Builtin::KindObject || builtin->kind() == Builtin::KindValue) ? "writeValue" : "writeProxy"; - out << nl << stream << '.' << func << "(e__.Current);"; + out << nl << stream << '.' << func << "(e.Current);"; out << eb; } } else { - out << nl << "for(int ix__ = 0; ix__ < " << param << '.' << limitID << "; ++ix__)"; + out << nl << "for(int ix = 0; ix < " << param << '.' << limitID << "; ++ix)"; out << sb; string func = (builtin->kind() == Builtin::KindObject || builtin->kind() == Builtin::KindValue) ? "writeValue" : "writeProxy"; - out << nl << stream << '.' << func << '(' << param << "[ix__]);"; + out << nl << stream << '.' << func << '(' << param << "[ix]);"; out << eb; } out << eb; @@ -1231,7 +1246,7 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out, { out << typeToString(seq) << "(" << param << "_lenx);"; } - out << nl << "for(int ix__ = 0; ix__ < " << param << "_lenx; ++ix__)"; + out << nl << "for(int ix = 0; ix < " << param << "_lenx; ++ix)"; out << sb; string patcherName; if(isCustom) @@ -1250,9 +1265,9 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out, { patcherName = "Sequence"; } - out << nl << "IceInternal." << patcherName << "Patcher<Ice.Value> p__ = new IceInternal." - << patcherName << "Patcher<Ice.Value>(\"::Ice::Object\", " << param << ", ix__);"; - out << nl << stream << ".readValue(p__.patch);"; + out << nl << "IceInternal." << patcherName << "Patcher<Ice.Value> p = new IceInternal." + << patcherName << "Patcher<Ice.Value>(\"::Ice::Object\", " << param << ", ix);"; + out << nl << stream << ".readValue(p.patch);"; } else { @@ -1273,17 +1288,17 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out, { out << typeToString(seq) << "(" << param << "_lenx);"; } - out << nl << "for(int ix__ = 0; ix__ < " << param << "_lenx; ++ix__)"; + out << nl << "for(int ix = 0; ix < " << param << "_lenx; ++ix)"; out << sb; if(isArray) { - out << nl << param << "[ix__] = " << stream << ".readProxy();"; + out << nl << param << "[ix] = " << stream << ".readProxy();"; } else { - out << nl << "Ice.ObjectPrx val__ = new Ice.ObjectPrxHelperBase();"; - out << nl << "val__ = " << stream << ".readProxy();"; - out << nl << param << "." << addMethod << "(val__);"; + out << nl << "Ice.ObjectPrx val = new Ice.ObjectPrxHelperBase();"; + out << nl << "val = " << stream << ".readProxy();"; + out << nl << param << "." << addMethod << "(val);"; } } out << eb; @@ -1338,8 +1353,8 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out, out << sb; out << nl << param << " = new " << "global::" << genericType << "<" << typeToString(type) << ">();"; - out << nl << "int szx__ = " << stream << ".readSize();"; - out << nl << "for(int ix__ = 0; ix__ < szx__; ++ix__)"; + out << nl << "int szx = " << stream << ".readSize();"; + out << nl << "for(int ix = 0; ix < szx; ++ix)"; out << sb; out << nl << param << ".Add(" << stream << ".read" << func << "());"; out << eb; @@ -1376,17 +1391,17 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out, // stack bottom-up here. // out << nl << "_System.Collections.Generic.IEnumerator<" << typeS - << "> e__ = " << param << ".GetEnumerator();"; - out << nl << "while(e__.MoveNext())"; + << "> e = " << param << ".GetEnumerator();"; + out << nl << "while(e.MoveNext())"; out << sb; - out << nl << stream << ".writeValue(e__.Current);"; + out << nl << stream << ".writeValue(e.Current);"; out << eb; } else { - out << nl << "for(int ix__ = 0; ix__ < " << param << '.' << limitID << "; ++ix__)"; + out << nl << "for(int ix = 0; ix < " << param << '.' << limitID << "; ++ix)"; out << sb; - out << nl << stream << ".writeValue(" << param << "[ix__]);"; + out << nl << stream << ".writeValue(" << param << "[ix]);"; out << eb; } out << eb; @@ -1394,12 +1409,12 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out, else { out << sb; - out << nl << "int szx__ = " << stream << ".readAndCheckSeqSize(" + out << nl << "int szx = " << stream << ".readAndCheckSeqSize(" << static_cast<unsigned>(type->minWireSize()) << ");"; out << nl << param << " = new "; if(isArray) { - out << toArrayAlloc(typeS + "[]", "szx__"); + out << toArrayAlloc(typeS + "[]", "szx"); } else if(isCustom) { @@ -1410,16 +1425,16 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out, out << "_System.Collections.Generic." << genericType << "<" << typeS << ">("; if(!isLinkedList) { - out << "szx__"; + out << "szx"; } out << ")"; } else { - out << fixId(seq->scoped()) << "(szx__)"; + out << fixId(seq->scoped()) << "(szx)"; } out << ';'; - out << nl << "for(int ix__ = 0; ix__ < szx__; ++ix__)"; + out << nl << "for(int ix = 0; ix < szx; ++ix)"; out << sb; string patcherName; @@ -1441,7 +1456,7 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out, } string scoped = ContainedPtr::dynamicCast(type)->scoped(); out << nl << "IceInternal." << patcherName << "Patcher<" << typeS << "> spx = new IceInternal." - << patcherName << "Patcher<" << typeS << ">(\"" << scoped << "\", " << param << ", ix__);"; + << patcherName << "Patcher<" << typeS << ">(\"" << scoped << "\", " << param << ", ix);"; out << nl << stream << ".readValue(spx.patch);"; out << eb; out << eb; @@ -1469,18 +1484,18 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out, if(isStack) { out << nl << typeS << "[] " << param << "_tmp = " << param << ".ToArray();"; - out << nl << "for(int ix__ = 0; ix__ < " << param << "_tmp.Length; ++ix__)"; + out << nl << "for(int ix = 0; ix < " << param << "_tmp.Length; ++ix)"; } else { out << nl << "_System.Collections.Generic.IEnumerator<" << typeS - << "> e__ = " << param << ".GetEnumerator();"; - out << nl << "while(e__.MoveNext())"; + << "> e = " << param << ".GetEnumerator();"; + out << nl << "while(e.MoveNext())"; } } else { - out << nl << "for(int ix__ = 0; ix__ < " << param << '.' << limitID << "; ++ix__)"; + out << nl << "for(int ix = 0; ix < " << param << '.' << limitID << "; ++ix)"; } out << sb; string call; @@ -1488,12 +1503,12 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out, { if(isValueType(type)) { - call = "e__.Current"; + call = "e.Current"; } else { - call = "(e__.Current == null ? new "; - call += typeS + "() : e__.Current)"; + call = "(e.Current == null ? new "; + call += typeS + "() : e.Current)"; } } else @@ -1514,20 +1529,20 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out, { call += "_tmp"; } - call += "[ix__] == null ? new " + typeS + "() : " + param; + call += "[ix] == null ? new " + typeS + "() : " + param; if(isStack) { call += "_tmp"; } } - call += "[ix__]"; + call += "[ix]"; if(!isValueType(type)) { call += ")"; } } call += "."; - call += "write__"; + call += "iceWrite"; call += "(" + stream + ");"; out << nl << call; out << eb; @@ -1536,11 +1551,11 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out, else { out << sb; - out << nl << "int szx__ = " << stream << ".readAndCheckSeqSize(" + out << nl << "int szx = " << stream << ".readAndCheckSeqSize(" << static_cast<unsigned>(type->minWireSize()) << ");"; if(isArray) { - out << nl << param << " = new " << toArrayAlloc(typeS + "[]", "szx__") << ";"; + out << nl << param << " = new " << toArrayAlloc(typeS + "[]", "szx") << ";"; } else if(isCustom) { @@ -1548,44 +1563,44 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out, } else if(isStack) { - out << nl << typeS << "[] " << param << "__tmp = new " << toArrayAlloc(typeS + "[]", "szx__") << ";"; + out << nl << typeS << "[] " << param << "_tmp = new " << toArrayAlloc(typeS + "[]", "szx") << ";"; } else if(isGeneric) { out << nl << param << " = new _System.Collections.Generic." << genericType << "<" << typeS << ">("; if(!isLinkedList) { - out << "szx__"; + out << "szx"; } out << ");"; } else { - out << nl << param << " = new " << fixId(seq->scoped()) << "(szx__);"; + out << nl << param << " = new " << fixId(seq->scoped()) << "(szx);"; } - out << nl << "for(int ix__ = 0; ix__ < szx__; ++ix__)"; + out << nl << "for(int ix = 0; ix < szx; ++ix)"; out << sb; if(isArray || isStack) { - string v = isArray ? param : param + "__tmp"; + string v = isArray ? param : param + "_tmp"; if(!isValueType(st)) { - out << nl << v << "[ix__] = new " << typeS << "();"; + out << nl << v << "[ix] = new " << typeS << "();"; } - out << nl << v << "[ix__].read__(" << stream << ");"; + out << nl << v << "[ix].iceRead(" << stream << ");"; } else { - out << nl << typeS << " val__ = new " << typeS << "();"; - out << nl << "val__.read__(" << stream << ");"; - out << nl << param << "." << addMethod << "(val__);"; + out << nl << typeS << " val = new " << typeS << "();"; + out << nl << "val.iceRead(" << stream << ");"; + out << nl << param << "." << addMethod << "(val);"; } out << eb; if(isStack) { - out << nl << "_System.Array.Reverse(" << param << "__tmp);"; + out << nl << "_System.Array.Reverse(" << param << "_tmp);"; out << nl << param << " = new _System.Collections.Generic." << genericType << "<" << typeS << ">(" - << param << "__tmp);"; + << param << "_tmp);"; } out << eb; } @@ -1612,26 +1627,26 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out, if(isStack) { out << nl << typeS << "[] " << param << "_tmp = " << param << ".ToArray();"; - out << nl << "for(int ix__ = 0; ix__ < " << param << "_tmp.Length; ++ix__)"; + out << nl << "for(int ix = 0; ix < " << param << "_tmp.Length; ++ix)"; out << sb; - out << nl << stream << ".writeEnum((int)" << param << "_tmp[ix__], " << en->maxValue() << ");"; + out << nl << stream << ".writeEnum((int)" << param << "_tmp[ix], " << en->maxValue() << ");"; out << eb; } else { out << nl << "_System.Collections.Generic.IEnumerator<" << typeS - << "> e__ = " << param << ".GetEnumerator();"; - out << nl << "while(e__.MoveNext())"; + << "> e = " << param << ".GetEnumerator();"; + out << nl << "while(e.MoveNext())"; out << sb; - out << nl << stream << ".writeEnum((int)e__.Current, " << en->maxValue() << ");"; + out << nl << stream << ".writeEnum((int)e.Current, " << en->maxValue() << ");"; out << eb; } } else { - out << nl << "for(int ix__ = 0; ix__ < " << param << '.' << limitID << "; ++ix__)"; + out << nl << "for(int ix = 0; ix < " << param << '.' << limitID << "; ++ix)"; out << sb; - out << nl << stream << ".writeEnum((int)" << param << "[ix__], " << en->maxValue() << ");"; + out << nl << stream << ".writeEnum((int)" << param << "[ix], " << en->maxValue() << ");"; out << eb; } out << eb; @@ -1639,11 +1654,11 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out, else { out << sb; - out << nl << "int szx__ = " << stream << ".readAndCheckSeqSize(" << + out << nl << "int szx = " << stream << ".readAndCheckSeqSize(" << static_cast<unsigned>(type->minWireSize()) << ");"; if(isArray) { - out << nl << param << " = new " << toArrayAlloc(typeS + "[]", "szx__") << ";"; + out << nl << param << " = new " << toArrayAlloc(typeS + "[]", "szx") << ";"; } else if(isCustom) { @@ -1651,27 +1666,27 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out, } else if(isStack) { - out << nl << typeS << "[] " << param << "__tmp = new " << toArrayAlloc(typeS + "[]", "szx__") << ";"; + out << nl << typeS << "[] " << param << "_tmp = new " << toArrayAlloc(typeS + "[]", "szx") << ";"; } else if(isGeneric) { out << nl << param << " = new _System.Collections.Generic." << genericType << "<" << typeS << ">("; if(!isLinkedList) { - out << "szx__"; + out << "szx"; } out << ");"; } else { - out << nl << param << " = new " << fixId(seq->scoped()) << "(szx__);"; + out << nl << param << " = new " << fixId(seq->scoped()) << "(szx);"; } - out << nl << "for(int ix__ = 0; ix__ < szx__; ++ix__)"; + out << nl << "for(int ix = 0; ix < szx; ++ix)"; out << sb; if(isArray || isStack) { - string v = isArray ? param : param + "__tmp"; - out << nl << v << "[ix__] = (" << typeS << ')' << stream << ".readEnum(" << en->maxValue() << ");"; + string v = isArray ? param : param + "_tmp"; + out << nl << v << "[ix] = (" << typeS << ')' << stream << ".readEnum(" << en->maxValue() << ");"; } else { @@ -1681,9 +1696,9 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out, out << eb; if(isStack) { - out << nl << "_System.Array.Reverse(" << param << "__tmp);"; + out << nl << "_System.Array.Reverse(" << param << "_tmp);"; out << nl << param << " = new _System.Collections.Generic." << genericType << "<" << typeS << ">(" - << param << "__tmp);"; + << param << "_tmp);"; } out << eb; } @@ -1719,26 +1734,26 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out, if(isStack) { out << nl << typeS << "[] " << param << "_tmp = " << param << ".ToArray();"; - out << nl << "for(int ix__ = 0; ix__ < " << param << "_tmp.Length; ++ix__)"; + out << nl << "for(int ix = 0; ix < " << param << "_tmp.Length; ++ix)"; out << sb; - out << nl << helperName << '.' << func << '(' << stream << ", " << param << "_tmp[ix__]);"; + out << nl << helperName << '.' << func << '(' << stream << ", " << param << "_tmp[ix]);"; out << eb; } else { out << nl << "_System.Collections.Generic.IEnumerator<" << typeS - << "> e__ = " << param << ".GetEnumerator();"; - out << nl << "while(e__.MoveNext())"; + << "> e = " << param << ".GetEnumerator();"; + out << nl << "while(e.MoveNext())"; out << sb; - out << nl << helperName << '.' << func << '(' << stream << ", e__.Current);"; + out << nl << helperName << '.' << func << '(' << stream << ", e.Current);"; out << eb; } } else { - out << nl << "for(int ix__ = 0; ix__ < " << param << '.' << limitID << "; ++ix__)"; + out << nl << "for(int ix = 0; ix < " << param << '.' << limitID << "; ++ix)"; out << sb; - out << nl << helperName << '.' << func << '(' << stream << ", " << param << "[ix__]);"; + out << nl << helperName << '.' << func << '(' << stream << ", " << param << "[ix]);"; out << eb; } out << eb; @@ -1747,11 +1762,11 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out, { func = "read"; out << sb; - out << nl << "int szx__ = " << stream << ".readAndCheckSeqSize(" + out << nl << "int szx = " << stream << ".readAndCheckSeqSize(" << static_cast<unsigned>(type->minWireSize()) << ");"; if(isArray) { - out << nl << param << " = new " << toArrayAlloc(typeS + "[]", "szx__") << ";"; + out << nl << param << " = new " << toArrayAlloc(typeS + "[]", "szx") << ";"; } else if(isCustom) { @@ -1759,7 +1774,7 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out, } else if(isStack) { - out << nl << typeS << "[] " << param << "__tmp = new " << toArrayAlloc(typeS + "[]", "szx__") << ";"; + out << nl << typeS << "[] " << param << "_tmp = new " << toArrayAlloc(typeS + "[]", "szx") << ";"; } else if(isGeneric) { @@ -1767,14 +1782,14 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out, } else { - out << nl << param << " = new " << fixId(seq->scoped()) << "(szx__);"; + out << nl << param << " = new " << fixId(seq->scoped()) << "(szx);"; } - out << nl << "for(int ix__ = 0; ix__ < szx__; ++ix__)"; + out << nl << "for(int ix = 0; ix < szx; ++ix)"; out << sb; if(isArray || isStack) { - string v = isArray ? param : param + "__tmp"; - out << nl << v << "[ix__] = " << helperName << '.' << func << '(' << stream << ");"; + string v = isArray ? param : param + "_tmp"; + out << nl << v << "[ix] = " << helperName << '.' << func << '(' << stream << ");"; } else { @@ -1783,9 +1798,9 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out, out << eb; if(isStack) { - out << nl << "_System.Array.Reverse(" << param << "__tmp);"; + out << nl << "_System.Array.Reverse(" << param << "_tmp);"; out << nl << param << " = new _System.Collections.Generic." << genericType << "<" << typeS << ">(" - << param << "__tmp);"; + << param << "_tmp);"; } out << eb; } @@ -1798,9 +1813,14 @@ Slice::CsGenerator::writeOptionalSequenceMarshalUnmarshalCode(Output& out, const SequencePtr& seq, const string& param, int tag, - bool marshal) + bool marshal, + const string& customStream) { - string stream = marshal ? "os__" : "is__"; + string stream = customStream; + if(stream.empty()) + { + stream = marshal ? "ostr" : "istr"; + } const TypePtr type = seq->type(); const string typeS = typeToString(type); @@ -1863,9 +1883,9 @@ Slice::CsGenerator::writeOptionalSequenceMarshalUnmarshalCode(Output& out, { out << nl << stream << ".skipSize();"; } - string tmp = "tmpVal__"; + string tmp = "tmpVal"; out << nl << seqS << ' ' << tmp << ';'; - writeSequenceMarshalUnmarshalCode(out, seq, tmp, marshal, true); + writeSequenceMarshalUnmarshalCode(out, seq, tmp, marshal, true, stream); out << nl << param << " = new Ice.Optional<" << seqS << ">(" << tmp << ");"; out << eb; out << nl << "else"; @@ -1885,9 +1905,9 @@ Slice::CsGenerator::writeOptionalSequenceMarshalUnmarshalCode(Output& out, out << nl << "if(" << param << ".HasValue && " << stream << ".writeOptional(" << tag << ", " << getOptionalFormat(seq) << "))"; out << sb; - out << nl << "int pos__ = " << stream << ".startSize();"; - writeSequenceMarshalUnmarshalCode(out, seq, param + ".Value", marshal, true); - out << nl << stream << ".endSize(pos__);"; + out << nl << "int pos = " << stream << ".startSize();"; + writeSequenceMarshalUnmarshalCode(out, seq, param + ".Value", marshal, true, stream); + out << nl << stream << ".endSize(pos);"; out << eb; } else @@ -1895,9 +1915,9 @@ Slice::CsGenerator::writeOptionalSequenceMarshalUnmarshalCode(Output& out, out << nl << "if(" << stream << ".readOptional(" << tag << ", " << getOptionalFormat(seq) << "))"; out << sb; out << nl << stream << ".skip(4);"; - string tmp = "tmpVal__"; + string tmp = "tmpVal"; out << nl << seqS << ' ' << tmp << ';'; - writeSequenceMarshalUnmarshalCode(out, seq, tmp, marshal, true); + writeSequenceMarshalUnmarshalCode(out, seq, tmp, marshal, true, stream); out << nl << param << " = new Ice.Optional<" << seqS << ">(" << tmp << ");"; out << eb; out << nl << "else"; @@ -1925,17 +1945,17 @@ Slice::CsGenerator::writeOptionalSequenceMarshalUnmarshalCode(Output& out, out << sb; if(st->isVariableLength()) { - out << nl << "int pos__ = " << stream << ".startSize();"; + out << nl << "int pos = " << stream << ".startSize();"; } else if(st->minWireSize() > 1) { out << nl << stream << ".writeSize(" << param << ".Value == null ? 1 : " << length << " * " << st->minWireSize() << " + (" << length << " > 254 ? 5 : 1));"; } - writeSequenceMarshalUnmarshalCode(out, seq, param + ".Value", marshal, true); + writeSequenceMarshalUnmarshalCode(out, seq, param + ".Value", marshal, true, stream); if(st->isVariableLength()) { - out << nl << stream << ".endSize(pos__);"; + out << nl << stream << ".endSize(pos);"; } out << eb; } @@ -1951,9 +1971,9 @@ Slice::CsGenerator::writeOptionalSequenceMarshalUnmarshalCode(Output& out, { out << nl << stream << ".skipSize();"; } - string tmp = "tmpVal__"; + string tmp = "tmpVal"; out << nl << seqS << ' ' << tmp << ';'; - writeSequenceMarshalUnmarshalCode(out, seq, tmp, marshal, true); + writeSequenceMarshalUnmarshalCode(out, seq, tmp, marshal, true, stream); out << nl << param << " = new Ice.Optional<" << seqS << ">(" << tmp << ");"; out << eb; out << nl << "else"; @@ -1972,9 +1992,9 @@ Slice::CsGenerator::writeOptionalSequenceMarshalUnmarshalCode(Output& out, out << nl << "if(" << param << ".HasValue && " << stream << ".writeOptional(" << tag << ", " << getOptionalFormat(seq) << "))"; out << sb; - out << nl << "int pos__ = " << stream << ".startSize();"; - writeSequenceMarshalUnmarshalCode(out, seq, param + ".Value", marshal, true); - out << nl << stream << ".endSize(pos__);"; + out << nl << "int pos = " << stream << ".startSize();"; + writeSequenceMarshalUnmarshalCode(out, seq, param + ".Value", marshal, true, stream); + out << nl << stream << ".endSize(pos);"; out << eb; } else @@ -1982,9 +2002,9 @@ Slice::CsGenerator::writeOptionalSequenceMarshalUnmarshalCode(Output& out, out << nl << "if(" << stream << ".readOptional(" << tag << ", " << getOptionalFormat(seq) << "))"; out << sb; out << nl << stream << ".skip(4);"; - string tmp = "tmpVal__"; + string tmp = "tmpVal"; out << nl << seqS << ' ' << tmp << ';'; - writeSequenceMarshalUnmarshalCode(out, seq, tmp, marshal, true); + writeSequenceMarshalUnmarshalCode(out, seq, tmp, marshal, true, stream); out << nl << param << " = new Ice.Optional<" << seqS << ">(" << tmp << ");"; out << eb; out << nl << "else"; @@ -2002,16 +2022,20 @@ Slice::CsGenerator::writeSerializeDeserializeCode(Output &out, int tag, bool serialize) { + // + // Could do it only when param == "info", but not as good for testing + // + string dataMember = "this." + param; if(optional) { const string typeName = typeToString(type, true); if(serialize) { - out << nl << "info__.AddValue(\"" << param << "\", " << param << ", typeof(" << typeName << "));"; + out << nl << "info.AddValue(\"" << param << "\", " << dataMember << ", typeof(" << typeName << "));"; } else { - out << nl << param << " = (" << typeName << ")info__.GetValue(\"" << param << "\", typeof(" << typeName + out << nl << dataMember << " = (" << typeName << ")info.GetValue(\"" << param << "\", typeof(" << typeName << "));"; } return; @@ -2026,11 +2050,11 @@ Slice::CsGenerator::writeSerializeDeserializeCode(Output &out, { if(serialize) { - out << nl << "info__.AddValue(\"" << param << "\", " << param << ");"; + out << nl << "info.AddValue(\"" << param << "\", " << dataMember << ");"; } else { - out << nl << param << " = " << "info__.GetByte(\"" << param << "\");"; + out << nl << dataMember << " = " << "info.GetByte(\"" << param << "\");"; } break; } @@ -2038,11 +2062,11 @@ Slice::CsGenerator::writeSerializeDeserializeCode(Output &out, { if(serialize) { - out << nl << "info__.AddValue(\"" << param << "\", " << param << ");"; + out << nl << "info.AddValue(\"" << param << "\", " << dataMember << ");"; } else { - out << nl << param << " = " << "info__.GetBoolean(\"" << param << "\");"; + out << nl << dataMember << " = " << "info.GetBoolean(\"" << param << "\");"; } break; } @@ -2050,11 +2074,11 @@ Slice::CsGenerator::writeSerializeDeserializeCode(Output &out, { if(serialize) { - out << nl << "info__.AddValue(\"" << param << "\", " << param << ");"; + out << nl << "info.AddValue(\"" << param << "\", " << dataMember << ");"; } else { - out << nl << param << " = " << "info__.GetInt16(\"" << param << "\");"; + out << nl << dataMember << " = " << "info.GetInt16(\"" << param << "\");"; } break; } @@ -2062,11 +2086,11 @@ Slice::CsGenerator::writeSerializeDeserializeCode(Output &out, { if(serialize) { - out << nl << "info__.AddValue(\"" << param << "\", " << param << ");"; + out << nl << "info.AddValue(\"" << param << "\", " << dataMember << ");"; } else { - out << nl << param << " = " << "info__.GetInt32(\"" << param << "\");"; + out << nl << dataMember << " = " << "info.GetInt32(\"" << param << "\");"; } break; } @@ -2074,11 +2098,11 @@ Slice::CsGenerator::writeSerializeDeserializeCode(Output &out, { if(serialize) { - out << nl << "info__.AddValue(\"" << param << "\", " << param << ");"; + out << nl << "info.AddValue(\"" << param << "\", " << dataMember << ");"; } else { - out << nl << param << " = " << "info__.GetInt64(\"" << param << "\");"; + out << nl << dataMember << " = " << "info.GetInt64(\"" << param << "\");"; } break; } @@ -2086,11 +2110,11 @@ Slice::CsGenerator::writeSerializeDeserializeCode(Output &out, { if(serialize) { - out << nl << "info__.AddValue(\"" << param << "\", " << param << ");"; + out << nl << "info.AddValue(\"" << param << "\", " << dataMember << ");"; } else { - out << nl << param << " = " << "info__.GetSingle(\"" << param << "\");"; + out << nl << dataMember << " = " << "info.GetSingle(\"" << param << "\");"; } break; } @@ -2098,11 +2122,11 @@ Slice::CsGenerator::writeSerializeDeserializeCode(Output &out, { if(serialize) { - out << nl << "info__.AddValue(\"" << param << "\", " << param << ");"; + out << nl << "info.AddValue(\"" << param << "\", " << dataMember << ");"; } else { - out << nl << param << " = " << "info__.GetDouble(\"" << param << "\");"; + out << nl << dataMember << " = " << "info.GetDouble(\"" << param << "\");"; } break; } @@ -2110,12 +2134,12 @@ Slice::CsGenerator::writeSerializeDeserializeCode(Output &out, { if(serialize) { - out << nl << "info__.AddValue(\"" << param << "\", " << param << " == null ? \"\" : " << param + out << nl << "info.AddValue(\"" << param << "\", " << dataMember << " == null ? \"\" : " << dataMember << ");"; } else { - out << nl << param << " = " << "info__.GetString(\"" << param << "\");"; + out << nl << dataMember << " = " << "info.GetString(\"" << param << "\");"; } break; } @@ -2126,11 +2150,11 @@ Slice::CsGenerator::writeSerializeDeserializeCode(Output &out, const string typeName = typeToString(type, false); if(serialize) { - out << nl << "info__.AddValue(\"" << param << "\", " << param << ", typeof(" << typeName << "));"; + out << nl << "info.AddValue(\"" << param << "\", " << dataMember << ", typeof(" << typeName << "));"; } else { - out << nl << param << " = (" << typeName << ")info__.GetValue(\"" << param << "\", typeof(" + out << nl << dataMember << " = (" << typeName << ")info.GetValue(\"" << param << "\", typeof(" << typeName << "));"; } break; @@ -2139,12 +2163,12 @@ Slice::CsGenerator::writeSerializeDeserializeCode(Output &out, { if(serialize) { - out << nl << "info__.AddValue(\"" << param << "\", " << param + out << nl << "info.AddValue(\"" << param << "\", " << dataMember << ", typeof(Ice.ObjectPrxHelperBase));"; } else { - out << nl << param << " = (Ice.ObjectPrx)info__.GetValue(\"" << param + out << nl << dataMember << " = (Ice.ObjectPrx)info.GetValue(\"" << param << "\", typeof(Ice.ObjectPrxHelperBase));"; } break; @@ -2159,11 +2183,11 @@ Slice::CsGenerator::writeSerializeDeserializeCode(Output &out, const string typeName = typeToString(type, false); if(serialize) { - out << nl << "info__.AddValue(\"" << param << "\", " << param << ", typeof(" << typeName << "Helper));"; + out << nl << "info.AddValue(\"" << param << "\", " << dataMember << ", typeof(" << typeName << "Helper));"; } else { - out << nl << param << " = (" << typeName << ")info__.GetValue(\"" << param << "\", typeof(" << typeName + out << nl << dataMember << " = (" << typeName << ")info.GetValue(\"" << param << "\", typeof(" << typeName << "Helper));"; } return; @@ -2175,11 +2199,11 @@ Slice::CsGenerator::writeSerializeDeserializeCode(Output &out, const string typeName = typeToString(type, false); if(serialize) { - out << nl << "info__.AddValue(\"" << param << "\", " << param << ", typeof(" << typeName << "));"; + out << nl << "info.AddValue(\"" << param << "\", " << dataMember << ", typeof(" << typeName << "));"; } else { - out << nl << param << " = (" << typeName << ")info__.GetValue(\"" << param << "\", typeof(" << typeName + out << nl << dataMember << " = (" << typeName << ")info.GetValue(\"" << param << "\", typeof(" << typeName << "));"; } return; @@ -2191,11 +2215,11 @@ Slice::CsGenerator::writeSerializeDeserializeCode(Output &out, const string typeName = typeToString(type, false); if(serialize) { - out << nl << "info__.AddValue(\"" << param << "\", " << param << ", typeof(" << typeName << "));"; + out << nl << "info.AddValue(\"" << param << "\", " << dataMember << ", typeof(" << typeName << "));"; } else { - out << nl << param << " = (" << typeName << ")info__.GetValue(\"" << param << "\", typeof(" << typeName + out << nl << dataMember << " = (" << typeName << ")info.GetValue(\"" << param << "\", typeof(" << typeName << "));"; } return; @@ -2207,11 +2231,11 @@ Slice::CsGenerator::writeSerializeDeserializeCode(Output &out, const string typeName = typeToString(type, false); if(serialize) { - out << nl << "info__.AddValue(\"" << param << "\", " << param << ", typeof(" << typeName << "));"; + out << nl << "info.AddValue(\"" << param << "\", " << dataMember << ", typeof(" << typeName << "));"; } else { - out << nl << param << " = (" << typeName << ")info__.GetValue(\"" << param << "\", typeof(" << typeName + out << nl << dataMember << " = (" << typeName << ")info.GetValue(\"" << param << "\", typeof(" << typeName << "));"; } return; @@ -2223,11 +2247,11 @@ Slice::CsGenerator::writeSerializeDeserializeCode(Output &out, const string typeName = typeToString(type, false); if(serialize) { - out << nl << "info__.AddValue(\"" << param << "\", " << param << ", typeof(" << typeName << "));"; + out << nl << "info.AddValue(\"" << param << "\", " << dataMember << ", typeof(" << typeName << "));"; } else { - out << nl << param << " = (" << typeName << ")info__.GetValue(\"" << param << "\", typeof(" << typeName + out << nl << dataMember << " = (" << typeName << ")info.GetValue(\"" << param << "\", typeof(" << typeName << "));"; } return; @@ -2238,11 +2262,11 @@ Slice::CsGenerator::writeSerializeDeserializeCode(Output &out, const string typeName = typeToString(type, false); if(serialize) { - out << nl << "info__.AddValue(\"" << param << "\", " << param << ", typeof(" << typeName << "));"; + out << nl << "info.AddValue(\"" << param << "\", " << dataMember << ", typeof(" << typeName << "));"; } else { - out << nl << param << " = (" << typeName << ")info__.GetValue(\"" << param << "\", typeof(" << typeName + out << nl << dataMember << " = (" << typeName << ")info.GetValue(\"" << param << "\", typeof(" << typeName << "));"; } } diff --git a/cpp/src/slice2cs/CsUtil.h b/cpp/src/slice2cs/CsUtil.h index c6368eb78ff..b25c6a3dd2f 100644 --- a/cpp/src/slice2cs/CsUtil.h +++ b/cpp/src/slice2cs/CsUtil.h @@ -48,12 +48,14 @@ protected: // // Generate code to marshal or unmarshal a type // - void writeMarshalUnmarshalCode(::IceUtilInternal::Output&, const TypePtr&, const std::string&, bool); - void writeOptionalMarshalUnmarshalCode(::IceUtilInternal::Output&, const TypePtr&, const std::string&, int, bool); + void writeMarshalUnmarshalCode(::IceUtilInternal::Output&, const TypePtr&, const std::string&, bool, + const std::string& = ""); + void writeOptionalMarshalUnmarshalCode(::IceUtilInternal::Output&, const TypePtr&, const std::string&, int, bool, + const std::string& = ""); void writeSequenceMarshalUnmarshalCode(::IceUtilInternal::Output&, const SequencePtr&, const std::string&, - bool, bool); + bool, bool, const std::string& = ""); void writeOptionalSequenceMarshalUnmarshalCode(::IceUtilInternal::Output&, const SequencePtr&, const std::string&, - int, bool); + int, bool, const std::string& = ""); void writeSerializeDeserializeCode(::IceUtilInternal::Output&, const TypePtr&, const std::string&, bool, int, bool); diff --git a/cpp/src/slice2cs/Gen.cpp b/cpp/src/slice2cs/Gen.cpp index 9122c83a68b..ac2a5eb988b 100644 --- a/cpp/src/slice2cs/Gen.cpp +++ b/cpp/src/slice2cs/Gen.cpp @@ -111,14 +111,14 @@ emitDeprecate(const ContainedPtr& p1, const ContainedPtr& p2, Output& out, const } } -string -getEscapedParamName(const ParamDeclList& params, const string& name) +template<class List> +string getEscapedParamName(const List& params, const string& name) { - for(ParamDeclList::const_iterator i = params.begin(); i != params.end(); ++i) + for(typename List::const_iterator i = params.begin(); i != params.end(); ++i) { if((*i)->name() == name) { - return name + "__"; + return name + "_"; } } return name; @@ -150,31 +150,31 @@ Slice::CsVisitor::~CsVisitor() void Slice::CsVisitor::writeMarshalUnmarshalParams(const ParamDeclList& params, const OperationPtr& op, bool marshal, - bool resultStruct) + bool resultStruct, bool publicNames, const string& customStream) { ParamDeclList optionals; string paramPrefix = ""; - string returnValueS = "ret__"; + string returnValueS = "ret"; if(op && resultStruct) { if((op->returnType() && !params.empty()) || params.size() > 1) { - paramPrefix = "ret__."; + paramPrefix = "ret."; returnValueS = resultStructReturnValueName(params); } } for(ParamDeclList::const_iterator pli = params.begin(); pli != params.end(); ++pli) { - string param = fixId((*pli)->name()); + string param = paramPrefix.empty() && !publicNames ? "iceP_" + (*pli)->name() : fixId((*pli)->name()); TypePtr type = (*pli)->type(); bool patch = false; if(!marshal && isClassType(type)) { patch = true; - param = (*pli)->name() + "__PP"; + param = "icePP_" + (*pli)->name(); string typeS = typeToString(type); if((*pli)->optional()) { @@ -195,7 +195,7 @@ Slice::CsVisitor::writeMarshalUnmarshalParams(const ParamDeclList& params, const } else { - writeMarshalUnmarshalCode(_out, type, patch ? param : (paramPrefix + param), marshal); + writeMarshalUnmarshalCode(_out, type, patch ? param : (paramPrefix + param), marshal, customStream); } } @@ -205,7 +205,7 @@ Slice::CsVisitor::writeMarshalUnmarshalParams(const ParamDeclList& params, const { ret = op->returnType(); bool patch = false; - string param = "ret__"; + string param = "ret"; if(!marshal && isClassType(ret)) { patch = true; @@ -226,7 +226,7 @@ Slice::CsVisitor::writeMarshalUnmarshalParams(const ParamDeclList& params, const if(!op->returnIsOptional()) { - writeMarshalUnmarshalCode(_out, ret, patch ? param : (paramPrefix + returnValueS), marshal); + writeMarshalUnmarshalCode(_out, ret, patch ? param : (paramPrefix + returnValueS), marshal, customStream); } } @@ -252,28 +252,29 @@ Slice::CsVisitor::writeMarshalUnmarshalParams(const ParamDeclList& params, const { if(checkReturnType && op->returnTag() < (*pli)->tag()) { - const string param = !marshal && isClassType(ret) ? "ret__PP.patch" : (paramPrefix + returnValueS); - writeOptionalMarshalUnmarshalCode(_out, ret, param, op->returnTag(), marshal); + const string param = !marshal && isClassType(ret) ? "retPP.patch" : (paramPrefix + returnValueS); + writeOptionalMarshalUnmarshalCode(_out, ret, param, op->returnTag(), marshal, customStream); checkReturnType = false; } - string param = fixId((*pli)->name()); + string param = paramPrefix.empty() && !publicNames ? "iceP_" + (*pli)->name() : fixId((*pli)->name()); TypePtr type = (*pli)->type(); bool patch = false; if(!marshal && isClassType(type)) { - param = (*pli)->name() + "__PP.patch"; + param = "icePP_" + (*pli)->name() + ".patch"; patch = true; } - writeOptionalMarshalUnmarshalCode(_out, type, patch ? param : (paramPrefix + param), (*pli)->tag(), marshal); + writeOptionalMarshalUnmarshalCode(_out, type, patch ? param : (paramPrefix + param), (*pli)->tag(), + marshal, customStream); } if(checkReturnType) { - const string param = !marshal && isClassType(ret) ? "ret__PP.patch" : (paramPrefix + returnValueS); - writeOptionalMarshalUnmarshalCode(_out, ret, param, op->returnTag(), marshal); + const string param = !marshal && isClassType(ret) ? "retPP.patch" : (paramPrefix + returnValueS); + writeOptionalMarshalUnmarshalCode(_out, ret, param, op->returnTag(), marshal, customStream); } } @@ -282,55 +283,57 @@ Slice::CsVisitor::writePostUnmarshalParams(const ParamDeclList& params, const Op { string paramPrefix = ""; - string returnValueS = "ret__"; + string returnValueS = "ret"; if(op) { if((op->returnType() && !params.empty()) || params.size() > 1) { - paramPrefix = "ret__."; + paramPrefix = "ret."; returnValueS = resultStructReturnValueName(op->outParameters()); } } for(ParamDeclList::const_iterator pli = params.begin(); pli != params.end(); ++pli) { + string param = paramPrefix.empty() ? "iceP_" + (*pli)->name() : fixId((*pli)->name()); + if(isClassType((*pli)->type())) { - const string tmp = (*pli)->name() + "__PP"; - _out << nl << paramPrefix << fixId((*pli)->name()) << " = " << tmp << ".value;"; + const string tmp = "icePP_" + (*pli)->name(); + _out << nl << paramPrefix << param << " = " << tmp << ".value;"; } } if(op && op->returnType() && isClassType(op->returnType())) { - _out << nl << paramPrefix << returnValueS << " = ret__PP.value;"; + _out << nl << paramPrefix << returnValueS << " = retPP.value;"; } } void -Slice::CsVisitor::writeMarshalDataMember(const DataMemberPtr& member, const string& name) +Slice::CsVisitor::writeMarshalDataMember(const DataMemberPtr& member, const string& name, const string& customStream) { if(member->optional()) { - writeOptionalMarshalUnmarshalCode(_out, member->type(), name, member->tag(), true); + writeOptionalMarshalUnmarshalCode(_out, member->type(), name, member->tag(), true, customStream); } else { - writeMarshalUnmarshalCode(_out, member->type(), name, true); + writeMarshalUnmarshalCode(_out, member->type(), name, true, customStream); } } void Slice::CsVisitor::writeUnmarshalDataMember(const DataMemberPtr& member, const string& name, bool needPatcher, - int& patchIter) + int& patchIter, const string& customStream) { const bool classType = isClassType(member->type()); string patcher; if(classType) { - patcher = "new Patcher__(" + getStaticId(member->type()) + ", this"; + patcher = "new Patcher_(" + getStaticId(member->type()) + ", this"; if(needPatcher) { ostringstream ostr; @@ -342,11 +345,12 @@ Slice::CsVisitor::writeUnmarshalDataMember(const DataMemberPtr& member, const st if(member->optional()) { - writeOptionalMarshalUnmarshalCode(_out, member->type(), classType ? patcher : name, member->tag(), false); + writeOptionalMarshalUnmarshalCode(_out, member->type(), classType ? patcher : name, member->tag(), false, + customStream); } else { - writeMarshalUnmarshalCode(_out, member->type(), classType ? patcher : name, false); + writeMarshalUnmarshalCode(_out, member->type(), classType ? patcher : name, false, customStream); } } @@ -412,7 +416,7 @@ Slice::CsVisitor::writeDispatch(const ClassDefPtr& p) emitGeneratedCodeAttribute(); } - _out << nl << "public static new readonly string[] ids__ = "; + _out << nl << "private static readonly string[] _ids = "; _out << sb; { StringList::const_iterator q = ids.begin(); @@ -432,9 +436,9 @@ Slice::CsVisitor::writeDispatch(const ClassDefPtr& p) { emitGeneratedCodeAttribute(); } - _out << nl << "public override bool ice_isA(string s, Ice.Current current__ = null)"; + _out << nl << "public override bool ice_isA(string s, Ice.Current current = null)"; _out << sb; - _out << nl << "return _System.Array.BinarySearch(ids__, s, IceUtilInternal.StringUtil.OrdinalStringComparer) >= 0;"; + _out << nl << "return _System.Array.BinarySearch(_ids, s, IceUtilInternal.StringUtil.OrdinalStringComparer) >= 0;"; _out << eb; _out << sp; @@ -442,9 +446,9 @@ Slice::CsVisitor::writeDispatch(const ClassDefPtr& p) { emitGeneratedCodeAttribute(); } - _out << nl << "public override string[] ice_ids(Ice.Current current__ = null)"; + _out << nl << "public override string[] ice_ids(Ice.Current current = null)"; _out << sb; - _out << nl << "return ids__;"; + _out << nl << "return _ids;"; _out << eb; _out << sp; @@ -452,9 +456,9 @@ Slice::CsVisitor::writeDispatch(const ClassDefPtr& p) { emitGeneratedCodeAttribute(); } - _out << nl << "public override string ice_id(Ice.Current current__ = null)"; + _out << nl << "public override string ice_id(Ice.Current current = null)"; _out << sb; - _out << nl << "return ids__[" << scopedPos << "];"; + _out << nl << "return _ids[" << scopedPos << "];"; _out << eb; _out << sp; @@ -465,7 +469,7 @@ Slice::CsVisitor::writeDispatch(const ClassDefPtr& p) _out << nl << "public static new string ice_staticId()"; _out << sb; - _out << nl << "return ids__[" << scopedPos << "];"; + _out << nl << "return _ids[" << scopedPos << "];"; _out << eb; _out << sp << nl << "#endregion"; // Slice type-related members @@ -491,24 +495,24 @@ Slice::CsVisitor::writeDispatch(const ClassDefPtr& p) emitGeneratedCodeAttribute(); } _out << nl << "public static _System.Threading.Tasks.Task<Ice.OutputStream>"; - _out << nl << opName << "___(" << name << (p->isInterface() ? "" : "Disp_") << " obj__, " - << "IceInternal.Incoming inS__, Ice.Current current__)"; + _out << nl << "iceD_" << opName << "(" << name << (p->isInterface() ? "" : "Disp_") << " obj, " + << "IceInternal.Incoming inS, Ice.Current current)"; _out << sb; TypePtr ret = op->returnType(); ParamDeclList inParams = op->inParameters(); ParamDeclList outParams = op->outParameters(); - _out << nl << "Ice.ObjectImpl.checkMode__(" << sliceModeToIceMode(op->mode()) << ", current__.mode);"; + _out << nl << "Ice.ObjectImpl.iceCheckMode(" << sliceModeToIceMode(op->mode()) << ", current.mode);"; if(!inParams.empty()) { // // Unmarshal 'in' parameters. // - _out << nl << "var is__ = inS__.startReadParams();"; + _out << nl << "var istr = inS.startReadParams();"; for(ParamDeclList::const_iterator pli = inParams.begin(); pli != inParams.end(); ++pli) { - string param = fixId((*pli)->name()); + string param = "iceP_" + (*pli)->name(); string typeS = typeToString((*pli)->type(), (*pli)->optional()); const bool isClass = isClassType((*pli)->type()); @@ -539,55 +543,55 @@ Slice::CsVisitor::writeDispatch(const ClassDefPtr& p) writeMarshalUnmarshalParams(inParams, 0, false); if(op->sendsClasses(false)) { - _out << nl << "is__.readPendingValues();"; + _out << nl << "istr.readPendingValues();"; } - _out << nl << "inS__.endReadParams();"; + _out << nl << "inS.endReadParams();"; } else { - _out << nl << "inS__.readEmptyParams();"; + _out << nl << "inS.readEmptyParams();"; } if(op->format() != DefaultFormat) { - _out << nl << "inS__.setFormat(" << opFormatTypeToString(op) << ");"; + _out << nl << "inS.setFormat(" << opFormatTypeToString(op) << ");"; } vector<string> inArgs; for(ParamDeclList::const_iterator pli = inParams.begin(); pli != inParams.end(); ++pli) { - inArgs.push_back(isClassType((*pli)->type()) ? ((*pli)->name() + "__PP.value") : fixId((*pli)->name())); + inArgs.push_back(isClassType((*pli)->type()) ? "icePP_" + (*pli)->name() + ".value" : "iceP_" + (*pli)->name()); } const bool amd = p->hasMetaData("amd") || op->hasMetaData("amd"); if(op->hasMarshaledResult()) { - _out << nl << "return inS__." << (amd ? "setMarshaledResultTask" : "setMarshaledResult"); - _out << "(obj__." << opName << (amd ? "Async" : "") << spar << inArgs << "current__" << epar << ");"; + _out << nl << "return inS." << (amd ? "setMarshaledResultTask" : "setMarshaledResult"); + _out << "(obj." << opName << (amd ? "Async" : "") << spar << inArgs << "current" << epar << ");"; _out << eb; } else if(amd) { string retS = resultType(op); - _out << nl << "return inS__.setResultTask" << (retS.empty() ? "" : ('<' + retS + '>')); - _out << "(obj__." << opName << "Async" << spar << inArgs << "current__" << epar; + _out << nl << "return inS.setResultTask" << (retS.empty() ? "" : ('<' + retS + '>')); + _out << "(obj." << opName << "Async" << spar << inArgs << "current" << epar; if(!retS.empty()) { _out << ","; _out.inc(); if(!ret && outParams.size() == 1) { - _out << nl << "(os__, " << fixId(outParams.front()->name()) << ") =>"; + _out << nl << "(ostr, " << "iceP_" << outParams.front()->name() << ") =>"; } else { - _out << nl << "(os__, ret__) =>"; + _out << nl << "(ostr, ret) =>"; } _out << sb; writeMarshalUnmarshalParams(outParams, op, true, true); if(op->returnsClasses(false)) { - _out << nl << "os__.writePendingValues();"; + _out << nl << "ostr.writePendingValues();"; } _out << eb; _out.dec(); @@ -600,7 +604,7 @@ Slice::CsVisitor::writeDispatch(const ClassDefPtr& p) for(ParamDeclList::const_iterator pli = outParams.begin(); pli != outParams.end(); ++pli) { string typeS = typeToString((*pli)->type(), (*pli)->optional()); - _out << nl << typeS << ' ' << fixId((*pli)->name()) << ";"; + _out << nl << typeS << ' ' << "iceP_" + (*pli)->name() << ";"; } // @@ -609,32 +613,32 @@ Slice::CsVisitor::writeDispatch(const ClassDefPtr& p) _out << nl; if(ret) { - _out << "var ret__ = "; + _out << "var ret = "; } - _out << "obj__." << fixId(opName, DotNet::ICloneable, true) << spar << inArgs; + _out << "obj." << fixId(opName, DotNet::ICloneable, true) << spar << inArgs; for(ParamDeclList::const_iterator pli = outParams.begin(); pli != outParams.end(); ++pli) { - _out << "out " + fixId((*pli)->name()); + _out << "out iceP_" + (*pli)->name(); } - _out << "current__" << epar << ';'; + _out << "current" << epar << ';'; // // Marshal 'out' parameters and return value. // if(!outParams.empty() || ret) { - _out << nl << "var os__ = inS__.startWriteParams();"; + _out << nl << "var ostr = inS.startWriteParams();"; writeMarshalUnmarshalParams(outParams, op, true); if(op->returnsClasses(false)) { - _out << nl << "os__.writePendingValues();"; + _out << nl << "ostr.writePendingValues();"; } - _out << nl << "inS__.endWriteParams(os__);"; - _out << nl << "return inS__.setResult(os__);"; + _out << nl << "inS.endWriteParams(ostr);"; + _out << nl << "return inS.setResult(ostr);"; } else { - _out << nl << "return inS__.setResult(inS__.writeEmptyParams());"; + _out << nl << "return inS.setResult(inS.writeEmptyParams());"; } _out << eb; } @@ -652,7 +656,7 @@ Slice::CsVisitor::writeDispatch(const ClassDefPtr& p) allOpNames.sort(); allOpNames.unique(); - _out << sp << nl << "private static string[] all__ ="; + _out << sp << nl << "private static readonly string[] _all ="; _out << sb; for(StringList::const_iterator q = allOpNames.begin(); q != allOpNames.end();) { @@ -670,13 +674,13 @@ Slice::CsVisitor::writeDispatch(const ClassDefPtr& p) emitGeneratedCodeAttribute(); } _out << nl << "public override _System.Threading.Tasks.Task<Ice.OutputStream>"; - _out << nl << "dispatch__(IceInternal.Incoming inS__, Ice.Current current__)"; + _out << nl << "iceDispatch(IceInternal.Incoming inS, Ice.Current current)"; _out << sb; - _out << nl << "int pos = _System.Array.BinarySearch(all__, current__.operation, " + _out << nl << "int pos = _System.Array.BinarySearch(_all, current.operation, " << "IceUtilInternal.StringUtil.OrdinalStringComparer);"; _out << nl << "if(pos < 0)"; _out << sb; - _out << nl << "throw new Ice.OperationNotExistException(current__.id, current__.facet, current__.operation);"; + _out << nl << "throw new Ice.OperationNotExistException(current.id, current.facet, current.operation);"; _out << eb; _out << sp << nl << "switch(pos)"; _out << sb; @@ -689,19 +693,19 @@ Slice::CsVisitor::writeDispatch(const ClassDefPtr& p) _out << sb; if(opName == "ice_id") { - _out << nl << "return Ice.ObjectImpl.ice_id___(this, inS__, current__);"; + _out << nl << "return Ice.ObjectImpl.iceD_ice_id(this, inS, current);"; } else if(opName == "ice_ids") { - _out << nl << "return Ice.ObjectImpl.ice_ids___(this, inS__, current__);"; + _out << nl << "return Ice.ObjectImpl.iceD_ice_ids(this, inS, current);"; } else if(opName == "ice_isA") { - _out << nl << "return Ice.ObjectImpl.ice_isA___(this, inS__, current__);"; + _out << nl << "return Ice.ObjectImpl.iceD_ice_isA(this, inS, current);"; } else if(opName == "ice_ping") { - _out << nl << "return Ice.ObjectImpl.ice_ping___(this, inS__, current__);"; + _out << nl << "return Ice.ObjectImpl.iceD_ice_ping(this, inS, current);"; } else { @@ -717,11 +721,11 @@ Slice::CsVisitor::writeDispatch(const ClassDefPtr& p) assert(cl); if(cl->scoped() == p->scoped()) { - _out << nl << "return " << opName << "___(this, inS__, current__);"; + _out << nl << "return iceD_" << opName << "(this, inS, current);"; } else { - _out << nl << "return " << fixId(cl->scoped() + "Disp_") << "." << opName << "___(this, inS__, current__);"; + _out << nl << "return " << fixId(cl->scoped() + "Disp_") << ".iceD_" << opName << "(this, inS, current);"; } break; } @@ -731,7 +735,7 @@ Slice::CsVisitor::writeDispatch(const ClassDefPtr& p) } _out << eb; _out << sp << nl << "_System.Diagnostics.Debug.Assert(false);"; - _out << nl << "throw new Ice.OperationNotExistException(current__.id, current__.facet, current__.operation);"; + _out << nl << "throw new Ice.OperationNotExistException(current.id, current.facet, current.operation);"; _out << eb; } @@ -761,7 +765,7 @@ Slice::CsVisitor::writeMarshaling(const ClassDefPtr& p) assert(find(ids.begin(), ids.end(), scoped) != ids.end()); // - // Marshalling support + // Marshaling support // DataMemberList allClassMembers = p->allClassDataMembers(); DataMemberList members = p->dataMembers(); @@ -786,11 +790,11 @@ Slice::CsVisitor::writeMarshaling(const ClassDefPtr& p) emitGeneratedCodeAttribute(); } - _out << nl << "public override void write__(Ice.OutputStream os__)"; + _out << nl << "public override void iceWrite(Ice.OutputStream ostr_)"; _out << sb; - _out << nl << "os__.startValue(slicedData__);"; - _out << nl << "writeImpl__(os__);"; - _out << nl << "os__.endValue();"; + _out << nl << "ostr_.startValue(iceSlicedData);"; + _out << nl << "iceWriteImpl(ostr_);"; + _out << nl << "ostr_.endValue();"; _out << eb; _out << sp; @@ -798,11 +802,11 @@ Slice::CsVisitor::writeMarshaling(const ClassDefPtr& p) { emitGeneratedCodeAttribute(); } - _out << nl << "public override void read__(Ice.InputStream is__)"; + _out << nl << "public override void iceRead(Ice.InputStream istr_)"; _out << sb; - _out << nl << "is__.startValue();"; - _out << nl << "readImpl__(is__);"; - _out << nl << "slicedData__ = is__.endValue(true);"; + _out << nl << "istr_.startValue();"; + _out << nl << "iceReadImpl(istr_);"; + _out << nl << "iceSlicedData = istr_.endValue(true);"; _out << eb; } @@ -811,24 +815,24 @@ Slice::CsVisitor::writeMarshaling(const ClassDefPtr& p) { emitGeneratedCodeAttribute(); } - _out << nl << "protected override void writeImpl__(Ice.OutputStream os__)"; + _out << nl << "protected override void iceWriteImpl(Ice.OutputStream ostr_)"; _out << sb; - _out << nl << "os__.startSlice(ice_staticId(), " << p->compactId() << (!base ? ", true" : ", false") << ");"; + _out << nl << "ostr_.startSlice(ice_staticId(), " << p->compactId() << (!base ? ", true" : ", false") << ");"; for(DataMemberList::const_iterator d = members.begin(); d != members.end(); ++d) { if(!(*d)->optional()) { - writeMarshalDataMember(*d, fixId(*d, DotNet::ICloneable, true)); + writeMarshalDataMember(*d, fixId(*d, DotNet::ICloneable, true), "ostr_"); } } for(DataMemberList::const_iterator d = optionalMembers.begin(); d != optionalMembers.end(); ++d) { - writeMarshalDataMember(*d, fixId(*d, DotNet::ICloneable, true)); + writeMarshalDataMember(*d, fixId(*d, DotNet::ICloneable, true), "ostr_"); } - _out << nl << "os__.endSlice();"; + _out << nl << "ostr_.endSlice();"; if(base) { - _out << nl << "base.writeImpl__(os__);"; + _out << nl << "base.iceWriteImpl(ostr_);"; } _out << eb; @@ -844,9 +848,9 @@ Slice::CsVisitor::writeMarshaling(const ClassDefPtr& p) { _out << "new "; } - _out << "class Patcher__"; + _out << "class Patcher_"; _out << sb; - _out << sp << nl << "internal Patcher__(string type, Ice.Value instance"; + _out << sp << nl << "internal Patcher_(string type, Ice.Value instance"; if(classMembers.size() > 1) { @@ -973,32 +977,32 @@ Slice::CsVisitor::writeMarshaling(const ClassDefPtr& p) { emitGeneratedCodeAttribute(); } - _out << nl << "protected override void readImpl__(Ice.InputStream is__)"; + _out << nl << "protected override void iceReadImpl(Ice.InputStream istr_)"; _out << sb; - _out << nl << "is__.startSlice();"; + _out << nl << "istr_.startSlice();"; int patchIter = 0; const bool needCustomPatcher = classMembers.size() > 1; for(DataMemberList::const_iterator d = members.begin(); d != members.end(); ++d) { if(!(*d)->optional()) { - writeUnmarshalDataMember(*d, fixId(*d, DotNet::ICloneable, true), needCustomPatcher, patchIter); + writeUnmarshalDataMember(*d, fixId(*d, DotNet::ICloneable, true), needCustomPatcher, patchIter, "istr_"); } } for(DataMemberList::const_iterator d = optionalMembers.begin(); d != optionalMembers.end(); ++d) { - writeUnmarshalDataMember(*d, fixId(*d, DotNet::ICloneable, true), needCustomPatcher, patchIter); + writeUnmarshalDataMember(*d, fixId(*d, DotNet::ICloneable, true), needCustomPatcher, patchIter, "istr_"); } - _out << nl << "is__.endSlice();"; + _out << nl << "istr_.endSlice();"; if(base) { - _out << nl << "base.readImpl__(is__);"; + _out << nl << "base.iceReadImpl(istr_);"; } _out << eb; if(preserved && !basePreserved) { - _out << sp << nl << "protected Ice.SlicedData slicedData__;"; + _out << sp << nl << "protected Ice.SlicedData iceSlicedData;"; } _out << sp << nl << "#endregion"; // Marshalling support @@ -1040,7 +1044,7 @@ Slice::CsVisitor::getParams(const OperationPtr& op) } vector<string> -Slice::CsVisitor::getInParams(const OperationPtr& op) +Slice::CsVisitor::getInParams(const OperationPtr& op, bool internal) { vector<string> params; @@ -1051,7 +1055,7 @@ Slice::CsVisitor::getInParams(const OperationPtr& op) for(ParamDeclList::const_iterator q = paramList.begin(); q != paramList.end(); ++q) { params.push_back(getParamAttributes(*q) + typeToString((*q)->type(), (*q)->optional(), cl->isLocal()) - + " " + fixId((*q)->name())); + + " " + (internal ? "iceP_" + (*q)->name() : fixId((*q)->name()))); } return params; } @@ -1066,7 +1070,7 @@ Slice::CsVisitor::getOutParams(const OperationPtr& op, bool returnParam, bool ou TypePtr ret = op->returnType(); if(ret) { - params.push_back(typeToString(ret, op->returnIsOptional()) + " ret__"); + params.push_back(typeToString(ret, op->returnIsOptional()) + " ret"); } } @@ -1103,7 +1107,7 @@ Slice::CsVisitor::getArgs(const OperationPtr& op) } vector<string> -Slice::CsVisitor::getInArgs(const OperationPtr& op) +Slice::CsVisitor::getInArgs(const OperationPtr& op, bool internal) { vector<string> args; ParamDeclList paramList = op->parameters(); @@ -1111,7 +1115,7 @@ Slice::CsVisitor::getInArgs(const OperationPtr& op) { if(!(*q)->isOutParam()) { - args.push_back(fixId((*q)->name())); + args.push_back(internal ? "iceP_" + (*q)->name() : fixId((*q)->name())); } } return args; @@ -1335,7 +1339,7 @@ Slice::CsVisitor::writeDataMemberInitializers(const DataMemberList& members, int _out << nl << "this."; if(propertyMapping) { - _out << (*p)->name() << "__prop"; + _out << "_" + (*p)->name(); } else { @@ -2236,7 +2240,7 @@ Slice::Gen::CompactIdVisitor::visitClassDefStart(const ClassDefPtr& p) emitGeneratedCodeAttribute(); _out << nl << "public sealed class TypeId_" << p->compactId(); _out << sb; - _out << nl << "public readonly static string typeId = \"" << p->scoped() << "\";"; + _out << nl << "public const string typeId = \"" << p->scoped() << "\";"; _out << eb; } return false; @@ -2475,7 +2479,7 @@ Slice::Gen::TypesVisitor::visitClassDefEnd(const ClassDefPtr& p) const string paramName = fixId((*d)->name()); if(propertyMapping) { - _out << (*d)->name() << "__prop"; + _out << "_" + (*d)->name(); } else { @@ -2504,18 +2508,18 @@ Slice::Gen::TypesVisitor::visitClassDefEnd(const ClassDefPtr& p) if(!p->isInterface() && !p->isLocal()) { _out << sp << nl; - _out << nl << "public static new readonly string static_id__ = \"" + _out << nl << "private const string _id = \"" << p->scoped() << "\";"; _out << sp; _out << nl << "public static new string ice_staticId()"; _out << sb; - _out << nl << "return static_id__;"; + _out << nl << "return _id;"; _out << eb; _out << nl << "public override string ice_id()"; _out << sb; - _out << nl << "return static_id__;"; + _out << nl << "return _id;"; _out << eb; writeMarshaling(p); @@ -2605,7 +2609,7 @@ Slice::Gen::TypesVisitor::visitOperation(const OperationPtr& p) _out << "public abstract "; } _out << retS << " end_" << name << spar << getOutParams(p, false, true) - << "Ice.AsyncResult " + getEscapedParamName(inParamDecls, "result") << epar << ';'; + << "Ice.AsyncResult " + getEscapedParamName(p->outParameters(), "asyncResult") << epar << ';'; } } } @@ -2710,7 +2714,7 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) const bool hasDataMemberInitializers = requiresDataMemberInitializers(dataMembers); if(hasDataMemberInitializers) { - _out << sp << nl << "private void initDM__()"; + _out << sp << nl << "private void _initDM()"; _out << sb; writeDataMemberInitializers(dataMembers, DotNet::Exception); _out << eb; @@ -2722,23 +2726,23 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) _out << sb; if(hasDataMemberInitializers) { - _out << nl << "initDM__();"; + _out << nl << "_initDM();"; } _out << eb; _out << sp; emitGeneratedCodeAttribute(); - _out << nl << "public " << name << "(_System.Exception ex__) : base(ex__)"; + _out << nl << "public " << name << "(_System.Exception ex) : base(ex)"; _out << sb; if(hasDataMemberInitializers) { - _out << nl << "initDM__();"; + _out << nl << "_initDM();"; } _out << eb; _out << sp; emitGeneratedCodeAttribute(); - _out << nl << "public " << name << "(_System.Runtime.Serialization.SerializationInfo info__, " - << "_System.Runtime.Serialization.StreamingContext context__) : base(info__, context__)"; + _out << nl << "public " << name << "(_System.Runtime.Serialization.SerializationInfo info, " + << "_System.Runtime.Serialization.StreamingContext context) : base(info, context)"; _out << sb; for(DataMemberList::const_iterator q = dataMembers.begin(); q != dataMembers.end(); ++q) { @@ -2751,7 +2755,7 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) { if(!dataMembers.empty()) { - _out << sp << nl << "private void initDM__" << spar << paramDecl << epar; + _out << sp << nl << "private void _initDM" << spar << paramDecl << epar; _out << sb; for(DataMemberList::const_iterator q = dataMembers.begin(); q != dataMembers.end(); ++q) { @@ -2771,14 +2775,15 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) _out << sb; if(!dataMembers.empty()) { - _out << nl << "initDM__" << spar << paramNames << epar << ';'; + _out << nl << "_initDM" << spar << paramNames << epar << ';'; } _out << eb; + string exParam = getEscapedParamName(allDataMembers, "ex"); vector<string> exceptionParam; - exceptionParam.push_back("ex__"); + exceptionParam.push_back(exParam); vector<string> exceptionDecl; - exceptionDecl.push_back("_System.Exception ex__"); + exceptionDecl.push_back("_System.Exception " + exParam); _out << sp; emitGeneratedCodeAttribute(); _out << nl << "public " << name << spar << allParamDecl << exceptionDecl << epar << " : base" << spar; @@ -2790,7 +2795,7 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) _out << sb; if(!dataMembers.empty()) { - _out << nl << "initDM__" << spar << paramNames << epar << ';'; + _out << nl << "_initDM" << spar << paramNames << epar << ';'; } _out << eb; } @@ -2812,37 +2817,37 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) _out << sb; if(p->base()) { - _out << nl << "int h__ = base.GetHashCode();"; + _out << nl << "int h_ = base.GetHashCode();"; } else { - _out << nl << "int h__ = 5381;"; + _out << nl << "int h_ = 5381;"; } - _out << nl << "IceInternal.HashUtil.hashAdd(ref h__, \"" << p->scoped() << "\");"; + _out << nl << "IceInternal.HashUtil.hashAdd(ref h_, \"" << p->scoped() << "\");"; writeMemberHashCode(dataMembers, DotNet::Exception); - _out << nl << "return h__;"; + _out << nl << "return h_;"; _out << eb; _out << sp; emitGeneratedCodeAttribute(); - _out << nl << "public override bool Equals(object other__)"; + _out << nl << "public override bool Equals(object other)"; _out << sb; - _out << nl << "if(other__ == null)"; + _out << nl << "if(other == null)"; _out << sb; _out << nl << "return false;"; _out << eb; - _out << nl << "if(object.ReferenceEquals(this, other__))"; + _out << nl << "if(object.ReferenceEquals(this, other))"; _out << sb; _out << nl << "return true;"; _out << eb; - _out << nl << name << " o__ = other__ as " << name << ";"; - _out << nl << "if(o__ == null)"; + _out << nl << name << " o = other as " << name << ";"; + _out << nl << "if(o == null)"; _out << sb; _out << nl << "return false;"; _out << eb; if(p->base()) { - _out << nl << "if(!base.Equals(other__))"; + _out << nl << "if(!base.Equals(other))"; _out << sb; _out << nl << "return false;"; _out << eb; @@ -2855,15 +2860,15 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) { _out << sp; emitGeneratedCodeAttribute(); - _out << nl << "public override void GetObjectData(_System.Runtime.Serialization.SerializationInfo info__, " - << "_System.Runtime.Serialization.StreamingContext context__)"; + _out << nl << "public override void GetObjectData(_System.Runtime.Serialization.SerializationInfo info, " + << "_System.Runtime.Serialization.StreamingContext context)"; _out << sb; for(DataMemberList::const_iterator q = dataMembers.begin(); q != dataMembers.end(); ++q) { string name = fixId((*q)->name(), DotNet::Exception, false); writeSerializeDeserializeCode(_out, (*q)->type(), name, (*q)->optional(), (*q)->tag(), true); } - _out << sp << nl << "base.GetObjectData(info__, context__);"; + _out << sp << nl << "base.GetObjectData(info, context);"; _out << eb; } @@ -2873,16 +2878,16 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) _out << sp; emitGeneratedCodeAttribute(); - _out << nl << "public static bool operator==(" << name << " lhs__, " << name << " rhs__)"; + _out << nl << "public static bool operator==(" << name << " lhs, " << name << " rhs)"; _out << sb; - _out << nl << "return Equals(lhs__, rhs__);"; + _out << nl << "return Equals(lhs, rhs);"; _out << eb; _out << sp; emitGeneratedCodeAttribute(); - _out << nl << "public static bool operator!=(" << name << " lhs__, " << name << " rhs__)"; + _out << nl << "public static bool operator!=(" << name << " lhs, " << name << " rhs)"; _out << sb; - _out << nl << "return !Equals(lhs__, rhs__);"; + _out << nl << "return !Equals(lhs, rhs);"; _out << eb; _out << sp << nl << "#endregion"; // Comparison members @@ -2901,36 +2906,36 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) { _out << sp; emitGeneratedCodeAttribute(); - _out << nl << "public override void write__(Ice.OutputStream os__)"; + _out << nl << "public override void iceWrite(Ice.OutputStream ostr_)"; _out << sb; - _out << nl << "os__.startException(slicedData__);"; - _out << nl << "writeImpl__(os__);"; - _out << nl << "os__.endException();"; + _out << nl << "ostr_.startException(iceSlicedData);"; + _out << nl << "iceWriteImpl(ostr_);"; + _out << nl << "ostr_.endException();"; _out << eb; _out << sp; emitGeneratedCodeAttribute(); - _out << nl << "public override void read__(Ice.InputStream is__)"; + _out << nl << "public override void iceRead(Ice.InputStream istr_)"; _out << sb; - _out << nl << "is__.startException();"; - _out << nl << "readImpl__(is__);"; - _out << nl << "slicedData__ = is__.endException(true);"; + _out << nl << "istr_.startException();"; + _out << nl << "iceReadImpl(istr_);"; + _out << nl << "iceSlicedData = istr_.endException(true);"; _out << eb; } _out << sp; emitGeneratedCodeAttribute(); - _out << nl << "protected override void writeImpl__(Ice.OutputStream os__)"; + _out << nl << "protected override void iceWriteImpl(Ice.OutputStream ostr_)"; _out << sb; - _out << nl << "os__.startSlice(\"" << scoped << "\", -1, " << (!base ? "true" : "false") << ");"; + _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)); + writeMarshalDataMember(*q, fixId((*q)->name(), DotNet::Exception), "ostr_"); } - _out << nl << "os__.endSlice();"; + _out << nl << "ostr_.endSlice();"; if(base) { - _out << nl << "base.writeImpl__(os__);"; + _out << nl << "base.iceWriteImpl(ostr_);"; } _out << eb; @@ -2944,9 +2949,9 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) { _out << "new "; } - _out << "class Patcher__"; + _out << "class Patcher_"; _out << sb; - _out << sp << nl << "internal Patcher__(string type, Ice.Exception instance"; + _out << sp << nl << "internal Patcher_(string type, Ice.Exception instance"; if(classMembers.size() > 1) { _out << ", int member"; @@ -3082,20 +3087,20 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) _out << sp; emitGeneratedCodeAttribute(); - _out << nl << "protected override void readImpl__(Ice.InputStream is__)"; + _out << nl << "protected override void iceReadImpl(Ice.InputStream istr_)"; _out << sb; - _out << nl << "is__.startSlice();"; + _out << nl << "istr_.startSlice();"; int patchIter = 0; 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); + writeUnmarshalDataMember(*q, fixId((*q)->name(), DotNet::Exception), needCustomPatcher, patchIter, "istr_"); } - _out << nl << "is__.endSlice();"; + _out << nl << "istr_.endSlice();"; if(base) { - _out << nl << "base.readImpl__(is__);"; + _out << nl << "base.iceReadImpl(istr_);"; } _out << eb; @@ -3103,7 +3108,7 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) { _out << sp; emitGeneratedCodeAttribute(); - _out << nl << "public override bool usesClasses__()"; + _out << nl << "public override bool iceUsesClasses()"; _out << sb; _out << nl << "return true;"; _out << eb; @@ -3111,7 +3116,7 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) if(preserved && !basePreserved) { - _out << sp << nl << "protected Ice.SlicedData slicedData__;"; + _out << sp << nl << "protected Ice.SlicedData iceSlicedData;"; } _out << sp << nl << "#endregion"; // Marshalling support @@ -3223,7 +3228,7 @@ Slice::Gen::TypesVisitor::visitStructEnd(const StructPtr& p) _out << nl << "this."; if(propertyMapping) { - _out << (*q)->name() << "__prop"; + _out << "_" + (*q)->name(); } else { @@ -3255,41 +3260,41 @@ Slice::Gen::TypesVisitor::visitStructEnd(const StructPtr& p) emitGeneratedCodeAttribute(); _out << nl << "public override int GetHashCode()"; _out << sb; - _out << nl << "int h__ = 5381;"; - _out << nl << "IceInternal.HashUtil.hashAdd(ref h__, \"" << p->scoped() << "\");"; + _out << nl << "int h_ = 5381;"; + _out << nl << "IceInternal.HashUtil.hashAdd(ref h_, \"" << p->scoped() << "\");"; writeMemberHashCode(dataMembers, isClass ? DotNet::ICloneable : 0); - _out << nl << "return h__;"; + _out << nl << "return h_;"; _out << eb; _out << sp; emitGeneratedCodeAttribute(); - _out << nl << "public override bool Equals(object other__)"; + _out << nl << "public override bool Equals(object other)"; _out << sb; if(isClass) { - _out << nl << "if(object.ReferenceEquals(this, other__))"; + _out << nl << "if(object.ReferenceEquals(this, other))"; _out << sb; _out << nl << "return true;"; _out << eb; } if(isClass) { - _out << nl << "if(other__ == null)"; + _out << nl << "if(other == null)"; _out << sb; _out << nl << "return false;"; _out << eb; - _out << nl << "if(GetType() != other__.GetType())"; + _out << nl << "if(GetType() != other.GetType())"; } else { - _out << nl << "if(!(other__ is " << name << "))"; + _out << nl << "if(!(other is " << name << "))"; } _out << sb; _out << nl << "return false;"; _out << eb; if(!dataMembers.empty()) { - _out << nl << name << " o__ = (" << name << ")other__;"; + _out << nl << name << " o = (" << name << ")other;"; } writeMemberEquals(dataMembers, isClass ? DotNet::ICloneable : 0); _out << nl << "return true;"; @@ -3301,31 +3306,31 @@ Slice::Gen::TypesVisitor::visitStructEnd(const StructPtr& p) _out << sp; emitGeneratedCodeAttribute(); - _out << nl << "public static bool operator==(" << name << " lhs__, " << name << " rhs__)"; + _out << nl << "public static bool operator==(" << name << " lhs, " << name << " rhs)"; _out << sb; - _out << nl << "return Equals(lhs__, rhs__);"; + _out << nl << "return Equals(lhs, rhs);"; _out << eb; _out << sp; emitGeneratedCodeAttribute(); - _out << nl << "public static bool operator!=(" << name << " lhs__, " << name << " rhs__)"; + _out << nl << "public static bool operator!=(" << name << " lhs, " << name << " rhs)"; _out << sb; - _out << nl << "return !Equals(lhs__, rhs__);"; + _out << nl << "return !Equals(lhs, rhs);"; _out << eb; _out << sp << nl << "#endregion"; // Comparison members if(!p->isLocal()) { - _out << sp << nl << "#region Marshalling support"; + _out << sp << nl << "#region Marshaling support"; _out << sp; emitGeneratedCodeAttribute(); - _out << nl << "public void write__(Ice.OutputStream os__)"; + _out << nl << "public void iceWrite(Ice.OutputStream ostr_)"; _out << sb; for(DataMemberList::const_iterator q = dataMembers.begin(); q != dataMembers.end(); ++q) { - writeMarshalDataMember(*q, fixId(*q, isClass ? DotNet::ICloneable : 0)); + writeMarshalDataMember(*q, fixId(*q, isClass ? DotNet::ICloneable : 0), "ostr_"); } _out << eb; @@ -3333,9 +3338,9 @@ Slice::Gen::TypesVisitor::visitStructEnd(const StructPtr& p) { _out << sp; emitGeneratedCodeAttribute(); - _out << nl << "public sealed class Patcher__"; + _out << nl << "public sealed class Patcher_"; _out << sb; - _out << sp << nl << "internal Patcher__(string type, " << name << " instance"; + _out << sp << nl << "internal Patcher_(string type, " << name << " instance"; if(classMembers.size() > 1) { _out << ", int member"; @@ -3406,50 +3411,50 @@ Slice::Gen::TypesVisitor::visitStructEnd(const StructPtr& p) _out << sp; emitGeneratedCodeAttribute(); - _out << nl << "public void read__(Ice.InputStream is__)"; + _out << nl << "public void iceRead(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); + patchIter, "istr_"); } _out << eb; _out << sp; emitGeneratedCodeAttribute(); - _out << nl << "public static void write(Ice.OutputStream os__, " << name << " v__)"; + _out << nl << "public static void write(Ice.OutputStream ostr, " << name << " v)"; _out << sb; if(isClass) { - _out << nl << "if(v__ == null)"; + _out << nl << "if(v == null)"; _out << sb; - _out << nl << "nullMarshalValue__.write__(os__);"; + _out << nl << "_nullMarshalValue.iceWrite(ostr);"; _out << eb; _out << nl << "else"; _out << sb; - _out << nl << "v__.write__(os__);"; + _out << nl << "v.iceWrite(ostr);"; _out << eb; } else { - _out << nl << "v__.write__(os__);"; + _out << nl << "v.iceWrite(ostr);"; } _out << eb; _out << sp; emitGeneratedCodeAttribute(); - _out << nl << "public static " << name << " read(Ice.InputStream is__)"; + _out << nl << "public static " << name << " read(Ice.InputStream istr)"; _out << sb; - _out << nl << name << " v__ = new " << name << "();"; - _out << nl << "v__.read__(is__);"; - _out << nl << "return v__;"; + _out << nl << name << " v = new " << name << "();"; + _out << nl << "v.iceRead(istr);"; + _out << nl << "return v;"; _out << eb; if(isClass) { - _out << nl << nl << "private static readonly " << name << " nullMarshalValue__ = new " << name << "();"; + _out << nl << nl << "private static readonly " << name << " _nullMarshalValue = new " << name << "();"; } _out << sp << nl << "#endregion"; // Marshalling support } @@ -3497,18 +3502,18 @@ Slice::Gen::TypesVisitor::visitEnum(const EnumPtr& p) _out << nl << "public sealed class " << p->name() << "Helper"; _out << sb; _out << sp; - _out << nl << "public static void write(Ice.OutputStream os__, " << name << " v__)"; + _out << nl << "public static void write(Ice.OutputStream ostr, " << name << " v)"; _out << sb; - writeMarshalUnmarshalCode(_out, p, "v__", true); + writeMarshalUnmarshalCode(_out, p, "v", true); _out << eb; _out << sp; emitGeneratedCodeAttribute(); - _out << nl << "public static " << name << " read(Ice.InputStream is__)"; + _out << nl << "public static " << name << " read(Ice.InputStream istr)"; _out << sb; - _out << nl << name << " v__;"; - writeMarshalUnmarshalCode(_out, p, "v__", false); - _out << nl << "return v__;"; + _out << nl << name << " v;"; + writeMarshalUnmarshalCode(_out, p, "v", false); + _out << nl << "return v;"; _out << eb; _out << eb; @@ -3586,7 +3591,7 @@ Slice::Gen::TypesVisitor::visitDataMember(const DataMemberPtr& p) string dataMemberName; if(isProperty) { - dataMemberName = p->name() + "__prop"; + dataMemberName = "_" + p->name(); } else { @@ -3647,7 +3652,7 @@ Slice::Gen::TypesVisitor::writeMemberHashCode(const DataMemberList& dataMembers, { for(DataMemberList::const_iterator q = dataMembers.begin(); q != dataMembers.end(); ++q) { - _out << nl << "IceInternal.HashUtil.hashAdd(ref h__, " << fixId((*q)->name(), baseTypes); + _out << nl << "IceInternal.HashUtil.hashAdd(ref h_, " << fixId((*q)->name(), baseTypes); if((*q)->optional()) { _out << ".Value"; @@ -3665,9 +3670,9 @@ Slice::Gen::TypesVisitor::writeMemberEquals(const DataMemberList& dataMembers, i TypePtr memberType = (*q)->type(); if(!(*q)->optional() && !isValueType(memberType)) { - _out << nl << "if(" << memberName << " == null)"; + _out << nl << "if(this." << memberName << " == null)"; _out << sb; - _out << nl << "if(o__." << memberName << " != null)"; + _out << nl << "if(o." << memberName << " != null)"; _out << sb; _out << nl << "return false;"; _out << eb; @@ -3686,14 +3691,14 @@ Slice::Gen::TypesVisitor::writeMemberEquals(const DataMemberList& dataMembers, i // // Equals() for native arrays does not have value semantics. // - _out << nl << "if(!IceUtilInternal.Arrays.Equals(" << memberName << ", o__." << memberName << "))"; + _out << nl << "if(!IceUtilInternal.Arrays.Equals(this." << memberName << ", o." << memberName << "))"; } else if(isGeneric) { // // Equals() for generic types does not have value semantics. // - _out << nl << "if(!IceUtilInternal.Collections.SequenceEquals(" << memberName << ", o__." + _out << nl << "if(!IceUtilInternal.Collections.SequenceEquals(this." << memberName << ", o." << memberName << "))"; } } @@ -3705,12 +3710,12 @@ Slice::Gen::TypesVisitor::writeMemberEquals(const DataMemberList& dataMembers, i // // Equals() for generic types does not have value semantics. // - _out << nl << "if(!IceUtilInternal.Collections.DictionaryEquals(" << memberName << ", o__." + _out << nl << "if(!IceUtilInternal.Collections.DictionaryEquals(this." << memberName << ", o." << memberName << "))"; } else { - _out << nl << "if(!" << memberName << ".Equals(o__." << memberName << "))"; + _out << nl << "if(!this." << memberName << ".Equals(o." << memberName << "))"; } } _out << sb; @@ -3720,7 +3725,7 @@ Slice::Gen::TypesVisitor::writeMemberEquals(const DataMemberList& dataMembers, i } else { - _out << nl << "if(!" << memberName << ".Equals(o__." << memberName << "))"; + _out << nl << "if(!this." << memberName << ".Equals(o." << memberName << "))"; _out << sb; _out << nl << "return false;"; _out << eb; @@ -3852,21 +3857,21 @@ Slice::Gen::ResultVisitor::visitOperation(const OperationPtr& p) // // One shot constructor // - _out << nl << "public " << name << spar << getOutParams(p, true, false) << "Ice.Current current__" << epar; + _out << nl << "public " << name << spar << getOutParams(p, true, false) << "Ice.Current current" << epar; _out << sb; - _out << nl << "os__ = IceInternal.Incoming.createResponseOutputStream(current__);"; - _out << nl << "os__.startEncapsulation(current__.encoding, " << opFormatTypeToString(p) << ");"; - writeMarshalUnmarshalParams(outParams, p, true); + _out << nl << "_ostr = IceInternal.Incoming.createResponseOutputStream(current);"; + _out << nl << "_ostr.startEncapsulation(current.encoding, " << opFormatTypeToString(p) << ");"; + writeMarshalUnmarshalParams(outParams, p, true, false, true, "_ostr"); if(p->returnsClasses(false)) { - _out << nl << "os__.writePendingValues();"; + _out << nl << "_ostr.writePendingValues();"; } - _out << nl << "os__.endEncapsulation();"; + _out << nl << "_ostr.endEncapsulation();"; _out << eb; _out << sp; _out << nl << "public Ice.OutputStream getOutputStream(Ice.Current current)"; _out << sb; - _out << nl << "if(os__ == null)"; + _out << nl << "if(_ostr == null)"; _out << sb; _out << nl << "return new " << name << spar; if(ret) @@ -3879,10 +3884,10 @@ Slice::Gen::ResultVisitor::visitOperation(const OperationPtr& p) } _out << "current" << epar << ".getOutputStream(current);"; _out << eb; - _out << nl << "return os__;"; + _out << nl << "return _ostr;"; _out << eb; _out << sp; - _out << nl << "private Ice.OutputStream os__;"; + _out << nl << "private Ice.OutputStream _ostr;"; _out << eb; } } @@ -4014,7 +4019,7 @@ Slice::Gen::ProxyVisitor::visitOperation(const OperationPtr& p) string context = getEscapedParamName(inParamDecls, "context"); string callback = getEscapedParamName(inParamDecls, "callback"); string cookie = getEscapedParamName(inParamDecls, "cookie"); - string result = getEscapedParamName(inParamDecls, "result"); + string asyncResult = getEscapedParamName(p->outParameters(), "asyncResult"); _out << sp; writeDocCommentAMI(p, InParam, deprecateReason, @@ -4057,13 +4062,13 @@ Slice::Gen::ProxyVisitor::visitOperation(const OperationPtr& p) // _out << sp; writeDocCommentAMI(p, OutParam, deprecateReason, - "<param name=\"" + result + "\">The asynchronous result object for the invocation.</param>"); + "<param name=\"" + asyncResult + "\">The asynchronous result object for the invocation.</param>"); if(!deprecateReason.empty()) { _out << nl << "[_System.Obsolete(\"" << deprecateReason << "\")]"; } _out << nl << retS << " end_" << p->name() << spar << getOutParams(p, false, true) - << "Ice.AsyncResult " + result << epar << ';'; + << "Ice.AsyncResult " + asyncResult << epar << ';'; } } @@ -4119,7 +4124,7 @@ Slice::Gen::AsyncDelegateVisitor::visitOperation(const OperationPtr& p) _out << nl << "public delegate void " << delName << spar; if(p->returnType()) { - _out << retS + " ret__"; + _out << retS + " ret"; } _out << paramDeclAMI << epar << ';'; } @@ -4270,8 +4275,8 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) _out << eb; _out << sp; - _out << nl << "public " << name << "PrxHelper(_System.Runtime.Serialization.SerializationInfo info__, " - << "_System.Runtime.Serialization.StreamingContext context__) : base(info__, context__)"; + _out << nl << "public " << name << "PrxHelper(_System.Runtime.Serialization.SerializationInfo info, " + << "_System.Runtime.Serialization.StreamingContext context) : base(info, context)"; _out << sb; _out << eb; @@ -4334,14 +4339,14 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) } else if(ret || outParams.size() > 1) { - _out << "var result__ = "; + _out << "var result_ = "; } else { _out << fixId(outParams.front()->name()) << " = "; } } - _out << op->name() << "Async" << spar << argsAMI << context + _out << "_iceI_" << op->name() << "Async" << spar << argsAMI << context << "null" << "_System.Threading.CancellationToken.None" << "true" << epar; if(ret || outParams.size() > 0) @@ -4358,18 +4363,18 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) for(ParamDeclList::const_iterator i = outParams.begin(); i != outParams.end(); ++i) { ParamDeclPtr param = *i; - _out << nl << fixId(param->name()) << " = result__." << fixId(param->name()) << ";"; + _out << nl << fixId(param->name()) << " = result_." << fixId(param->name()) << ";"; } if(ret) { - _out << nl << "return result__." << resultStructReturnValueName(outParams) << ";"; + _out << nl << "return result_." << resultStructReturnValueName(outParams) << ";"; } } _out << eb; - _out << nl << "catch(_System.AggregateException ex__)"; + _out << nl << "catch(_System.AggregateException ex_)"; _out << sb; - _out << nl << "throw ex__.InnerException;"; + _out << nl << "throw ex_.InnerException;"; _out << eb; _out << eb; } @@ -4439,7 +4444,7 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) << epar; _out << sb; - _out << nl << "return " << opName << "Async" << spar << argsAMI + _out << nl << "return _iceI_" << opName << "Async" << spar << argsAMI << context << progress << cancel << "false" << epar << ";"; _out << eb; @@ -4452,73 +4457,73 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) { _out << "<" << returnTypeS << ">"; } - _out << " " << opName << "Async" << spar << paramsAMI - << "Ice.OptionalContext context__" - << "_System.IProgress<bool> progress__" - << "_System.Threading.CancellationToken cancel__" - << "bool synchronous__" << epar; + _out << " _iceI_" << opName << "Async" << spar << getInParams(op, true) + << "Ice.OptionalContext context" + << "_System.IProgress<bool> progress" + << "_System.Threading.CancellationToken cancel" + << "bool synchronous" << epar; _out << sb; if(returnTypeS.empty()) { - _out << nl << "var completed__ = " - << "new IceInternal.OperationTaskCompletionCallback<object>(progress__, cancel__);"; + _out << nl << "var completed = " + << "new IceInternal.OperationTaskCompletionCallback<object>(progress, cancel);"; } else { - _out << nl << "var completed__ = " - << "new IceInternal.OperationTaskCompletionCallback<" << returnTypeS << ">(progress__, cancel__);"; + _out << nl << "var completed = " + << "new IceInternal.OperationTaskCompletionCallback<" << returnTypeS << ">(progress, cancel);"; } - _out << nl << opName << "___" << spar << argsAMI << "context__" << "synchronous__" << "completed__" + _out << nl << "_iceI_" << opName << spar << getInArgs(op, true) << "context" << "synchronous" << "completed" << epar << ";"; - _out << nl << "return completed__.Task;"; + _out << nl << "return completed.Task;"; _out << eb; - string flatName = "__" + opName + "_name"; + string flatName = "_" + opName + "_name"; _out << sp << nl << "private const string " << flatName << " = \"" << op->name() << "\";"; // // Write the common invoke method // _out << sp << nl; - _out << "private void " << op->name() << "___" << spar << paramsAMI - << "_System.Collections.Generic.Dictionary<string, string> ctx__" - << "bool synchronous__" - << "IceInternal.OutgoingAsyncCompletionCallback completed__" << epar; + _out << "private void _iceI_" << op->name() << spar << getInParams(op, true) + << "_System.Collections.Generic.Dictionary<string, string> context" + << "bool synchronous" + << "IceInternal.OutgoingAsyncCompletionCallback completed" << epar; _out << sb; if(op->returnsData()) { - _out << nl << "checkAsyncTwowayOnly__(" << flatName << ");"; + _out << nl << "iceCheckAsyncTwowayOnly(" << flatName << ");"; } if(returnTypeS.empty()) { - _out << nl << "var outAsync__ = getOutgoingAsync<object>(completed__);"; + _out << nl << "var outAsync = getOutgoingAsync<object>(completed);"; } else { - _out << nl << "var outAsync__ = getOutgoingAsync<" << returnTypeS << ">(completed__);"; + _out << nl << "var outAsync = getOutgoingAsync<" << returnTypeS << ">(completed);"; } - _out << nl << "outAsync__.invoke("; + _out << nl << "outAsync.invoke("; _out.inc(); _out << nl << flatName << ","; _out << nl << sliceModeToIceMode(op->sendMode()) << ","; _out << nl << opFormatTypeToString(op) << ","; - _out << nl << "ctx__,"; - _out << nl << "synchronous__"; + _out << nl << "context,"; + _out << nl << "synchronous"; if(!inParams.empty()) { _out << ","; - _out << nl << "write: (Ice.OutputStream os__) =>"; + _out << nl << "write: (Ice.OutputStream ostr) =>"; _out << sb; writeMarshalUnmarshalParams(inParams, 0, true); if(op->sendsClasses(false)) { - _out << nl << "os__.writePendingValues();"; + _out << nl << "ostr.writePendingValues();"; } _out << eb; } @@ -4554,11 +4559,11 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) if(ret || !outParams.empty()) { _out << ","; - _out << nl << "read: (Ice.InputStream is__) =>"; + _out << nl << "read: (Ice.InputStream istr) =>"; _out << sb; if(outParams.empty()) { - _out << nl << returnTypeS << " ret__"; + _out << nl << returnTypeS << " ret"; if(!op->returnIsOptional() && !isClassType(ret) && StructPtr::dynamicCast(ret)) { _out << " = " << (isValueType(StructPtr::dynamicCast(ret)) ? ("new " + returnTypeS + "()") : "null"); @@ -4567,12 +4572,12 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) } else if(ret || outParams.size() > 1) { - _out << nl << returnTypeS << " ret__ = new " << returnTypeS << "();"; + _out << nl << returnTypeS << " ret = new " << returnTypeS << "();"; } else { TypePtr t = outParams.front()->type(); - _out << nl << typeToString(t, (outParams.front()->optional())) << " " << fixId(outParams.front()->name()); + _out << nl << typeToString(t, (outParams.front()->optional())) << " iceP_" << outParams.front()->name(); if(!outParams.front()->optional() && !isClassType(t) && StructPtr::dynamicCast(t)) { _out << " = " << (isValueType(StructPtr::dynamicCast(t)) ? ("new " + returnTypeS + "()") : "null"); @@ -4583,18 +4588,18 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) writeMarshalUnmarshalParams(outParams, op, false, true); if(op->returnsClasses(false)) { - _out << nl << "is__.readPendingValues();"; + _out << nl << "istr.readPendingValues();"; } writePostUnmarshalParams(outParams, op); if(!ret && outParams.size() == 1) { - _out << nl << "return " << fixId(outParams.front()->name()) << ";"; + _out << nl << "return iceP_" << outParams.front()->name() << ";"; } else { - _out << nl << "return ret__;"; + _out << nl << "return ret;"; } _out << eb; } @@ -4631,67 +4636,73 @@ 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"); + _out << sp; _out << nl << "public Ice.AsyncResult<" << delType << "> begin_" << opName << spar << paramsAMI - << ("Ice.OptionalContext ctx__ = new Ice.OptionalContext()") << epar; + << "Ice.OptionalContext " + context + " = new Ice.OptionalContext()" << epar; _out << sb; - _out << nl << "return begin_" << opName << spar << argsAMI << "ctx__" << "null" << "null" << "false" + _out << nl << "return begin_" << opName << spar << argsAMI << context << "null" << "null" << "false" << epar << ';'; _out << eb; _out << sp; _out << nl << "public Ice.AsyncResult begin_" << opName << spar << paramsAMI - << "Ice.AsyncCallback cb__" << "object cookie__" << epar; + << "Ice.AsyncCallback " + callback << "object " + cookie << epar; _out << sb; - _out << nl << "return begin_" << opName << spar << argsAMI << "new Ice.OptionalContext()" << "cb__" - << "cookie__" << "false" << epar << ';'; + _out << nl << "return begin_" << opName << spar << argsAMI << "new Ice.OptionalContext()" << callback + << cookie << "false" << epar << ';'; _out << eb; _out << sp; _out << nl << "public Ice.AsyncResult begin_" << opName << spar << paramsAMI - << "Ice.OptionalContext ctx__" << "Ice.AsyncCallback cb__" - << "object cookie__" << epar; + << "Ice.OptionalContext " + context << "Ice.AsyncCallback " + callback + << "object " + cookie << epar; _out << sb; - _out << nl << "return begin_" << opName << spar << argsAMI << "ctx__" << "cb__" - << "cookie__" << "false" << epar << ';'; + _out << nl << "return begin_" << opName << spar << argsAMI << context << callback + << cookie << "false" << epar << ';'; _out << eb; // // Write the end_ method. // - string flatName = "__" + opName + "_name"; + string flatName = "_" + opName + "_name"; + string asyncResult = getEscapedParamName(outParams, "asyncResult"); + _out << sp << nl << "public " << retS << " end_" << opName << spar << getOutParams(op, false, true) - << "Ice.AsyncResult r__" << epar; + << "Ice.AsyncResult " + asyncResult << epar; _out << sb; - _out << nl << "var resultI__ = IceInternal.AsyncResultI.check(r__, this, " << flatName << ");"; + _out << nl << "var resultI_ = IceInternal.AsyncResultI.check(" + asyncResult + ", this, " << flatName << ");"; if(returnTypeS.empty()) { - _out << nl << "((IceInternal.OutgoingAsyncT<object>)resultI__.OutgoingAsync).result__(resultI__.wait());"; + _out << nl << "((IceInternal.OutgoingAsyncT<object>)resultI_.OutgoingAsync).getResult(resultI_.wait());"; } else { - _out << nl << "var outgoing__ = (IceInternal.OutgoingAsyncT<" << returnTypeS << ">)resultI__.OutgoingAsync;"; + _out << nl << "var outgoing_ = (IceInternal.OutgoingAsyncT<" << returnTypeS << ">)resultI_.OutgoingAsync;"; if(outParams.empty()) { - _out << nl << "return outgoing__.result__(resultI__.wait());"; + _out << nl << "return outgoing_.getResult(resultI_.wait());"; } else if(!ret && outParams.size() == 1) { - _out << nl << fixId(outParams.front()->name()) << " = outgoing__.result__(resultI__.wait());"; + _out << nl << fixId(outParams.front()->name()) << " = outgoing_.getResult(resultI_.wait());"; } else { - _out << nl << "var result__ = outgoing__.result__(resultI__.wait());"; + _out << nl << "var result_ = outgoing_.getResult(resultI_.wait());"; for(ParamDeclList::const_iterator i = outParams.begin(); i != outParams.end(); ++i) { - _out << nl << fixId((*i)->name()) << " = result__." << fixId((*i)->name()) << ";"; + _out << nl << fixId((*i)->name()) << " = result_." << fixId((*i)->name()) << ";"; } if(ret) { - _out << nl << "return result__." << resultStructReturnValueName(outParams) << ";"; + _out << nl << "return result_." << resultStructReturnValueName(outParams) << ";"; } } } @@ -4701,13 +4712,13 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) // Write the common begin_ implementation. // _out << sp; - _out << nl << "private Ice.AsyncResult<" << delType << "> begin_" << opName << spar << paramsAMI - << "_System.Collections.Generic.Dictionary<string, string> ctx__" - << "Ice.AsyncCallback completedCallback__" << "object cookie__" << "bool synchronous__" + _out << nl << "private Ice.AsyncResult<" << delType << "> begin_" << opName << spar << getInParams(op, true) + << "_System.Collections.Generic.Dictionary<string, string> context" + << "Ice.AsyncCallback completedCallback" << "object cookie" << "bool synchronous" << epar; _out << sb; - _out << nl << "var completed__ = new IceInternal.OperationAsyncResultCompletionCallback<" << delType; + _out << nl << "var completed = new IceInternal.OperationAsyncResultCompletionCallback<" << delType; _out << ", " << (returnTypeS.empty() ? "object" : returnTypeS); _out << ">("; @@ -4715,38 +4726,38 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) // Write the completed callback // _out.inc(); - _out << nl << "(" << delType << " cb__, " << (returnTypeS.empty() ? "object" : returnTypeS) << " ret__) =>"; + _out << nl << "(" << delType << " cb, " << (returnTypeS.empty() ? "object" : returnTypeS) << " ret) =>"; _out << sb; - _out << nl << "if(cb__ != null)"; + _out << nl << "if(cb != null)"; _out << sb; - _out << nl << "cb__.Invoke" << spar; + _out << nl << "cb.Invoke" << spar; if(ret && outParams.empty()) { - _out << "ret__"; + _out << "ret"; } else if(ret || outParams.size() > 1) { if(ret) { - _out << "ret__." + resultStructReturnValueName(outParams); + _out << "ret." + resultStructReturnValueName(outParams); } for(ParamDeclList::const_iterator pli = outParams.begin(); pli != outParams.end(); ++pli) { - _out << "ret__." + fixId((*pli)->name()); + _out << "ret." + fixId((*pli)->name()); } } else if(!outParams.empty()) { - _out << "ret__"; + _out << "ret"; } _out << epar << ';'; _out << eb; _out << eb << ","; - _out << nl << "this, " << flatName << ", cookie__, completedCallback__);"; + _out << nl << "this, " << flatName << ", cookie, completedCallback);"; _out.dec(); - _out << nl << op->name() << "___" << spar << argsAMI << "ctx__" << "synchronous__" << "completed__" << epar << ";"; - _out << nl << "return completed__;"; + _out << nl << "_iceI_" << op->name() << spar << getInArgs(op, true) << "context" << "synchronous" << "completed" << epar << ";"; + _out << nl << "return completed;"; _out << eb; } _out << sp << nl << "#endregion"; // Asynchronous operations @@ -4762,7 +4773,7 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) _out << nl << "if((r == null) && b.ice_isA(ice_staticId()))"; _out << sb; _out << nl << name << "PrxHelper h = new " << name << "PrxHelper();"; - _out << nl << "h.copyFrom__(b);"; + _out << nl << "h.iceCopyFrom(b);"; _out << nl << "r = h;"; _out << eb; _out << nl << "return r;"; @@ -4779,7 +4790,7 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) _out << nl << "if((r == null) && b.ice_isA(ice_staticId(), ctx))"; _out << sb; _out << nl << name << "PrxHelper h = new " << name << "PrxHelper();"; - _out << nl << "h.copyFrom__(b);"; + _out << nl << "h.iceCopyFrom(b);"; _out << nl << "r = h;"; _out << eb; _out << nl << "return r;"; @@ -4797,7 +4808,7 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) _out << nl << "if(bb.ice_isA(ice_staticId()))"; _out << sb; _out << nl << name << "PrxHelper h = new " << name << "PrxHelper();"; - _out << nl << "h.copyFrom__(bb);"; + _out << nl << "h.iceCopyFrom(bb);"; _out << nl << "return h;"; _out << eb; _out << eb; @@ -4821,7 +4832,7 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) _out << nl << "if(bb.ice_isA(ice_staticId(), ctx))"; _out << sb; _out << nl << name << "PrxHelper h = new " << name << "PrxHelper();"; - _out << nl << "h.copyFrom__(bb);"; + _out << nl << "h.iceCopyFrom(bb);"; _out << nl << "return h;"; _out << eb; _out << eb; @@ -4841,7 +4852,7 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) _out << nl << "if(r == null)"; _out << sb; _out << nl << name << "PrxHelper h = new " << name << "PrxHelper();"; - _out << nl << "h.copyFrom__(b);"; + _out << nl << "h.iceCopyFrom(b);"; _out << nl << "r = h;"; _out << eb; _out << nl << "return r;"; @@ -4855,7 +4866,7 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) _out << eb; _out << nl << "Ice.ObjectPrx bb = b.ice_facet(f);"; _out << nl << name << "PrxHelper h = new " << name << "PrxHelper();"; - _out << nl << "h.copyFrom__(bb);"; + _out << nl << "h.iceCopyFrom(bb);"; _out << nl << "return h;"; _out << eb; @@ -4875,7 +4886,10 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) assert(scopedIter != ids.end()); StringList::difference_type scopedPos = IceUtilInternal::distance(firstIter, scopedIter); - _out << sp << nl << "public static readonly string[] ids__ ="; + // + // Need static-readonly for arrays in C# (not const) + // + _out << sp << nl << "private static readonly string[] _ids ="; _out << sb; { @@ -4893,25 +4907,25 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) _out << sp << nl << "public static string ice_staticId()"; _out << sb; - _out << nl << "return ids__[" << scopedPos << "];"; + _out << nl << "return _ids[" << scopedPos << "];"; _out << eb; _out << sp << nl << "#endregion"; // Checked and unchecked cast operations _out << sp << nl << "#region Marshaling support"; - _out << sp << nl << "public static void write(Ice.OutputStream os__, " << name << "Prx v__)"; + _out << sp << nl << "public static void write(Ice.OutputStream ostr, " << name << "Prx v)"; _out << sb; - _out << nl << "os__.writeProxy(v__);"; + _out << nl << "ostr.writeProxy(v);"; _out << eb; - _out << sp << nl << "public static " << name << "Prx read(Ice.InputStream is__)"; + _out << sp << nl << "public static " << name << "Prx read(Ice.InputStream istr)"; _out << sb; - _out << nl << "Ice.ObjectPrx proxy = is__.readProxy();"; + _out << nl << "Ice.ObjectPrx proxy = istr.readProxy();"; _out << nl << "if(proxy != null)"; _out << sb; _out << nl << name << "PrxHelper result = new " << name << "PrxHelper();"; - _out << nl << "result.copyFrom__(proxy);"; + _out << nl << "result.iceCopyFrom(proxy);"; _out << nl << "return result;"; _out << eb; _out << nl << "return null;"; @@ -4946,16 +4960,16 @@ Slice::Gen::HelperVisitor::visitSequence(const SequencePtr& p) _out << nl << "public sealed class " << p->name() << "Helper"; _out << sb; - _out << sp << nl << "public static void write(Ice.OutputStream os__, " << typeS << " v__)"; + _out << sp << nl << "public static void write(Ice.OutputStream ostr, " << typeS << " v)"; _out << sb; - writeSequenceMarshalUnmarshalCode(_out, p, "v__", true, false); + writeSequenceMarshalUnmarshalCode(_out, p, "v", true, false); _out << eb; - _out << sp << nl << "public static " << typeS << " read(Ice.InputStream is__)"; + _out << sp << nl << "public static " << typeS << " read(Ice.InputStream istr)"; _out << sb; - _out << nl << typeS << " v__;"; - writeSequenceMarshalUnmarshalCode(_out, p, "v__", false, false); - _out << nl << "return v__;"; + _out << nl << typeS << " v;"; + writeSequenceMarshalUnmarshalCode(_out, p, "v", false, false); + _out << nl << "return v;"; _out << eb; _out << eb; @@ -5030,23 +5044,23 @@ Slice::Gen::HelperVisitor::visitDictionary(const DictionaryPtr& p) _out << sp << nl << "public static void write("; _out.useCurrentPosAsIndent(); - _out << "Ice.OutputStream os__,"; - _out << nl << name << " v__)"; + _out << "Ice.OutputStream ostr,"; + _out << nl << name << " v)"; _out.restoreIndent(); _out << sb; - _out << nl << "if(v__ == null)"; + _out << nl << "if(v == null)"; _out << sb; - _out << nl << "os__.writeSize(0);"; + _out << nl << "ostr.writeSize(0);"; _out << eb; _out << nl << "else"; _out << sb; - _out << nl << "os__.writeSize(v__.Count);"; + _out << nl << "ostr.writeSize(v.Count);"; _out << nl << "foreach(_System.Collections."; _out << "Generic.KeyValuePair<" << keyS << ", " << valueS << ">"; - _out << " e__ in v__)"; + _out << " e in v)"; _out << sb; - writeMarshalUnmarshalCode(_out, key, "e__.Key", true); - writeMarshalUnmarshalCode(_out, value, "e__.Value", true); + writeMarshalUnmarshalCode(_out, key, "e.Key", true); + writeMarshalUnmarshalCode(_out, value, "e.Value", true); _out << eb; _out << eb; _out << eb; @@ -5055,9 +5069,9 @@ Slice::Gen::HelperVisitor::visitDictionary(const DictionaryPtr& p) if(hasClassValue) { - _out << sp << nl << "public sealed class Patcher__"; + _out << sp << nl << "public sealed class Patcher_"; _out << sb; - _out << sp << nl << "internal Patcher__(string type, " << name << " m, " << keyS << " key)"; + _out << sp << nl << "internal Patcher_(string type, " << name << " m, " << keyS << " key)"; _out << sb; _out << nl << "_type = type;"; _out << nl << "_m = m;"; @@ -5089,56 +5103,56 @@ Slice::Gen::HelperVisitor::visitDictionary(const DictionaryPtr& p) _out << eb; } - _out << sp << nl << "public static " << name << " read(Ice.InputStream is__)"; + _out << sp << nl << "public static " << name << " read(Ice.InputStream istr)"; _out << sb; - _out << nl << "int sz__ = is__.readSize();"; - _out << nl << name << " r__ = new " << name << "();"; - _out << nl << "for(int i__ = 0; i__ < sz__; ++i__)"; + _out << nl << "int sz = istr.readSize();"; + _out << nl << name << " r = new " << name << "();"; + _out << nl << "for(int i = 0; i < sz; ++i)"; _out << sb; - _out << nl << keyS << " k__;"; + _out << nl << keyS << " k;"; StructPtr st = StructPtr::dynamicCast(key); if(st) { if(isValueType(st)) { - _out << nl << "k__ = new " << typeToString(key) << "();"; + _out << nl << "k = new " << typeToString(key) << "();"; } else { - _out << nl << "k__ = null;"; + _out << nl << "k = null;"; } } - writeMarshalUnmarshalCode(_out, key, "k__", false); + writeMarshalUnmarshalCode(_out, key, "k", false); string patcher; if(hasClassValue) { - patcher = "new Patcher__(" + getStaticId(value) + ", r__, k__).patch"; + patcher = "new Patcher_(" + getStaticId(value) + ", r, k).patch"; } else { - _out << nl << valueS << " v__;"; + _out << nl << valueS << " v;"; StructPtr st = StructPtr::dynamicCast(value); if(st) { if(isValueType(st)) { - _out << nl << "v__ = new " << typeToString(value) << "();"; + _out << nl << "v = new " << typeToString(value) << "();"; } else { - _out << nl << "v__ = null;"; + _out << nl << "v = null;"; } } } - writeMarshalUnmarshalCode(_out, value, hasClassValue ? patcher : "v__", false); + writeMarshalUnmarshalCode(_out, value, hasClassValue ? patcher : "v", false); if(!hasClassValue) { - _out << nl << "r__[k__] = v__;"; + _out << nl << "r[k] = v;"; } _out << eb; - _out << nl << "return r__;"; + _out << nl << "return r;"; _out << eb; _out << eb; @@ -5391,7 +5405,7 @@ Slice::Gen::BaseImplVisitor::writeOperation(const OperationPtr& op, bool comment { _out << "override "; } - _out << "void " << opName << "_async" << spar << pDecl << "Ice.Current current__ = null" << epar; + _out << "void " << opName << "_async" << spar << pDecl << "Ice.Current current = null" << epar; if(comment) { @@ -5402,7 +5416,7 @@ Slice::Gen::BaseImplVisitor::writeOperation(const OperationPtr& op, bool comment _out << sb; if(ret) { - _out << nl << typeToString(ret) << " ret__ = " << writeValue(ret) << ';'; + _out << nl << typeToString(ret) << " ret = " << writeValue(ret) << ';'; } for(ParamDeclList::const_iterator i = params.begin(); i != params.end(); ++i) { @@ -5413,10 +5427,10 @@ Slice::Gen::BaseImplVisitor::writeOperation(const OperationPtr& op, bool comment _out << nl << typeToString(type) << ' ' << name << " = " << writeValue(type) << ';'; } } - _out << nl << "cb__.ice_response" << spar; + _out << nl << "cb.ice_response" << spar; if(ret) { - _out << "ret__"; + _out << "ret"; } for(ParamDeclList::const_iterator i = params.begin(); i != params.end(); ++i) { @@ -5440,7 +5454,7 @@ Slice::Gen::BaseImplVisitor::writeOperation(const OperationPtr& op, bool comment _out << retS << ' ' << fixId(opName, DotNet::ICloneable, true) << spar << pDecls; if(!cl->isLocal()) { - _out << "Ice.Current current__ = null"; + _out << "Ice.Current current = null"; } _out << epar; if(comment) diff --git a/cpp/src/slice2cs/Gen.h b/cpp/src/slice2cs/Gen.h index 1b3096d415e..d4de81b812c 100644 --- a/cpp/src/slice2cs/Gen.h +++ b/cpp/src/slice2cs/Gen.h @@ -25,20 +25,21 @@ public: protected: - void writeMarshalUnmarshalParams(const ParamDeclList&, const OperationPtr&, bool, bool = false); + 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&); - void writeUnmarshalDataMember(const DataMemberPtr&, const std::string&, bool, int&); + void writeMarshalDataMember(const DataMemberPtr&, const std::string&, const std::string& = ""); + void writeUnmarshalDataMember(const DataMemberPtr&, const std::string&, bool, int&, const std::string& = ""); virtual void writeInheritedOperations(const ClassDefPtr&); virtual void writeDispatch(const ClassDefPtr&); virtual void writeMarshaling(const ClassDefPtr&); static std::vector<std::string> getParams(const OperationPtr&); - static std::vector<std::string> getInParams(const OperationPtr&); + static std::vector<std::string> getInParams(const OperationPtr&, bool = false); static std::vector<std::string> getOutParams(const OperationPtr&, bool, bool); static std::vector<std::string> getArgs(const OperationPtr&); - static std::vector<std::string> getInArgs(const OperationPtr&); + static std::vector<std::string> getInArgs(const OperationPtr&, bool = false); static std::string getDispatchParams(const OperationPtr&, std::string&, std::vector<std::string>&, std::vector<std::string>&); void emitAttributes(const ContainedPtr&); diff --git a/csharp/src/Glacier2/Application.cs b/csharp/src/Glacier2/Application.cs index dd7caf4f806..273ba6b5372 100644 --- a/csharp/src/Glacier2/Application.cs +++ b/csharp/src/Glacier2/Application.cs @@ -190,7 +190,7 @@ public abstract class Application : Ice.Application throw new SessionNotExistException(); } - lock(mutex__) + lock(iceMutex) { if(_adapter == null) { @@ -235,21 +235,21 @@ public abstract class Application : Ice.Application // Reset internal state variables from Ice.Application. The // remainder are reset at the end of this method. // - callbackInProgress__ = false; - destroyed__ = false; - interrupted__ = false; + iceCallbackInProgress = false; + iceDestroyed = false; + iceInterrupted = false; bool restart = false; status = 0; try { - communicator__ = Ice.Util.initialize(ref args, initData); + iceCommunicator = Ice.Util.initialize(ref args, initData); _router = Glacier2.RouterPrxHelper.uncheckedCast(communicator().getDefaultRouter()); if(_router == null) { - Ice.Util.getProcessLogger().error(appName__ + ": no Glacier2 router configured"); + Ice.Util.getProcessLogger().error(iceAppName + ": no Glacier2 router configured"); status = 1; } else @@ -257,7 +257,7 @@ public abstract class Application : Ice.Application // // The default is to destroy when a signal is received. // - if(signalPolicy__ == Ice.SignalPolicy.HandleSignals) + if(iceSignalPolicy == Ice.SignalPolicy.HandleSignals) { destroyOnInterrupt(); } @@ -353,28 +353,28 @@ public abstract class Application : Ice.Application // (post-run), it would not make sense to release a held // signal to run shutdown or destroy. // - if(signalPolicy__ == Ice.SignalPolicy.HandleSignals) + if(iceSignalPolicy == Ice.SignalPolicy.HandleSignals) { ignoreInterrupt(); } - lock(mutex__) + lock(iceMutex) { - while(callbackInProgress__) + while(iceCallbackInProgress) { - System.Threading.Monitor.Wait(mutex__); + System.Threading.Monitor.Wait(iceMutex); } - if(destroyed__) + if(iceDestroyed) { - communicator__ = null; + iceCommunicator = null; } else { - destroyed__ = true; + iceDestroyed = true; // - // And communicator__ != null, meaning will be - // destroyed next, destroyed__ = true also ensures that + // And iceCommunicator != null, meaning will be + // destroyed next, iceDestroyed = true also ensures that // any remaining callback won't do anything // } @@ -409,11 +409,11 @@ public abstract class Application : Ice.Application _router = null; } - if(communicator__ != null) + if(iceCommunicator != null) { try { - communicator__.destroy(); + iceCommunicator.destroy(); } catch(Ice.LocalException ex) { @@ -425,12 +425,12 @@ public abstract class Application : Ice.Application Ice.Util.getProcessLogger().error("unknown exception:\n" + ex.ToString()); status = 1; } - communicator__ = null; + iceCommunicator = null; } // // Reset internal state. We cannot reset the Application state - // here, since destroyed__ must remain true until we re-run + // here, since iceDestroyed must remain true until we re-run // this method. // _adapter = null; diff --git a/csharp/src/Ice/Application.cs b/csharp/src/Ice/Application.cs index b41ba4e8996..99ce8f16230 100644 --- a/csharp/src/Ice/Application.cs +++ b/csharp/src/Ice/Application.cs @@ -95,7 +95,7 @@ namespace Ice /// <param name="signalPolicy">Determines how to respond to signals.</param> public Application(SignalPolicy signalPolicy) { - signalPolicy__ = signalPolicy; + iceSignalPolicy = signalPolicy; } /// <summary> @@ -135,7 +135,7 @@ namespace Ice { if(Util.getProcessLogger() is ConsoleLoggerI) { - Util.setProcessLogger(new ConsoleLoggerI(appName__)); + Util.setProcessLogger(new ConsoleLoggerI(iceAppName)); } InitializationData initData = new InitializationData(); @@ -178,10 +178,10 @@ namespace Ice { if(Util.getProcessLogger() is ConsoleLoggerI) { - Util.setProcessLogger(new ConsoleLoggerI(appName__)); + Util.setProcessLogger(new ConsoleLoggerI(iceAppName)); } - if(communicator__ != null) + if(iceCommunicator != null) { Util.getProcessLogger().error("only one instance of the Application class can be used"); return 1; @@ -214,13 +214,13 @@ namespace Ice Util.getProcessLogger().error("unknown exception:\n" + ex); return 1; } - appName__ = initData.properties.getPropertyWithDefault("Ice.ProgramName", appName__); + iceAppName = initData.properties.getPropertyWithDefault("Ice.ProgramName", iceAppName); - nohup__ = initData.properties.getPropertyAsInt("Ice.Nohup") > 0; + iceNohup = initData.properties.getPropertyAsInt("Ice.Nohup") > 0; _application = this; int status; - if(signalPolicy__ == SignalPolicy.HandleSignals) + if(iceSignalPolicy == SignalPolicy.HandleSignals) { if(IceInternal.AssemblyUtil.platform_ == IceInternal.AssemblyUtil.Platform.Windows) { @@ -254,7 +254,7 @@ namespace Ice /// <returns>The name of the application.</returns> public static string appName() { - return appName__; + return iceAppName; } /// <summary> @@ -265,7 +265,7 @@ namespace Ice /// <returns>The communicator for the application.</returns> public static Communicator communicator() { - return communicator__; + return iceCommunicator; } /// <summary> @@ -274,14 +274,14 @@ namespace Ice /// </summary> public static void destroyOnInterrupt() { - if(signalPolicy__ == SignalPolicy.HandleSignals) + if(iceSignalPolicy == SignalPolicy.HandleSignals) { - lock(mutex__) + lock(iceMutex) { if(_callback == _holdCallback) { - released__ = true; - System.Threading.Monitor.Pulse(mutex__); + iceReleased = true; + System.Threading.Monitor.Pulse(iceMutex); } _callback = _destroyCallback; } @@ -298,14 +298,14 @@ namespace Ice /// </summary> public static void shutdownOnInterrupt() { - if(signalPolicy__ == SignalPolicy.HandleSignals) + if(iceSignalPolicy == SignalPolicy.HandleSignals) { - lock(mutex__) + lock(iceMutex) { if(_callback == _holdCallback) { - released__ = true; - System.Threading.Monitor.Pulse(mutex__); + iceReleased = true; + System.Threading.Monitor.Pulse(iceMutex); } _callback = _shutdownCallback; } @@ -322,14 +322,14 @@ namespace Ice /// </summary> public static void ignoreInterrupt() { - if(signalPolicy__ == SignalPolicy.HandleSignals) + if(iceSignalPolicy == SignalPolicy.HandleSignals) { - lock(mutex__) + lock(iceMutex) { if(_callback == _holdCallback) { - released__ = true; - System.Threading.Monitor.Pulse(mutex__); + iceReleased = true; + System.Threading.Monitor.Pulse(iceMutex); } _callback = null; } @@ -347,14 +347,14 @@ namespace Ice /// </summary> public static void callbackOnInterrupt() { - if(signalPolicy__ == SignalPolicy.HandleSignals) + if(iceSignalPolicy == SignalPolicy.HandleSignals) { - lock(mutex__) + lock(iceMutex) { if(_callback == _holdCallback) { - released__ = true; - System.Threading.Monitor.Pulse(mutex__); + iceReleased = true; + System.Threading.Monitor.Pulse(iceMutex); } _callback = _userCallback; } @@ -371,14 +371,14 @@ namespace Ice /// </summary> public static void holdInterrupt() { - if(signalPolicy__ == SignalPolicy.HandleSignals) + if(iceSignalPolicy == SignalPolicy.HandleSignals) { - lock(mutex__) + lock(iceMutex) { if(_callback != _holdCallback) { _previousCallback = _callback; - released__ = false; + iceReleased = false; _callback = _holdCallback; } // else, we were already holding signals @@ -397,22 +397,22 @@ namespace Ice /// </summary> public static void releaseInterrupt() { - if(signalPolicy__ == SignalPolicy.HandleSignals) + if(iceSignalPolicy == SignalPolicy.HandleSignals) { - lock(mutex__) + lock(iceMutex) { if(_callback == _holdCallback) { // // Note that it's very possible no signal is held; // in this case the callback is just replaced and - // setting released__ to true and signalling this + // setting iceReleased to true and signalling this // will do no harm. // - released__ = true; + iceReleased = true; _callback = _previousCallback; - System.Threading.Monitor.Pulse(mutex__); + System.Threading.Monitor.Pulse(iceMutex); } // Else nothing to release. } @@ -431,9 +431,9 @@ namespace Ice /// <returns>True if a signal caused the communicator to shut down; false otherwise.</returns> public static bool interrupted() { - lock(mutex__) + lock(iceMutex) { - return interrupted__; + return iceInterrupted; } } @@ -453,13 +453,13 @@ namespace Ice Util.setProcessLogger(new ConsoleLoggerI(initData.properties.getProperty("Ice.ProgramName"))); } - communicator__ = Util.initialize(ref args, initData); - destroyed__ = false; + iceCommunicator = Util.initialize(ref args, initData); + iceDestroyed = false; // // The default is to destroy when a signal is received. // - if(signalPolicy__ == SignalPolicy.HandleSignals) + if(iceSignalPolicy == SignalPolicy.HandleSignals) { destroyOnInterrupt(); } @@ -482,38 +482,38 @@ namespace Ice // (post-run), it would not make sense to release a held // signal to run shutdown or destroy. // - if(signalPolicy__ == SignalPolicy.HandleSignals) + if(iceSignalPolicy == SignalPolicy.HandleSignals) { ignoreInterrupt(); } - lock(mutex__) + lock(iceMutex) { - while(callbackInProgress__) + while(iceCallbackInProgress) { - System.Threading.Monitor.Wait(mutex__); + System.Threading.Monitor.Wait(iceMutex); } - if(destroyed__) + if(iceDestroyed) { - communicator__ = null; + iceCommunicator = null; } else { - destroyed__ = true; + iceDestroyed = true; // - // communicator__ != null means that it will be destroyed - // next; destroyed__ == true ensures that any + // iceCommunicator != null means that it will be destroyed + // next; iceDestroyed == true ensures that any // remaining callback won't do anything // } _application = null; } - if(communicator__ != null) + if(iceCommunicator != null) { try { - communicator__.destroy(); + iceCommunicator.destroy(); } catch(Ice.Exception ex) { @@ -525,7 +525,7 @@ namespace Ice Util.getProcessLogger().error("unknown exception:\n" + ex); status = 1; } - communicator__ = null; + iceCommunicator = null; } return status; @@ -538,7 +538,7 @@ namespace Ice { Callback callback; - lock(mutex__) + lock(iceMutex) { callback = _callback; } @@ -562,14 +562,14 @@ namespace Ice private static void holdInterruptCallback(int sig) { Callback callback = null; - lock(mutex__) + lock(iceMutex) { - while(!released__) + while(!iceReleased) { - System.Threading.Monitor.Wait(mutex__); + System.Threading.Monitor.Wait(iceMutex); } - if(destroyed__) + if(iceDestroyed) { // // Being destroyed by main thread @@ -591,86 +591,86 @@ namespace Ice // private static void destroyOnInterruptCallback(int sig) { - lock(mutex__) + lock(iceMutex) { - if(destroyed__) + if(iceDestroyed) { // // Being destroyed by main thread // return; } - if(nohup__ && sig == SIGHUP) + if(iceNohup && sig == SIGHUP) { return; } - Debug.Assert(!callbackInProgress__); - callbackInProgress__ = true; - interrupted__ = true; - destroyed__ = true; + Debug.Assert(!iceCallbackInProgress); + iceCallbackInProgress = true; + iceInterrupted = true; + iceDestroyed = true; } try { - Debug.Assert(communicator__ != null); - communicator__.destroy(); + Debug.Assert(iceCommunicator != null); + iceCommunicator.destroy(); } catch(System.Exception ex) { Util.getProcessLogger().error("(while destroying in response to signal " + sig + "):\n" + ex); } - lock(mutex__) + lock(iceMutex) { - callbackInProgress__ = false; - System.Threading.Monitor.Pulse(mutex__); + iceCallbackInProgress = false; + System.Threading.Monitor.Pulse(iceMutex); } } private static void shutdownOnInterruptCallback(int sig) { - lock(mutex__) + lock(iceMutex) { - if(destroyed__) + if(iceDestroyed) { // // Being destroyed by main thread // return; } - if(nohup__ && sig == SIGHUP) + if(iceNohup && sig == SIGHUP) { return; } - Debug.Assert(!callbackInProgress__); - callbackInProgress__ = true; - interrupted__ = true; + Debug.Assert(!iceCallbackInProgress); + iceCallbackInProgress = true; + iceInterrupted = true; } try { - Debug.Assert(communicator__ != null); - communicator__.shutdown(); + Debug.Assert(iceCommunicator != null); + iceCommunicator.shutdown(); } catch(System.Exception ex) { Util.getProcessLogger().error("(while shutting down in response to signal " + sig + "):\n" + ex); } - lock(mutex__) + lock(iceMutex) { - callbackInProgress__ = false; - System.Threading.Monitor.Pulse(mutex__); + iceCallbackInProgress = false; + System.Threading.Monitor.Pulse(iceMutex); } } private static void userCallbackOnInterruptCallback(int sig) { - lock(mutex__) + lock(iceMutex) { - if(destroyed__) + if(iceDestroyed) { // // Being destroyed by main thread @@ -679,9 +679,9 @@ namespace Ice } // For SIGHUP the user callback is always called. It can // decide what to do. - Debug.Assert(!callbackInProgress__); - callbackInProgress__ = true; - interrupted__ = true; + Debug.Assert(!iceCallbackInProgress); + iceCallbackInProgress = true; + iceInterrupted = true; } try @@ -694,20 +694,20 @@ namespace Ice Util.getProcessLogger().error("(while interrupting in response to signal " + sig + "):\n" + ex); } - lock(mutex__) + lock(iceMutex) { - callbackInProgress__ = false; - System.Threading.Monitor.Pulse(mutex__); + iceCallbackInProgress = false; + System.Threading.Monitor.Pulse(iceMutex); } } - protected static object mutex__ = new object(); - protected static bool callbackInProgress__ = false; - protected static bool destroyed__ = false; - protected static bool interrupted__ = false; - protected static bool released__ = false; - protected static bool nohup__ = false; - protected static SignalPolicy signalPolicy__ = SignalPolicy.HandleSignals; + protected static object iceMutex = new object(); + protected static bool iceCallbackInProgress = false; + protected static bool iceDestroyed = false; + protected static bool iceInterrupted = false; + protected static bool iceReleased = false; + protected static bool iceNohup = false; + protected static SignalPolicy iceSignalPolicy = SignalPolicy.HandleSignals; private delegate void Callback(int sig); private static readonly Callback _destroyCallback = new Callback(destroyOnInterruptCallback); @@ -722,8 +722,8 @@ namespace Ice // We use FriendlyName instead of Process.GetCurrentProcess().ProcessName because the latter // is terribly slow. (It takes around 1 second!) // - protected static string appName__ = AppDomain.CurrentDomain.FriendlyName; - protected static Communicator communicator__; + protected static string iceAppName = AppDomain.CurrentDomain.FriendlyName; + protected static Communicator iceCommunicator; private static Application _application; private static int SIGHUP; diff --git a/csharp/src/Ice/Collections.cs b/csharp/src/Ice/Collections.cs index 668123b1cd9..dd87ad517d4 100644 --- a/csharp/src/Ice/Collections.cs +++ b/csharp/src/Ice/Collections.cs @@ -161,11 +161,11 @@ namespace IceUtilInternal public static void Shuffle<T>(ref List<T> l) { - lock(rand_) + lock(_rand) { for(int j = 0; j < l.Count - 1; ++j) { - int r = rand_.Next(l.Count - j) + j; + int r = _rand.Next(l.Count - j) + j; Debug.Assert(r >= j && r < l.Count); if(r != j) { @@ -234,6 +234,6 @@ namespace IceUtilInternal } } - private static System.Random rand_ = new System.Random(unchecked((int)System.DateTime.Now.Ticks)); + private static System.Random _rand = new System.Random(unchecked((int)System.DateTime.Now.Ticks)); } } diff --git a/csharp/src/Ice/CommunicatorI.cs b/csharp/src/Ice/CommunicatorI.cs index d4f54bdca1d..29a1196573b 100644 --- a/csharp/src/Ice/CommunicatorI.cs +++ b/csharp/src/Ice/CommunicatorI.cs @@ -20,42 +20,42 @@ namespace Ice { public void destroy() { - instance_.destroy(); + _instance.destroy(); } public void shutdown() { - instance_.objectAdapterFactory().shutdown(); + _instance.objectAdapterFactory().shutdown(); } public void waitForShutdown() { - instance_.objectAdapterFactory().waitForShutdown(); + _instance.objectAdapterFactory().waitForShutdown(); } public bool isShutdown() { - return instance_.objectAdapterFactory().isShutdown(); + return _instance.objectAdapterFactory().isShutdown(); } public Ice.ObjectPrx stringToProxy(string s) { - return instance_.proxyFactory().stringToProxy(s); + return _instance.proxyFactory().stringToProxy(s); } public string proxyToString(Ice.ObjectPrx proxy) { - return instance_.proxyFactory().proxyToString(proxy); + return _instance.proxyFactory().proxyToString(proxy); } public Ice.ObjectPrx propertyToProxy(string s) { - return instance_.proxyFactory().propertyToProxy(s); + return _instance.proxyFactory().propertyToProxy(s); } public Dictionary<string, string> proxyToProperty(Ice.ObjectPrx proxy, string prefix) { - return instance_.proxyFactory().proxyToProperty(proxy, prefix); + return _instance.proxyFactory().proxyToProperty(proxy, prefix); } public Ice.Identity stringToIdentity(string s) @@ -65,12 +65,12 @@ namespace Ice public string identityToString(Ice.Identity ident) { - return Ice.Util.identityToString(ident, instance_.toStringMode()); + return Ice.Util.identityToString(ident, _instance.toStringMode()); } public ObjectAdapter createObjectAdapter(string name) { - return instance_.objectAdapterFactory().createObjectAdapter(name, null); + return _instance.objectAdapterFactory().createObjectAdapter(name, null); } public ObjectAdapter createObjectAdapterWithEndpoints(string name, string endpoints) @@ -81,7 +81,7 @@ namespace Ice } getProperties().setProperty(name + ".Endpoints", endpoints); - return instance_.objectAdapterFactory().createObjectAdapter(name, null); + return _instance.objectAdapterFactory().createObjectAdapter(name, null); } public ObjectAdapter createObjectAdapterWithRouter(string name, RouterPrx router) @@ -100,67 +100,67 @@ namespace Ice getProperties().setProperty(entry.Key, entry.Value); } - return instance_.objectAdapterFactory().createObjectAdapter(name, router); + return _instance.objectAdapterFactory().createObjectAdapter(name, router); } public void addObjectFactory(ObjectFactory factory, string id) { - instance_.addObjectFactory(factory, id); + _instance.addObjectFactory(factory, id); } public ObjectFactory findObjectFactory(string id) { - return instance_.findObjectFactory(id); + return _instance.findObjectFactory(id); } public ValueFactoryManager getValueFactoryManager() { - return instance_.initializationData().valueFactoryManager; + return _instance.initializationData().valueFactoryManager; } public Properties getProperties() { - return instance_.initializationData().properties; + return _instance.initializationData().properties; } public Logger getLogger() { - return instance_.initializationData().logger; + return _instance.initializationData().logger; } public Ice.Instrumentation.CommunicatorObserver getObserver() { - return instance_.initializationData().observer; + return _instance.initializationData().observer; } public RouterPrx getDefaultRouter() { - return instance_.referenceFactory().getDefaultRouter(); + return _instance.referenceFactory().getDefaultRouter(); } public void setDefaultRouter(RouterPrx router) { - instance_.setDefaultRouter(router); + _instance.setDefaultRouter(router); } public LocatorPrx getDefaultLocator() { - return instance_.referenceFactory().getDefaultLocator(); + return _instance.referenceFactory().getDefaultLocator(); } public void setDefaultLocator(LocatorPrx locator) { - instance_.setDefaultLocator(locator); + _instance.setDefaultLocator(locator); } public ImplicitContext getImplicitContext() { - return instance_.getImplicitContext(); + return _instance.getImplicitContext(); } public PluginManager getPluginManager() { - return instance_.pluginManager(); + return _instance.pluginManager(); } public void flushBatchRequests() @@ -172,8 +172,8 @@ namespace Ice CancellationToken cancel = new CancellationToken()) { var completed = new FlushBatchTaskCompletionCallback(progress, cancel); - var outgoing = new CommunicatorFlushBatchAsync(instance_, completed); - outgoing.invoke(__flushBatchRequests_name); + var outgoing = new CommunicatorFlushBatchAsync(_instance, completed); + outgoing.invoke(_flushBatchRequests_name); return completed.Task; } @@ -182,7 +182,7 @@ namespace Ice return begin_flushBatchRequests(null, null); } - private const string __flushBatchRequests_name = "flushBatchRequests"; + private const string _flushBatchRequests_name = "flushBatchRequests"; private class CommunicatorFlushBatchCompletionCallback : AsyncResultCompletionCallback { @@ -216,9 +216,9 @@ namespace Ice public AsyncResult begin_flushBatchRequests(AsyncCallback cb, object cookie) { - var result = new CommunicatorFlushBatchCompletionCallback(this, instance_, __flushBatchRequests_name, cookie, cb); - var outgoing = new CommunicatorFlushBatchAsync(instance_, result); - outgoing.invoke(__flushBatchRequests_name); + var result = new CommunicatorFlushBatchCompletionCallback(this, _instance, _flushBatchRequests_name, cookie, cb); + var outgoing = new CommunicatorFlushBatchAsync(_instance, result); + outgoing.invoke(_flushBatchRequests_name); return result; } @@ -226,42 +226,42 @@ namespace Ice { if(result != null && result.getCommunicator() != this) { - const string msg = "Communicator for call to end_" + __flushBatchRequests_name + + const string msg = "Communicator for call to end_" + _flushBatchRequests_name + " does not match communicator that was used to call corresponding begin_" + - __flushBatchRequests_name + " method"; + _flushBatchRequests_name + " method"; throw new ArgumentException(msg); } - AsyncResultI.check(result, __flushBatchRequests_name).wait(); + AsyncResultI.check(result, _flushBatchRequests_name).wait(); } public ObjectPrx createAdmin(ObjectAdapter adminAdapter, Identity adminIdentity) { - return instance_.createAdmin(adminAdapter, adminIdentity); + return _instance.createAdmin(adminAdapter, adminIdentity); } public ObjectPrx getAdmin() { - return instance_.getAdmin(); + return _instance.getAdmin(); } public void addAdminFacet(Ice.Object servant, string facet) { - instance_.addAdminFacet(servant, facet); + _instance.addAdminFacet(servant, facet); } public Ice.Object removeAdminFacet(string facet) { - return instance_.removeAdminFacet(facet); + return _instance.removeAdminFacet(facet); } public Ice.Object findAdminFacet(string facet) { - return instance_.findAdminFacet(facet); + return _instance.findAdminFacet(facet); } public Dictionary<string, Ice.Object> findAllAdminFacets() { - return instance_.findAllAdminFacets(); + return _instance.findAllAdminFacets(); } public void Dispose() @@ -271,7 +271,7 @@ namespace Ice internal CommunicatorI(InitializationData initData) { - instance_ = new IceInternal.Instance(this, initData); + _instance = new IceInternal.Instance(this, initData); } /* @@ -281,7 +281,7 @@ namespace Ice { if(!System.Environment.HasShutdownStarted) { - instance_.initializationData().logger.warning( + _instance.initializationData().logger.warning( "Ice::Communicator::destroy() has not been called"); } else @@ -300,11 +300,11 @@ namespace Ice { try { - instance_.finishSetup(ref args, this); + _instance.finishSetup(ref args, this); } catch(System.Exception) { - instance_.destroy(); + _instance.destroy(); throw; } } @@ -314,9 +314,9 @@ namespace Ice // internal IceInternal.Instance getInstance() { - return instance_; + return _instance; } - private IceInternal.Instance instance_; + private IceInternal.Instance _instance; } } diff --git a/csharp/src/Ice/ConnectRequestHandler.cs b/csharp/src/Ice/ConnectRequestHandler.cs index d53aef9513a..76fadf29fd8 100644 --- a/csharp/src/Ice/ConnectRequestHandler.cs +++ b/csharp/src/Ice/ConnectRequestHandler.cs @@ -281,7 +281,7 @@ namespace IceInternal _requestHandler = new ConnectionRequestHandler(_reference, _connection, _compress); foreach(Ice.ObjectPrxHelperBase prx in _proxies) { - prx.updateRequestHandler__(this, _requestHandler); + prx.iceUpdateRequestHandler(this, _requestHandler); } } diff --git a/csharp/src/Ice/ConnectionI.cs b/csharp/src/Ice/ConnectionI.cs index 5e0ab3afbf3..4475bb107a2 100644 --- a/csharp/src/Ice/ConnectionI.cs +++ b/csharp/src/Ice/ConnectionI.cs @@ -520,16 +520,16 @@ namespace Ice { var completed = new FlushBatchTaskCompletionCallback(progress, cancel); var outgoing = new ConnectionFlushBatchAsync(this, _instance, completed); - outgoing.invoke(__flushBatchRequests_name); + outgoing.invoke(_flushBatchRequests_name); return completed.Task; } public AsyncResult begin_flushBatchRequests(AsyncCallback cb = null, object cookie = null) { var result = new ConnectionFlushBatchCompletionCallback(this, _communicator, _instance, - __flushBatchRequests_name, cookie, cb); + _flushBatchRequests_name, cookie, cb); var outgoing = new ConnectionFlushBatchAsync(this, _instance, result); - outgoing.invoke(__flushBatchRequests_name); + outgoing.invoke(_flushBatchRequests_name); return result; } @@ -537,15 +537,15 @@ namespace Ice { if(r != null && r.getConnection() != this) { - const string msg = "Connection for call to end_" + __flushBatchRequests_name + + const string msg = "Connection for call to end_" + _flushBatchRequests_name + " does not match connection that was used to call corresponding begin_" + - __flushBatchRequests_name + " method"; + _flushBatchRequests_name + " method"; throw new ArgumentException(msg); } - AsyncResultI.check(r, __flushBatchRequests_name).wait(); + AsyncResultI.check(r, _flushBatchRequests_name).wait(); } - private const string __flushBatchRequests_name = "flushBatchRequests"; + private const string _flushBatchRequests_name = "flushBatchRequests"; public void setCloseCallback(CloseCallback callback) { @@ -1071,10 +1071,10 @@ namespace Ice } ProtocolVersion pv = new ProtocolVersion(); - pv.read__(_readStream); + pv.iceRead(_readStream); IceInternal.Protocol.checkSupportedProtocol(pv); EncodingVersion ev = new EncodingVersion(); - ev.read__(_readStream); + ev.iceRead(_readStream); IceInternal.Protocol.checkSupportedProtocolEncoding(ev); _readStream.readByte(); // messageType @@ -1949,8 +1949,8 @@ namespace Ice // OutputStream os = new OutputStream(_instance, Util.currentProtocolEncoding); os.writeBlob(IceInternal.Protocol.magic); - Ice.Util.currentProtocol.write__(os); - Ice.Util.currentProtocolEncoding.write__(os); + Ice.Util.currentProtocol.iceWrite(os); + Ice.Util.currentProtocolEncoding.iceWrite(os); os.writeByte(IceInternal.Protocol.closeConnectionMsg); os.writeByte(_compressionSupported ? (byte)1 : (byte)0); os.writeInt(IceInternal.Protocol.headerSize); // Message size. @@ -1981,8 +1981,8 @@ namespace Ice { OutputStream os = new OutputStream(_instance, Util.currentProtocolEncoding); os.writeBlob(IceInternal.Protocol.magic); - Ice.Util.currentProtocol.write__(os); - Ice.Util.currentProtocolEncoding.write__(os); + Ice.Util.currentProtocol.iceWrite(os); + Ice.Util.currentProtocolEncoding.iceWrite(os); os.writeByte(IceInternal.Protocol.validateConnectionMsg); os.writeByte((byte)0); os.writeInt(IceInternal.Protocol.headerSize); // Message size. @@ -2027,8 +2027,8 @@ namespace Ice if(_writeStream.size() == 0) { _writeStream.writeBlob(IceInternal.Protocol.magic); - Ice.Util.currentProtocol.write__(_writeStream); - Ice.Util.currentProtocolEncoding.write__(_writeStream); + Ice.Util.currentProtocol.iceWrite(_writeStream); + Ice.Util.currentProtocolEncoding.iceWrite(_writeStream); _writeStream.writeByte(IceInternal.Protocol.validateConnectionMsg); _writeStream.writeByte((byte)0); // Compression status (always zero for validate connection). _writeStream.writeInt(IceInternal.Protocol.headerSize); // Message size. @@ -2098,11 +2098,11 @@ namespace Ice } ProtocolVersion pv = new ProtocolVersion(); - pv.read__(_readStream); + pv.iceRead(_readStream); IceInternal.Protocol.checkSupportedProtocol(pv); EncodingVersion ev = new EncodingVersion(); - ev.read__(_readStream); + ev.iceRead(_readStream); IceInternal.Protocol.checkSupportedProtocolEncoding(ev); byte messageType = _readStream.readByte(); diff --git a/csharp/src/Ice/DispatchInterceptor.cs b/csharp/src/Ice/DispatchInterceptor.cs index a571f356c2c..9cf3347f606 100644 --- a/csharp/src/Ice/DispatchInterceptor.cs +++ b/csharp/src/Ice/DispatchInterceptor.cs @@ -31,7 +31,7 @@ namespace Ice dispatch(Request request); public override System.Threading.Tasks.Task<Ice.OutputStream> - dispatch__(IceInternal.Incoming inc, Current current) + iceDispatch(IceInternal.Incoming inc, Current current) { return dispatch(inc); } diff --git a/csharp/src/Ice/EndpointFactoryManager.cs b/csharp/src/Ice/EndpointFactoryManager.cs index 1c8172ffcc5..5cf22c23ceb 100644 --- a/csharp/src/Ice/EndpointFactoryManager.cs +++ b/csharp/src/Ice/EndpointFactoryManager.cs @@ -18,7 +18,7 @@ namespace IceInternal { internal EndpointFactoryManager(Instance instance) { - instance_ = instance; + _instance = instance; _factories = new List<EndpointFactory>(); } @@ -77,7 +77,7 @@ namespace IceInternal if(protocol.Equals("default")) { - protocol = instance_.defaultsAndOverrides().defaultProtocol; + protocol = _instance.defaultsAndOverrides().defaultProtocol; } EndpointFactory factory = null; @@ -109,7 +109,7 @@ namespace IceInternal /* EndpointI e = f.create(s.Substring(m.Index + m.Length), oaEndpoint); - BasicStream bs = new BasicStream(instance_, true); + BasicStream bs = new BasicStream(_instance, true); e.streamWrite(bs); Buffer buf = bs.getBuffer(); buf.b.position(0); @@ -142,11 +142,11 @@ namespace IceInternal // and ask the factory to read the endpoint data from that stream to create // the actual endpoint. // - Ice.OutputStream os = new Ice.OutputStream(instance_, Ice.Util.currentProtocolEncoding); + Ice.OutputStream os = new Ice.OutputStream(_instance, Ice.Util.currentProtocolEncoding); os.writeShort(ue.type()); ue.streamWrite(os); Ice.InputStream iss = - new Ice.InputStream(instance_, Ice.Util.currentProtocolEncoding, os.getBuffer(), true); + new Ice.InputStream(_instance, Ice.Util.currentProtocolEncoding, os.getBuffer(), true); iss.pos(0); iss.readShort(); // type iss.startEncapsulation(); @@ -196,7 +196,7 @@ namespace IceInternal _factories.Clear(); } - private readonly Instance instance_; + private readonly Instance _instance; private readonly List<EndpointFactory> _factories; } diff --git a/csharp/src/Ice/Exception.cs b/csharp/src/Ice/Exception.cs index e07e9209a9c..b5720c1b798 100644 --- a/csharp/src/Ice/Exception.cs +++ b/csharp/src/Ice/Exception.cs @@ -202,27 +202,27 @@ namespace Ice /// <param name="context">Contains contextual information about the source or destination.</param> protected UserException(SerializationInfo info, StreamingContext context) : base(info, context) {} - public virtual void write__(OutputStream os__) + public virtual void iceWrite(OutputStream ostr) { - os__.startException(null); - writeImpl__(os__); - os__.endException(); + ostr.startException(null); + iceWriteImpl(ostr); + ostr.endException(); } - public virtual void read__(InputStream is__) + public virtual void iceRead(InputStream istr) { - is__.startException(); - readImpl__(is__); - is__.endException(false); + istr.startException(); + iceReadImpl(istr); + istr.endException(false); } - public virtual bool usesClasses__() + public virtual bool iceUsesClasses() { return false; } - protected abstract void writeImpl__(OutputStream os__); - protected abstract void readImpl__(InputStream is__); + protected abstract void iceWriteImpl(OutputStream ostr); + protected abstract void iceReadImpl(InputStream istr); } } diff --git a/csharp/src/Ice/Incoming.cs b/csharp/src/Ice/Incoming.cs index 9df6f1625c7..36b0f721892 100644 --- a/csharp/src/Ice/Incoming.cs +++ b/csharp/src/Ice/Incoming.cs @@ -110,7 +110,7 @@ namespace IceInternal // // Read the current. // - _current.id.read__(_is); + _current.id.iceRead(_is); // // For compatibility with the old FacetPath. @@ -211,7 +211,7 @@ namespace IceInternal try { - Task<Ice.OutputStream> task = _servant.dispatch__(this, _current); + Task<Ice.OutputStream> task = _servant.iceDispatch(this, _current); if(task == null) { completed(null, false); @@ -605,7 +605,7 @@ namespace IceInternal { Debug.Assert(false); } - ex.id.write__(_os); + ex.id.iceWrite(_os); // // For compatibility with the old FacetPath. diff --git a/csharp/src/Ice/InputStream.cs b/csharp/src/Ice/InputStream.cs index 0f9de976656..1eac58e63f1 100644 --- a/csharp/src/Ice/InputStream.cs +++ b/csharp/src/Ice/InputStream.cs @@ -257,17 +257,17 @@ namespace Ice { initialize(encoding); - instance_ = instance; - _traceSlicing = instance_.traceLevels().slicing > 0; + _instance = instance; + _traceSlicing = _instance.traceLevels().slicing > 0; - _valueFactoryManager = instance_.initializationData().valueFactoryManager; - _logger = instance_.initializationData().logger; - _classResolver = instance_.resolveClass; + _valueFactoryManager = _instance.initializationData().valueFactoryManager; + _logger = _instance.initializationData().logger; + _classResolver = _instance.resolveClass; } private void initialize(EncodingVersion encoding) { - instance_ = null; + _instance = null; _encoding = encoding; _encapsStack = null; _encapsCache = null; @@ -396,7 +396,7 @@ namespace Ice public IceInternal.Instance instance() { - return instance_; + return _instance; } /// <summary> @@ -405,7 +405,7 @@ namespace Ice /// <param name="other">The other stream.</param> public void swap(InputStream other) { - Debug.Assert(instance_ == other.instance_); + Debug.Assert(_instance == other._instance); IceInternal.Buffer tmpBuf = other._buf; other._buf = _buf; @@ -558,7 +558,7 @@ namespace Ice _encapsStack.sz = sz; EncodingVersion encoding = new EncodingVersion(); - encoding.read__(this); + encoding.iceRead(this); Protocol.checkSupportedEncoding(encoding); // Make sure the encoding is supported. _encapsStack.setEncoding(encoding); @@ -627,7 +627,7 @@ namespace Ice } var encoding = new EncodingVersion(); - encoding.read__(this); + encoding.iceRead(this); if(encoding.Equals(Util.Encoding_1_0)) { if(sz != 6) @@ -664,7 +664,7 @@ namespace Ice } encoding = new EncodingVersion(); - encoding.read__(this); + encoding.iceRead(this); _buf.b.position(_buf.b.position() - 6); byte[] v = new byte[sz]; @@ -710,7 +710,7 @@ namespace Ice throw new UnmarshalOutOfBoundsException(); } EncodingVersion encoding = new EncodingVersion(); - encoding.read__(this); + encoding.iceRead(this); try { _buf.b.position(_buf.b.position() + sz - 6); @@ -1096,7 +1096,7 @@ namespace Ice } try { - var f = new BinaryFormatter(null, new StreamingContext(StreamingContextStates.All, instance_)); + var f = new BinaryFormatter(null, new StreamingContext(StreamingContextStates.All, _instance)); return f.Deserialize(new IceInternal.InputStreamWrapper(sz, this)); } catch(System.Exception ex) @@ -2378,7 +2378,7 @@ namespace Ice /// <returns>The extracted proxy.</returns> public ObjectPrx readProxy() { - return instance_.proxyFactory().streamToProxy(this); + return _instance.proxyFactory().streamToProxy(this); } /// <summary> @@ -2699,7 +2699,7 @@ namespace Ice return userEx; } - private IceInternal.Instance instance_; + private IceInternal.Instance _instance; private IceInternal.Buffer _buf; private object _closure; private byte[] _stringBytes; // Reusable array for reading strings. @@ -2900,7 +2900,7 @@ namespace Ice // // Read the instance. // - v.read__(_stream); + v.iceRead(_stream); if(_patchMap != null) { @@ -3073,7 +3073,7 @@ namespace Ice // if(userEx != null) { - userEx.read__(_stream); + userEx.iceRead(_stream); if(usesClasses) { readPendingValues(); @@ -3382,7 +3382,7 @@ namespace Ice // if(userEx != null) { - userEx.read__(_stream); + userEx.iceRead(_stream); throw userEx; // Never reached. @@ -4018,12 +4018,12 @@ namespace Ice /// <param name="inStream">The input stream to read from.</param> public abstract void read(InputStream inStream); - public override void write__(OutputStream os) + public override void iceWrite(OutputStream os) { Debug.Assert(false); } - public override void read__(InputStream istr) + public override void iceRead(InputStream istr) { read(istr); } diff --git a/csharp/src/Ice/LocatorInfo.cs b/csharp/src/Ice/LocatorInfo.cs index 50eccbbb5fe..50b2c8b6a14 100644 --- a/csharp/src/Ice/LocatorInfo.cs +++ b/csharp/src/Ice/LocatorInfo.cs @@ -30,7 +30,7 @@ namespace IceInternal EndpointI[] endpoints = null; if(proxy != null) { - Reference r = ((Ice.ObjectPrxHelperBase)proxy).reference__(); + Reference r = ((Ice.ObjectPrxHelperBase)proxy).iceReference(); if(_ref.isWellKnown() && !Protocol.isSupported(_ref.getEncoding(), r.getEncoding())) { // @@ -163,7 +163,7 @@ namespace IceInternal EndpointI[] endpoints = null; if(_proxy != null) { - Reference r = ((Ice.ObjectPrxHelperBase)_proxy).reference__(); + Reference r = ((Ice.ObjectPrxHelperBase)_proxy).iceReference(); if(!r.isIndirect()) { endpoints = r.getEndpoints(); @@ -697,7 +697,7 @@ namespace IceInternal finishRequest(Reference @ref, List<Reference> wellKnownRefs, Ice.ObjectPrx proxy, bool notRegistered) { Ice.ObjectPrxHelperBase @base = proxy as Ice.ObjectPrxHelperBase; - if(proxy == null || @base.reference__().isIndirect()) + if(proxy == null || @base.iceReference().isIndirect()) { // // Remove the cached references of well-known objects for which we tried @@ -711,10 +711,10 @@ namespace IceInternal if(!@ref.isWellKnown()) { - if(proxy != null && !@base.reference__().isIndirect()) + if(proxy != null && !@base.iceReference().isIndirect()) { // Cache the adapter endpoints. - _table.addAdapterEndpoints(@ref.getAdapterId(), @base.reference__().getEndpoints()); + _table.addAdapterEndpoints(@ref.getAdapterId(), @base.iceReference().getEndpoints()); } else if(notRegistered) // If the adapter isn't registered anymore, remove it from the cache. { @@ -729,10 +729,10 @@ namespace IceInternal } else { - if(proxy != null && !@base.reference__().isWellKnown()) + if(proxy != null && !@base.iceReference().isWellKnown()) { // Cache the well-known object reference. - _table.addObjectReference(@ref.getIdentity(), @base.reference__()); + _table.addObjectReference(@ref.getIdentity(), @base.iceReference()); } else if(notRegistered) // If the well-known object isn't registered anymore, remove it from the cache. { @@ -762,7 +762,7 @@ namespace IceInternal { public LocatorKey(Ice.LocatorPrx prx) { - Reference r = ((Ice.ObjectPrxHelperBase)prx).reference__(); + Reference r = ((Ice.ObjectPrxHelperBase)prx).iceReference(); _id = r.getIdentity(); _encoding = r.getEncoding(); } diff --git a/csharp/src/Ice/Object.cs b/csharp/src/Ice/Object.cs index 0b888955616..a05266369e0 100644 --- a/csharp/src/Ice/Object.cs +++ b/csharp/src/Ice/Object.cs @@ -69,7 +69,7 @@ namespace Ice /// <returns>The task if dispatched asynchronously, null otherwise.</returns> Task<Ice.OutputStream> ice_dispatch(Request request); - Task<Ice.OutputStream> dispatch__(IceInternal.Incoming inc, Current current); + Task<Ice.OutputStream> iceDispatch(IceInternal.Incoming inc, Current current); } /// <summary> @@ -94,7 +94,7 @@ namespace Ice return MemberwiseClone(); } - public static readonly string[] ids__ = + private static readonly string[] _ids = { "::Ice::Object" }; @@ -107,19 +107,19 @@ namespace Ice /// <returns>The return value is true if s is ::Ice::Object.</returns> public virtual bool ice_isA(string s, Current current = null) { - return s.Equals(ids__[0]); + return s.Equals(_ids[0]); } - public static Task<Ice.OutputStream> ice_isA___(Ice.Object __obj, IceInternal.Incoming inS__, Current __current) + public static Task<Ice.OutputStream> iceD_ice_isA(Ice.Object obj, IceInternal.Incoming inS, Current current) { - InputStream is__ = inS__.startReadParams(); - var __id = is__.readString(); - inS__.endReadParams(); - var __ret = __obj.ice_isA(__id, __current); - var os__ = inS__.startWriteParams(); - os__.writeBool(__ret); - inS__.endWriteParams(os__); - inS__.setResult(os__); + InputStream istr = inS.startReadParams(); + var id = istr.readString(); + inS.endReadParams(); + var ret = obj.ice_isA(id, current); + var ostr = inS.startWriteParams(); + ostr.writeBool(ret); + inS.endWriteParams(ostr); + inS.setResult(ostr); return null; } @@ -132,11 +132,11 @@ namespace Ice // Nothing to do. } - public static Task<Ice.OutputStream> ice_ping___(Ice.Object __obj, IceInternal.Incoming inS__, Current __current) + public static Task<Ice.OutputStream> iceD_ice_ping(Ice.Object obj, IceInternal.Incoming inS, Current current) { - inS__.readEmptyParams(); - __obj.ice_ping(__current); - inS__.setResult(inS__.writeEmptyParams()); + inS.readEmptyParams(); + obj.ice_ping(current); + inS.setResult(inS.writeEmptyParams()); return null; } @@ -147,17 +147,17 @@ namespace Ice /// <returns>An array whose only element is ::Ice::Object.</returns> public virtual string[] ice_ids(Current current = null) { - return ids__; + return _ids; } - public static Task<Ice.OutputStream> ice_ids___(Ice.Object __obj, IceInternal.Incoming inS__, Current __current) + public static Task<Ice.OutputStream> iceD_ice_ids(Ice.Object obj, IceInternal.Incoming inS, Current current) { - inS__.readEmptyParams(); - var ret__ = __obj.ice_ids(__current); - var os__ = inS__.startWriteParams(); - os__.writeStringSeq(ret__); - inS__.endWriteParams(os__); - inS__.setResult(os__); + inS.readEmptyParams(); + var ret = obj.ice_ids(current); + var ostr = inS.startWriteParams(); + ostr.writeStringSeq(ret); + inS.endWriteParams(ostr); + inS.setResult(ostr); return null; } @@ -168,17 +168,17 @@ namespace Ice /// <returns>The return value is always ::Ice::Object.</returns> public virtual string ice_id(Current current = null) { - return ids__[0]; + return _ids[0]; } - public static Task<Ice.OutputStream> ice_id___(Ice.Object __obj, IceInternal.Incoming inS__, Current __current) + public static Task<Ice.OutputStream> iceD_ice_id(Ice.Object obj, IceInternal.Incoming inS, Current current) { - inS__.readEmptyParams(); - var __ret = __obj.ice_id(__current); - var os__ = inS__.startWriteParams(); - os__.writeString(__ret); - inS__.endWriteParams(os__); - inS__.setResult(os__); + inS.readEmptyParams(); + var ret = obj.ice_id(current); + var ostr = inS.startWriteParams(); + ostr.writeString(ret); + inS.endWriteParams(ostr); + inS.setResult(ostr); return null; } @@ -188,10 +188,10 @@ namespace Ice /// <returns>The return value is always ::Ice::Object.</returns> public static string ice_staticId() { - return ids__[0]; + return _ids[0]; } - private static readonly string[] all__ = new string[] + private static readonly string[] _all = new string[] { "ice_id", "ice_ids", "ice_isA", "ice_ping" }; @@ -206,12 +206,12 @@ namespace Ice { var inc = (IceInternal.Incoming)request; inc.startOver(); - return dispatch__(inc, inc.getCurrent()); + return iceDispatch(inc, inc.getCurrent()); } - public virtual Task<Ice.OutputStream> dispatch__(IceInternal.Incoming inc, Current current) + public virtual Task<Ice.OutputStream> iceDispatch(IceInternal.Incoming inc, Current current) { - int pos = System.Array.BinarySearch(all__, current.operation); + int pos = System.Array.BinarySearch(_all, current.operation); if(pos < 0) { throw new Ice.OperationNotExistException(current.id, current.facet, current.operation); @@ -221,19 +221,19 @@ namespace Ice { case 0: { - return ice_id___(this, inc, current); + return iceD_ice_id(this, inc, current); } case 1: { - return ice_ids___(this, inc, current); + return iceD_ice_ids(this, inc, current); } case 2: { - return ice_isA___(this, inc, current); + return iceD_ice_isA(this, inc, current); } case 3: { - return ice_ping___(this, inc, current); + return iceD_ice_ping(this, inc, current); } } @@ -260,7 +260,7 @@ namespace Ice return "???"; } - public static void checkMode__(OperationMode expected, OperationMode received) + public static void iceCheckMode(OperationMode expected, OperationMode received) { if(expected != received) { @@ -303,7 +303,7 @@ namespace Ice /// Ice run-time exception, it must throw it directly.</returns> public abstract bool ice_invoke(byte[] inParams, out byte[] outParams, Current current); - public override Task<Ice.OutputStream> dispatch__(IceInternal.Incoming inS, Current current) + public override Task<Ice.OutputStream> iceDispatch(IceInternal.Incoming inS, Current current) { byte[] inEncaps = inS.readParamEncaps(); byte[] outEncaps; @@ -317,7 +317,7 @@ namespace Ice { public abstract Task<Ice.Object_Ice_invokeResult> ice_invokeAsync(byte[] inEncaps, Current current); - public override Task<Ice.OutputStream> dispatch__(IceInternal.Incoming inS, Current current) + public override Task<Ice.OutputStream> iceDispatch(IceInternal.Incoming inS, Current current) { byte[] inEncaps = inS.readParamEncaps(); return ice_invokeAsync(inEncaps, current).ContinueWith((Task<Ice.Object_Ice_invokeResult> t) => diff --git a/csharp/src/Ice/ObjectAdapterFactory.cs b/csharp/src/Ice/ObjectAdapterFactory.cs index 5fba2d4db52..88c49c3c042 100644 --- a/csharp/src/Ice/ObjectAdapterFactory.cs +++ b/csharp/src/Ice/ObjectAdapterFactory.cs @@ -25,14 +25,14 @@ namespace IceInternal // Ignore shutdown requests if the object adapter factory has // already been shut down. // - if(instance_ == null) + if(_instance == null) { return; } adapters = new List<Ice.ObjectAdapterI>(_adapters); - instance_ = null; + _instance = null; _communicator = null; System.Threading.Monitor.PulseAll(this); @@ -56,7 +56,7 @@ namespace IceInternal // // First we wait for the shutdown of the factory itself. // - while(instance_ != null) + while(_instance != null) { System.Threading.Monitor.Wait(this); } @@ -77,7 +77,7 @@ namespace IceInternal { lock(this) { - return instance_ == null; + return _instance == null; } } @@ -139,7 +139,7 @@ namespace IceInternal { lock(this) { - if(instance_ == null) + if(_instance == null) { throw new Ice.CommunicatorDestroyedException(); } @@ -148,7 +148,7 @@ namespace IceInternal if(name.Length == 0) { string uuid = System.Guid.NewGuid().ToString(); - adapter = new Ice.ObjectAdapterI(instance_, _communicator, this, uuid, null, true); + adapter = new Ice.ObjectAdapterI(_instance, _communicator, this, uuid, null, true); } else { @@ -159,7 +159,7 @@ namespace IceInternal ex.id = name; throw ex; } - adapter = new Ice.ObjectAdapterI(instance_, _communicator, this, name, router, false); + adapter = new Ice.ObjectAdapterI(_instance, _communicator, this, name, router, false); _adapterNamesInUse.Add(name); } _adapters.Add(adapter); @@ -172,7 +172,7 @@ namespace IceInternal List<Ice.ObjectAdapterI> adapters; lock(this) { - if(instance_ == null) + if(_instance == null) { return null; } @@ -202,7 +202,7 @@ namespace IceInternal { lock(this) { - if(instance_ == null) + if(_instance == null) { return; } @@ -231,13 +231,13 @@ namespace IceInternal // internal ObjectAdapterFactory(Instance instance, Ice.Communicator communicator) { - instance_ = instance; + _instance = instance; _communicator = communicator; _adapterNamesInUse = new HashSet<string>(); _adapters = new List<Ice.ObjectAdapterI>(); } - private Instance instance_; + private Instance _instance; private Ice.Communicator _communicator; private HashSet<string> _adapterNamesInUse; private List<Ice.ObjectAdapterI> _adapters; diff --git a/csharp/src/Ice/ObjectAdapterI.cs b/csharp/src/Ice/ObjectAdapterI.cs index a1213d9ae99..da1cb5df9ea 100644 --- a/csharp/src/Ice/ObjectAdapterI.cs +++ b/csharp/src/Ice/ObjectAdapterI.cs @@ -45,7 +45,7 @@ namespace Ice // If we've previously been initialized we just need to activate the // incoming connection factories and we're done. // - if(state_ != StateUninitialized) + if(_state != StateUninitialized) { foreach(IncomingConnectionFactory icf in _incomingConnectionFactories) { @@ -61,12 +61,12 @@ namespace Ice // deactivation from other threads while these one off // initializations are done. // - state_ = StateActivating; + _state = StateActivating; locatorInfo = _locatorInfo; if(!_noConfig) { - Properties properties = instance_.initializationData().properties; + Properties properties = _instance.initializationData().properties; printAdapterReady = properties.getPropertyAsInt("Ice.PrintAdapterReady") > 0; } } @@ -87,7 +87,7 @@ namespace Ice // lock(this) { - state_ = StateUninitialized; + _state = StateUninitialized; System.Threading.Monitor.PulseAll(this); } throw; @@ -100,14 +100,14 @@ namespace Ice lock(this) { - Debug.Assert(state_ == StateActivating); + Debug.Assert(_state == StateActivating); foreach(IncomingConnectionFactory icf in _incomingConnectionFactories) { icf.activate(); } - state_ = StateActive; + _state = StateActive; System.Threading.Monitor.PulseAll(this); } } @@ -117,7 +117,7 @@ namespace Ice lock(this) { checkForDeactivation(); - state_ = StateHeld; + _state = StateHeld; foreach(IncomingConnectionFactory factory in _incomingConnectionFactories) { factory.hold(); @@ -150,15 +150,15 @@ namespace Ice // Wait for activation to complete. This is necessary to not // get out of order locator updates. // - while(state_ == StateActivating || state_ == StateDeactivating) + while(_state == StateActivating || _state == StateDeactivating) { System.Threading.Monitor.Wait(this); } - if(state_ > StateDeactivating) + if(_state > StateDeactivating) { return; } - state_ = StateDeactivating; + _state = StateDeactivating; } // @@ -171,7 +171,7 @@ namespace Ice // // Remove entry from the router manager. // - instance_.routerManager().erase(_routerInfo.getRouter()); + _instance.routerManager().erase(_routerInfo.getRouter()); // // Clear this object adapter with the router. @@ -206,12 +206,12 @@ namespace Ice // changing the object adapter might block if there are still // requests being dispatched. // - instance_.outgoingConnectionFactory().removeAdapter(this); + _instance.outgoingConnectionFactory().removeAdapter(this); lock(this) { - Debug.Assert(state_ == StateDeactivating); - state_ = StateDeactivated; + Debug.Assert(_state == StateDeactivating); + _state = StateDeactivated; System.Threading.Monitor.PulseAll(this); } } @@ -226,11 +226,11 @@ namespace Ice // for the return of all direct method calls using this // adapter. // - while((state_ < StateDeactivated) || _directCount > 0) + while((_state < StateDeactivated) || _directCount > 0) { System.Threading.Monitor.Wait(this); } - if(state_ > StateDeactivated) + if(_state > StateDeactivated) { return; } @@ -252,7 +252,7 @@ namespace Ice { lock(this) { - return state_ >= StateDeactivated; + return _state >= StateDeactivated; } } @@ -271,15 +271,15 @@ namespace Ice // adapter. Other threads wait for the destruction to be // completed. // - while(state_ == StateDestroying) + while(_state == StateDestroying) { System.Threading.Monitor.Wait(this); } - if(state_ == StateDestroyed) + if(_state == StateDestroyed) { return; } - state_ = StateDestroying; + _state = StateDestroying; } // @@ -313,7 +313,7 @@ namespace Ice // // Remove object references (some of them cyclic). // - instance_ = null; + _instance = null; _threadPool = null; _routerEndpoints = null; _routerInfo = null; @@ -322,7 +322,7 @@ namespace Ice _reference = null; _objectAdapterFactory = null; - state_ = StateDestroyed; + _state = StateDestroyed; System.Threading.Monitor.PulseAll(this); } } @@ -450,7 +450,7 @@ namespace Ice { checkForDeactivation(); - Reference @ref = ((ObjectPrxHelperBase)proxy).reference__(); + Reference @ref = ((ObjectPrxHelperBase)proxy).iceReference(); return findFacet(@ref.getIdentity(), @ref.getFacet()); } } @@ -534,7 +534,7 @@ namespace Ice { checkForDeactivation(); - _locatorInfo = instance_.locatorManager().get(locator); + _locatorInfo = _instance.locatorManager().get(locator); } } @@ -617,7 +617,7 @@ namespace Ice // it can be called for AMI invocations if the proxy has no delegate set yet. // - Reference r = ((ObjectPrxHelperBase)proxy).reference__(); + Reference r = ((ObjectPrxHelperBase)proxy).iceReference(); if(r.isWellKnown()) { // @@ -748,7 +748,7 @@ namespace Ice { // Not check for deactivation here! - Debug.Assert(instance_ != null); // Must not be called after destroy(). + Debug.Assert(_instance != null); // Must not be called after destroy(). Debug.Assert(_directCount > 0); if(--_directCount == 0) @@ -760,13 +760,13 @@ namespace Ice public ThreadPool getThreadPool() { - // No mutex lock necessary, _threadPool and instance_ are + // No mutex lock necessary, _threadPool and _instance are // immutable after creation until they are removed in // destroy(). // Not check for deactivation here! - Debug.Assert(instance_ != null); // Must not be called after destroy(). + Debug.Assert(_instance != null); // Must not be called after destroy(). if(_threadPool != null) { @@ -774,7 +774,7 @@ namespace Ice } else { - return instance_.serverThreadPool(); + return _instance.serverThreadPool(); } } @@ -791,7 +791,7 @@ namespace Ice { // Not check for deactivation here! - Debug.Assert(instance_ != null); // Must not be called after destroy(). + Debug.Assert(_instance != null); // Must not be called after destroy(). return _acm; } @@ -808,7 +808,7 @@ namespace Ice ObjectAdapterFactory objectAdapterFactory, string name, RouterPrx router, bool noConfig) { - instance_ = instance; + _instance = instance; _communicator = communicator; _objectAdapterFactory = objectAdapterFactory; _servantManager = new ServantManager(instance, name); @@ -824,12 +824,12 @@ namespace Ice { _id = ""; _replicaGroupId = ""; - _reference = instance_.referenceFactory().create("dummy -t", ""); - _acm = instance_.serverACM(); + _reference = _instance.referenceFactory().create("dummy -t", ""); + _acm = _instance.serverACM(); return; } - Properties properties = instance_.initializationData().properties; + Properties properties = _instance.initializationData().properties; List<string> unknownProps = new List<string>(); bool noProps = filterProperties(unknownProps); @@ -846,7 +846,7 @@ namespace Ice message.Append("\n "); message.Append(s); } - instance_.initializationData().logger.warning(message.ToString()); + _instance.initializationData().logger.warning(message.ToString()); } // @@ -857,8 +857,8 @@ namespace Ice // // These need to be set to prevent warnings/asserts in the destructor. // - state_ = StateDestroyed; - instance_ = null; + _state = StateDestroyed; + _instance = null; _incomingConnectionFactories = null; InitializationException ex = new InitializationException(); @@ -876,7 +876,7 @@ namespace Ice string proxyOptions = properties.getPropertyWithDefault(_name + ".ProxyOptions", "-t"); try { - _reference = instance_.referenceFactory().create("dummy " + proxyOptions, ""); + _reference = _instance.referenceFactory().create("dummy " + proxyOptions, ""); } catch(ProxyParseException) { @@ -885,7 +885,7 @@ namespace Ice throw ex; } - _acm = new ACMConfig(properties, communicator.getLogger(), _name + ".ACM", instance_.serverACM()); + _acm = new ACMConfig(properties, communicator.getLogger(), _name + ".ACM", _instance.serverACM()); { int defaultMessageSizeMax = instance.messageSizeMax() / 1024; @@ -906,17 +906,17 @@ namespace Ice int threadPoolSizeMax = properties.getPropertyAsInt(_name + ".ThreadPool.SizeMax"); if(threadPoolSize > 0 || threadPoolSizeMax > 0) { - _threadPool = new ThreadPool(instance_, _name + ".ThreadPool", 0); + _threadPool = new ThreadPool(_instance, _name + ".ThreadPool", 0); } if(router == null) { router = RouterPrxHelper.uncheckedCast( - instance_.proxyFactory().propertyToProxy(_name + ".Router")); + _instance.proxyFactory().propertyToProxy(_name + ".Router")); } if(router != null) { - _routerInfo = instance_.routerManager().get(router); + _routerInfo = _instance.routerManager().get(router); if(_routerInfo != null) { // @@ -926,7 +926,7 @@ namespace Ice { Ice.AlreadyRegisteredException ex = new Ice.AlreadyRegisteredException(); ex.kindOfObject = "object adapter with router"; - ex.id = Ice.Util.identityToString(router.ice_getIdentity(), instance_.toStringMode()); + ex.id = Ice.Util.identityToString(router.ice_getIdentity(), _instance.toStringMode()); throw ex; } @@ -970,7 +970,7 @@ namespace Ice // router's client proxy to use this object adapter for // callbacks. // - instance_.outgoingConnectionFactory().setRouterInfo(_routerInfo); + _instance.outgoingConnectionFactory().setRouterInfo(_routerInfo); } } else @@ -987,10 +987,10 @@ namespace Ice } if(endpoints.Count == 0) { - TraceLevels tl = instance_.traceLevels(); + TraceLevels tl = _instance.traceLevels(); if(tl.network >= 2) { - instance_.initializationData().logger.trace(tl.networkCat, "created adapter `" + _name + + _instance.initializationData().logger.trace(tl.networkCat, "created adapter `" + _name + "' without endpoints"); } } @@ -1004,11 +1004,11 @@ namespace Ice if(properties.getProperty(_name + ".Locator").Length > 0) { setLocator(LocatorPrxHelper.uncheckedCast( - instance_.proxyFactory().propertyToProxy(_name + ".Locator"))); + _instance.proxyFactory().propertyToProxy(_name + ".Locator"))); } else { - setLocator(instance_.referenceFactory().getDefaultLocator()); + setLocator(_instance.referenceFactory().getDefaultLocator()); } } catch(LocalException) @@ -1062,8 +1062,8 @@ namespace Ice // // Create a reference and return a proxy for this reference. // - Reference reference = instance_.referenceFactory().create(ident, facet, _reference, endpoints); - return instance_.proxyFactory().referenceToProxy(reference); + Reference reference = _instance.referenceFactory().create(ident, facet, _reference, endpoints); + return _instance.proxyFactory().referenceToProxy(reference); } private ObjectPrx newIndirectProxy(Identity ident, string facet, string id) @@ -1072,13 +1072,13 @@ namespace Ice // Create a reference with the adapter id and return a // proxy for the reference. // - Reference reference = instance_.referenceFactory().create(ident, facet, _reference, id); - return instance_.proxyFactory().referenceToProxy(reference); + Reference reference = _instance.referenceFactory().create(ident, facet, _reference, id); + return _instance.proxyFactory().referenceToProxy(reference); } private void checkForDeactivation() { - if(state_ >= StateDeactivating) + if(_state >= StateDeactivating) { ObjectAdapterDeactivatedException ex = new ObjectAdapterDeactivatedException(); ex.name = getName(); @@ -1172,7 +1172,7 @@ namespace Ice } string s = endpts.Substring(beg, (end) - (beg)); - EndpointI endp = instance_.endpointFactoryManager().create(s, oaEndpoints); + EndpointI endp = _instance.endpointFactoryManager().create(s, oaEndpoints); if(endp == null) { Ice.EndpointParseException e2 = new Ice.EndpointParseException(); @@ -1193,7 +1193,7 @@ namespace Ice // Parse published endpoints. If set, these are used in proxies // instead of the connection factory endpoints. // - string endpts = instance_.initializationData().properties.getProperty(_name + ".PublishedEndpoints"); + string endpts = _instance.initializationData().properties.getProperty(_name + ".PublishedEndpoints"); List<EndpointI> endpoints = parseEndpoints(endpts, false); if(endpoints.Count == 0) { @@ -1208,7 +1208,7 @@ namespace Ice } } - if(instance_.traceLevels().network >= 1 && endpoints.Count > 0) + if(_instance.traceLevels().network >= 1 && endpoints.Count > 0) { StringBuilder s = new StringBuilder("published endpoints for object adapter `"); s.Append(_name); @@ -1223,7 +1223,7 @@ namespace Ice s.Append(endpoint.ToString()); first = false; } - instance_.initializationData().logger.trace(instance_.traceLevels().networkCat, s.ToString()); + _instance.initializationData().logger.trace(_instance.traceLevels().networkCat, s.ToString()); } return endpoints; } @@ -1258,12 +1258,12 @@ namespace Ice } catch(AdapterNotFoundException) { - if(instance_.traceLevels().location >= 1) + if(_instance.traceLevels().location >= 1) { System.Text.StringBuilder s = new System.Text.StringBuilder(); s.Append("couldn't update object adapter `" + _id + "' endpoints with the locator registry:\n"); s.Append("the object adapter is not known to the locator registry"); - instance_.initializationData().logger.trace(instance_.traceLevels().locationCat, s.ToString()); + _instance.initializationData().logger.trace(_instance.traceLevels().locationCat, s.ToString()); } NotRegisteredException ex1 = new NotRegisteredException(); @@ -1273,12 +1273,12 @@ namespace Ice } catch(InvalidReplicaGroupIdException) { - if(instance_.traceLevels().location >= 1) + if(_instance.traceLevels().location >= 1) { System.Text.StringBuilder s = new System.Text.StringBuilder(); s.Append("couldn't update object adapter `" + _id + "' endpoints with the locator registry:\n"); s.Append("the replica group `" + _replicaGroupId + "' is not known to the locator registry"); - instance_.initializationData().logger.trace(instance_.traceLevels().locationCat, s.ToString()); + _instance.initializationData().logger.trace(_instance.traceLevels().locationCat, s.ToString()); } NotRegisteredException ex1 = new NotRegisteredException(); @@ -1288,12 +1288,12 @@ namespace Ice } catch(AdapterAlreadyActiveException) { - if(instance_.traceLevels().location >= 1) + if(_instance.traceLevels().location >= 1) { System.Text.StringBuilder s = new System.Text.StringBuilder(); s.Append("couldn't update object adapter `" + _id + "' endpoints with the locator registry:\n"); s.Append("the object adapter endpoints are already set"); - instance_.initializationData().logger.trace(instance_.traceLevels().locationCat, s.ToString()); + _instance.initializationData().logger.trace(_instance.traceLevels().locationCat, s.ToString()); } ObjectAdapterIdInUseException ex1 = new ObjectAdapterIdInUseException(); @@ -1310,17 +1310,17 @@ namespace Ice } catch(LocalException e) { - if(instance_.traceLevels().location >= 1) + if(_instance.traceLevels().location >= 1) { System.Text.StringBuilder s = new System.Text.StringBuilder(); s.Append("couldn't update object adapter `" + _id + "' endpoints with the locator registry:\n"); s.Append(e.ToString()); - instance_.initializationData().logger.trace(instance_.traceLevels().locationCat, s.ToString()); + _instance.initializationData().logger.trace(_instance.traceLevels().locationCat, s.ToString()); } throw; // TODO: Shall we raise a special exception instead of a non obvious local exception? } - if(instance_.traceLevels().location >= 1) + if(_instance.traceLevels().location >= 1) { System.Text.StringBuilder s = new System.Text.StringBuilder(); s.Append("updated object adapter `" + _id + "' endpoints with the locator registry\n"); @@ -1337,7 +1337,7 @@ namespace Ice } } } - instance_.initializationData().logger.trace(instance_.traceLevels().locationCat, s.ToString()); + _instance.initializationData().logger.trace(_instance.traceLevels().locationCat, s.ToString()); } } @@ -1400,7 +1400,7 @@ namespace Ice bool noProps = true; Dictionary<string, string> props = - instance_.initializationData().properties.getPropertiesForPrefix(prefix); + _instance.initializationData().properties.getPropertiesForPrefix(prefix); foreach(String prop in props.Keys) { bool valid = false; @@ -1432,8 +1432,8 @@ namespace Ice private const int StateDestroying = 6; private const int StateDestroyed = 7; - private int state_ = StateUninitialized; - private Instance instance_; + private int _state = StateUninitialized; + private Instance _instance; private Communicator _communicator; private ObjectAdapterFactory _objectAdapterFactory; private ThreadPool _threadPool; diff --git a/csharp/src/Ice/ObserverHelper.cs b/csharp/src/Ice/ObserverHelper.cs index 67e21f718a1..a6a15dded62 100644 --- a/csharp/src/Ice/ObserverHelper.cs +++ b/csharp/src/Ice/ObserverHelper.cs @@ -37,7 +37,7 @@ namespace IceInternal static public InvocationObserver get(Ice.ObjectPrx proxy, string op, Dictionary<string, string> context) { CommunicatorObserver obsv = - ((Ice.ObjectPrxHelperBase)proxy).reference__().getInstance().initializationData().observer; + ((Ice.ObjectPrxHelperBase)proxy).iceReference().getInstance().initializationData().observer; if(obsv != null) { InvocationObserver observer; diff --git a/csharp/src/Ice/OutgoingAsync.cs b/csharp/src/Ice/OutgoingAsync.cs index 9fbc4fb71f4..44f87eb97fd 100644 --- a/csharp/src/Ice/OutgoingAsync.cs +++ b/csharp/src/Ice/OutgoingAsync.cs @@ -423,7 +423,7 @@ namespace IceInternal } cachedConnection_ = null; - if(proxy_.reference__().getInvocationTimeout() == -2) + if(proxy_.iceReference().getInvocationTimeout() == -2) { instance_.timer().cancel(this); } @@ -439,7 +439,7 @@ namespace IceInternal // the retry interval is 0. This method can be called with the // connection locked so we can't just retry here. // - instance_.retryQueue().add(this, proxy_.handleException__(exc, handler_, mode_, _sent, ref _cnt)); + instance_.retryQueue().add(this, proxy_.iceHandleException(exc, handler_, mode_, _sent, ref _cnt)); return false; } catch(Ice.Exception ex) @@ -450,7 +450,7 @@ namespace IceInternal public override void cancelable(CancellationHandler handler) { - if(proxy_.reference__().getInvocationTimeout() == -2 && cachedConnection_ != null) + if(proxy_.iceReference().getInvocationTimeout() == -2 && cachedConnection_ != null) { int timeout = cachedConnection_.timeout(); if(timeout > 0) @@ -471,7 +471,7 @@ namespace IceInternal // require could end up waiting for the flush of the // connection to be done. // - proxy_.updateRequestHandler__(handler_, null); // Clear request handler and always retry. + proxy_.iceUpdateRequestHandler(handler_, null); // Clear request handler and always retry. instance_.retryQueue().add(this, 0); } catch(Ice.Exception exc) @@ -509,7 +509,7 @@ namespace IceInternal OutgoingAsyncCompletionCallback completionCallback, Ice.OutputStream os = null, Ice.InputStream iss = null) : - base(prx.reference__().getInstance(), completionCallback, os, iss) + base(prx.iceReference().getInstance(), completionCallback, os, iss) { proxy_ = prx; mode_ = Ice.OperationMode.Normal; @@ -523,7 +523,7 @@ namespace IceInternal { if(userThread) { - int invocationTimeout = proxy_.reference__().getInvocationTimeout(); + int invocationTimeout = proxy_.iceReference().getInvocationTimeout(); if(invocationTimeout > 0) { instance_.timer().schedule(this, invocationTimeout); @@ -539,7 +539,7 @@ namespace IceInternal try { _sent = false; - handler_ = proxy_.getRequestHandler__(); + handler_ = proxy_.iceGetRequestHandler(); int status = handler_.sendAsyncRequest(this); if((status & AsyncStatusSent) != 0) { @@ -563,7 +563,7 @@ namespace IceInternal } catch(RetryException) { - proxy_.updateRequestHandler__(handler_, null); // Clear request handler and always retry. + proxy_.iceUpdateRequestHandler(handler_, null); // Clear request handler and always retry. } catch(Ice.Exception ex) { @@ -573,7 +573,7 @@ namespace IceInternal childObserver_.detach(); childObserver_ = null; } - int interval = proxy_.handleException__(ex, handler_, mode_, _sent, ref _cnt); + int interval = proxy_.iceHandleException(ex, handler_, mode_, _sent, ref _cnt); if(interval > 0) { instance_.retryQueue().add(this, interval); @@ -607,7 +607,7 @@ namespace IceInternal _sent = true; if(done) { - if(proxy_.reference__().getInvocationTimeout() != -1) + if(proxy_.iceReference().getInvocationTimeout() != -1) { instance_.timer().cancel(this); } @@ -616,7 +616,7 @@ namespace IceInternal } protected override bool exceptionImpl(Ice.Exception ex) { - if(proxy_.reference__().getInvocationTimeout() != -1) + if(proxy_.iceReference().getInvocationTimeout() != -1) { instance_.timer().cancel(this); } @@ -625,7 +625,7 @@ namespace IceInternal protected override bool responseImpl(bool ok) { - if(proxy_.reference__().getInvocationTimeout() != -1) + if(proxy_.iceReference().getInvocationTimeout() != -1) { instance_.timer().cancel(this); } @@ -634,7 +634,7 @@ namespace IceInternal public void runTimerTask() { - if(proxy_.reference__().getInvocationTimeout() == -2) + if(proxy_.iceReference().getInvocationTimeout() == -2) { cancel(new Ice.ConnectionTimeoutException()); } @@ -661,21 +661,21 @@ namespace IceInternal Ice.OutputStream os = null, Ice.InputStream iss = null) : base(prx, completionCallback, os, iss) { - encoding_ = Protocol.getCompatibleEncoding(proxy_.reference__().getEncoding()); + encoding_ = Protocol.getCompatibleEncoding(proxy_.iceReference().getEncoding()); synchronous_ = false; } public void prepare(string operation, Ice.OperationMode mode, Dictionary<string, string> context, bool synchronous) { - Protocol.checkSupportedProtocol(Protocol.getCompatibleProtocol(proxy_.reference__().getProtocol())); + Protocol.checkSupportedProtocol(Protocol.getCompatibleProtocol(proxy_.iceReference().getProtocol())); mode_ = mode; synchronous_ = synchronous; observer_ = ObserverHelper.get(proxy_, operation, context); - switch(proxy_.reference__().getMode()) + switch(proxy_.iceReference().getMode()) { case Reference.Mode.ModeTwoway: case Reference.Mode.ModeOneway: @@ -688,14 +688,14 @@ namespace IceInternal case Reference.Mode.ModeBatchOneway: case Reference.Mode.ModeBatchDatagram: { - proxy_.getBatchRequestQueue__().prepareBatchRequest(os_); + proxy_.iceGetBatchRequestQueue().prepareBatchRequest(os_); break; } } - Reference rf = proxy_.reference__(); + Reference rf = proxy_.iceReference(); - rf.getIdentity().write__(os_); + rf.getIdentity().iceWrite(os_); // // For compatibility with the old FacetPath. @@ -786,7 +786,7 @@ namespace IceInternal case ReplyStatus.replyOperationNotExist: { Ice.Identity ident = new Ice.Identity(); - ident.read__(is_); + ident.iceRead(is_); // // For compatibility with the old FacetPath. @@ -904,7 +904,7 @@ namespace IceInternal public override int invokeCollocated(CollocatedRequestHandler handler) { // The stream cannot be cached if the proxy is not a twoway or there is an invocation timeout set. - if(!proxy_.ice_isTwoway() || proxy_.reference__().getInvocationTimeout() != -1) + if(!proxy_.ice_isTwoway() || proxy_.iceReference().getInvocationTimeout() != -1) { // Disable caching by marking the streams as cached! state_ |= StateCachedBuffers; @@ -914,7 +914,7 @@ namespace IceInternal public new void abort(Ice.Exception ex) { - Reference.Mode mode = proxy_.reference__().getMode(); + Reference.Mode mode = proxy_.iceReference().getMode(); if(mode == Reference.Mode.ModeBatchOneway || mode == Reference.Mode.ModeBatchDatagram) { // @@ -922,7 +922,7 @@ namespace IceInternal // must notify the connection about that we give up ownership // of the batch stream. // - proxy_.getBatchRequestQueue__().abortBatchRequest(os_); + proxy_.iceGetBatchRequestQueue().abortBatchRequest(os_); } base.abort(ex); @@ -930,11 +930,11 @@ namespace IceInternal public void invoke(string operation) { - Reference.Mode mode = proxy_.reference__().getMode(); + Reference.Mode mode = proxy_.iceReference().getMode(); if(mode == Reference.Mode.ModeBatchOneway || mode == Reference.Mode.ModeBatchDatagram) { sentSynchronously_ = true; - proxy_.getBatchRequestQueue__().finishBatchRequest(os_, proxy_, operation); + proxy_.iceGetBatchRequestQueue().finishBatchRequest(os_, proxy_, operation); responseImpl(true); return; // Don't call sent/completed callback for batch AMI requests } @@ -995,7 +995,7 @@ namespace IceInternal public override void cacheMessageBuffers() { - if(proxy_.reference__().getInstance().cacheMessageBuffers() > 0) + if(proxy_.iceReference().getInstance().cacheMessageBuffers() > 0) { lock(this) { @@ -1048,7 +1048,7 @@ namespace IceInternal base.invoke(operation, mode, format, context, synchronous, write); } - public T result__(bool ok) + public T getResult(bool ok) { try { @@ -1138,9 +1138,9 @@ namespace IceInternal public void invoke(string operation) { - Protocol.checkSupportedProtocol(Protocol.getCompatibleProtocol(proxy_.reference__().getProtocol())); + Protocol.checkSupportedProtocol(Protocol.getCompatibleProtocol(proxy_.iceReference().getProtocol())); observer_ = ObserverHelper.get(proxy_, operation, null); - _batchRequestNum = proxy_.getBatchRequestQueue__().swap(os_); + _batchRequestNum = proxy_.iceGetBatchRequestQueue().swap(os_); invokeImpl(true); // userThread = true } @@ -1440,7 +1440,7 @@ namespace IceInternal public override bool handleResponse(bool ok, OutgoingAsyncBase og) { - SetResult(((OutgoingAsyncT<T>)og).result__(ok)); + SetResult(((OutgoingAsyncT<T>)og).getResult(ok)); return false; } } @@ -1561,7 +1561,7 @@ namespace IceInternal { public ProxyAsyncResultCompletionCallback(Ice.ObjectPrxHelperBase proxy, string operation, object cookie, Ice.AsyncCallback cb) : - base(proxy.ice_getCommunicator(), proxy.reference__().getInstance(), operation, cookie, cb) + base(proxy.ice_getCommunicator(), proxy.iceReference().getInstance(), operation, cookie, cb) { _proxy = proxy; } @@ -1625,7 +1625,7 @@ namespace IceInternal Debug.Assert(r == this); try { - R result = ((OutgoingAsyncT<R>)outgoing_).result__(wait()); + R result = ((OutgoingAsyncT<R>)outgoing_).getResult(wait()); try { _completed(responseCallback_, result); diff --git a/csharp/src/Ice/OutputStream.cs b/csharp/src/Ice/OutputStream.cs index 89f42e694f3..930270c4207 100644 --- a/csharp/src/Ice/OutputStream.cs +++ b/csharp/src/Ice/OutputStream.cs @@ -32,7 +32,7 @@ namespace Ice public OutputStream() { _buf = new IceInternal.Buffer(); - instance_ = null; + _instance = null; _closure = null; _encoding = Util.currentEncoding; _format = FormatType.CompactFormat; @@ -111,12 +111,12 @@ namespace Ice { Debug.Assert(instance != null); - instance_ = instance; + _instance = instance; _buf = buf; _closure = null; _encoding = encoding; - _format = instance_.defaultsAndOverrides().defaultFormat; + _format = _instance.defaultsAndOverrides().defaultFormat; _encapsStack = null; _encapsCache = null; @@ -149,7 +149,7 @@ namespace Ice public IceInternal.Instance instance() { - return instance_; + return _instance; } /// <summary> @@ -200,7 +200,7 @@ namespace Ice /// <param name="other">The other stream.</param> public void swap(OutputStream other) { - Debug.Assert(instance_ == other.instance_); + Debug.Assert(_instance == other._instance); IceInternal.Buffer tmpBuf = other._buf; other._buf = _buf; @@ -343,7 +343,7 @@ namespace Ice _encapsStack.start = _buf.b.position(); writeInt(0); // Placeholder for the encapsulation length. - _encapsStack.encoding.write__(this); + _encapsStack.encoding.iceWrite(this); } /// <summary> @@ -373,7 +373,7 @@ namespace Ice { Protocol.checkSupportedEncoding(encoding); writeInt(6); // Size - encoding.write__(this); + encoding.iceWrite(this); } /// <summary> @@ -1967,12 +1967,12 @@ namespace Ice { if(v != null) { - v.write__(this); + v.iceWrite(this); } else { Identity ident = new Identity(); - ident.write__(this); + ident.iceWrite(this); } } @@ -2160,7 +2160,7 @@ namespace Ice _buf.expand(n); } - private IceInternal.Instance instance_; + private IceInternal.Instance _instance; private IceInternal.Buffer _buf; private object _closure; private FormatType _format; @@ -2258,9 +2258,9 @@ namespace Ice // This allows reading the pending instances even if some part of // the exception was sliced. // - bool usesClasses = v.usesClasses__(); + bool usesClasses = v.iceUsesClasses(); _stream.writeBool(usesClasses); - v.write__(_stream); + v.iceWrite(_stream); if(usesClasses) { writePendingValues(); @@ -2363,7 +2363,7 @@ namespace Ice _stream.instance().initializationData().logger.warning(s); } - p.Key.write__(_stream); + p.Key.iceWrite(_stream); } } _stream.writeSize(0); // Zero marker indicates end of sequence of sequences of instances. @@ -2456,7 +2456,7 @@ namespace Ice internal override void writeException(UserException v) { - v.write__(_stream); + v.iceWrite(_stream); } internal override void startInstance(SliceType sliceType, SlicedData data) @@ -2700,7 +2700,7 @@ namespace Ice } _stream.writeSize(1); // Object instance marker. - v.write__(_stream); + v.iceWrite(_stream); } private sealed class InstanceData @@ -2792,7 +2792,7 @@ namespace Ice if(_encapsStack.format == FormatType.DefaultFormat) { - _encapsStack.format = instance_.defaultsAndOverrides().defaultFormat; + _encapsStack.format = _instance.defaultsAndOverrides().defaultFormat; } if(_encapsStack.encoder == null) // Lazy initialization. @@ -2820,12 +2820,12 @@ namespace Ice /// <param name="outStream">The stream to write to.</param> public abstract void write(OutputStream outStream); - public override void write__(OutputStream os) + public override void iceWrite(OutputStream os) { write(os); } - public override void read__(InputStream istr) + public override void iceRead(InputStream istr) { Debug.Assert(false); } diff --git a/csharp/src/Ice/Proxy.cs b/csharp/src/Ice/Proxy.cs index a155f908c72..6f982179332 100644 --- a/csharp/src/Ice/Proxy.cs +++ b/csharp/src/Ice/Proxy.cs @@ -21,21 +21,21 @@ namespace Ice { /// <summary> /// Delegate for a successful <code>ice_isA</code> invocation. - /// <param name="ret__">True if the remote object supports the type, false otherwise.</param> + /// <param name="ret">True if the remote object supports the type, false otherwise.</param> /// </summary> - public delegate void Callback_Object_ice_isA(bool ret__); + public delegate void Callback_Object_ice_isA(bool ret); /// <summary> /// Delegate for a successful <code>ice_ids</code> invocation. - /// <param name="ret__">The array of Slice type ids supported by the remote object.</param> + /// <param name="ret">The array of Slice type ids supported by the remote object.</param> /// </summary> - public delegate void Callback_Object_ice_ids(string[] ret__); + public delegate void Callback_Object_ice_ids(string[] ret); /// <summary> /// Delegate for a successful <code>ice_id</code> invocation. - /// <param name="ret__">The Slice type id of the most-derived interface supported by the remote object.</param> + /// <param name="ret">The Slice type id of the most-derived interface supported by the remote object.</param> /// </summary> - public delegate void Callback_Object_ice_id(string ret__); + public delegate void Callback_Object_ice_id(string ret); /// <summary> /// Delegate for a successful <code>ice_ping</code> invocation. @@ -44,17 +44,17 @@ namespace Ice /// <summary> /// Delegate for a successful <code>ice_invoke</code> invocation. - /// <param name="ret__">True if the invocation succeeded, or false if the invocation + /// <param name="ret">True if the invocation succeeded, or false if the invocation /// raised a user exception.</param> /// <param name="outEncaps">The encoded out-parameters or user exception.</param> /// </summary> - public delegate void Callback_Object_ice_invoke(bool ret__, byte[] outEncaps); + public delegate void Callback_Object_ice_invoke(bool ret, byte[] outEncaps); /// <summary> /// Delegate for a successful <code>ice_getConnection</code> invocation. - /// <param name="ret__">The connection used by the proxy.</param> + /// <param name="ret">The connection used by the proxy.</param> /// </summary> - public delegate void Callback_Object_ice_getConnection(Connection ret__); + public delegate void Callback_Object_ice_getConnection(Connection ret); /// <summary> /// Value type to allow differenciate between a context that is explicity set to @@ -767,7 +767,7 @@ namespace Ice /// Write a proxy to the output stream. /// </summary> /// <param name="os">Output stream object to write the proxy.</param> - void write__(OutputStream os); + void iceWrite(OutputStream os); } /// <summary> @@ -872,7 +872,7 @@ namespace Ice { try { - return ice_isAAsync(id, context, null, CancellationToken.None, true).Result; + return iceI_ice_isAAsync(id, context, null, CancellationToken.None, true).Result; } catch(AggregateException ex) { @@ -893,15 +893,15 @@ namespace Ice IProgress<bool> progress = null, CancellationToken cancel = new CancellationToken()) { - return ice_isAAsync(id, context, progress, cancel, false); + return iceI_ice_isAAsync(id, context, progress, cancel, false); } private Task<bool> - ice_isAAsync(string id, OptionalContext context, IProgress<bool> progress, CancellationToken cancel, - bool synchronous) + iceI_ice_isAAsync(string id, OptionalContext context, IProgress<bool> progress, CancellationToken cancel, + bool synchronous) { var completed = new OperationTaskCompletionCallback<bool>(progress, cancel); - ice_isA_invoke__(id, context, completed, synchronous); + iceI_ice_isA(id, context, completed, synchronous); return completed.Task; } @@ -914,7 +914,7 @@ namespace Ice /// <returns>An asynchronous result object.</returns> public AsyncResult begin_ice_isA(string id, AsyncCallback callback, object cookie) { - return begin_ice_isA(id, new OptionalContext(), callback, cookie, false); + return iceI_begin_ice_isA(id, new OptionalContext(), callback, cookie, false); } /// <summary> @@ -927,7 +927,7 @@ namespace Ice /// <returns>An asynchronous result object.</returns> public AsyncResult begin_ice_isA(string id, OptionalContext context, AsyncCallback callback, object cookie) { - return begin_ice_isA(id, context, callback, cookie, false); + return iceI_begin_ice_isA(id, context, callback, cookie, false); } /// <summary> @@ -939,10 +939,10 @@ namespace Ice public AsyncResult<Callback_Object_ice_isA> begin_ice_isA(string id, OptionalContext context = new OptionalContext()) { - return begin_ice_isA(id, context, null, null, false); + return iceI_begin_ice_isA(id, context, null, null, false); } - internal const string __ice_isA_name = "ice_isA"; + private const string _ice_isA_name = "ice_isA"; /// <summary> /// Tests whether this object supports a specific Slice interface. @@ -951,13 +951,13 @@ namespace Ice /// <returns>True if the object supports the Slice interface, false otherwise.</returns> public bool end_ice_isA(AsyncResult result) { - var resultI = AsyncResultI.check(result, this, __ice_isA_name); - return ((OutgoingAsyncT<bool>)resultI.OutgoingAsync).result__(resultI.wait()); + var resultI = AsyncResultI.check(result, this, _ice_isA_name); + return ((OutgoingAsyncT<bool>)resultI.OutgoingAsync).getResult(resultI.wait()); } private AsyncResult<Callback_Object_ice_isA> - begin_ice_isA(string id, Dictionary<string, string> context, AsyncCallback callback, object cookie, - bool synchronous) + iceI_begin_ice_isA(string id, Dictionary<string, string> context, AsyncCallback callback, object cookie, + bool synchronous) { var completed = new OperationAsyncResultCompletionCallback<Callback_Object_ice_isA, bool>( (Callback_Object_ice_isA cb, bool result) => @@ -966,18 +966,18 @@ namespace Ice { cb.Invoke(result); } - }, this, __ice_isA_name, cookie, callback); - ice_isA_invoke__(id, context, completed, synchronous); + }, this, _ice_isA_name, cookie, callback); + iceI_ice_isA(id, context, completed, synchronous); return completed; } - private void ice_isA_invoke__(string id, - Dictionary<string, string> context, - OutgoingAsyncCompletionCallback completed, - bool synchronous) + private void iceI_ice_isA(string id, + Dictionary<string, string> context, + OutgoingAsyncCompletionCallback completed, + bool synchronous) { - checkAsyncTwowayOnly__(__ice_isA_name); - getOutgoingAsync<bool>(completed).invoke(__ice_isA_name, + iceCheckAsyncTwowayOnly(_ice_isA_name); + getOutgoingAsync<bool>(completed).invoke(_ice_isA_name, OperationMode.Nonmutating, FormatType.DefaultFormat, context, @@ -995,7 +995,7 @@ namespace Ice { try { - ice_pingAsync(context, null, CancellationToken.None, true).Wait(); + iceI_ice_pingAsync(context, null, CancellationToken.None, true).Wait(); } catch(AggregateException ex) { @@ -1014,14 +1014,14 @@ namespace Ice IProgress<bool> progress = null, CancellationToken cancel = new CancellationToken()) { - return ice_pingAsync(context, progress, cancel, false); + return iceI_ice_pingAsync(context, progress, cancel, false); } private Task - ice_pingAsync(OptionalContext context, IProgress<bool> progress, CancellationToken cancel, bool synchronous) + iceI_ice_pingAsync(OptionalContext context, IProgress<bool> progress, CancellationToken cancel, bool synchronous) { var completed = new OperationTaskCompletionCallback<object>(progress, cancel); - ice_ping_invoke__(context, completed, synchronous); + iceI_ice_ping(context, completed, synchronous); return completed.Task; } @@ -1033,7 +1033,7 @@ namespace Ice /// <returns>An asynchronous result object.</returns> public AsyncResult begin_ice_ping(AsyncCallback callback, object cookie) { - return begin_ice_ping(new OptionalContext(), callback, cookie, false); + return iceI_begin_ice_ping(new OptionalContext(), callback, cookie, false); } /// <summary> @@ -1045,7 +1045,7 @@ namespace Ice /// <returns>An asynchronous result object.</returns> public AsyncResult begin_ice_ping(OptionalContext context, AsyncCallback callback, object cookie) { - return begin_ice_ping(context, callback, cookie, false); + return iceI_begin_ice_ping(context, callback, cookie, false); } /// <summary> @@ -1056,10 +1056,10 @@ namespace Ice public AsyncResult<Callback_Object_ice_ping> begin_ice_ping(OptionalContext context = new OptionalContext()) { - return begin_ice_ping(context, null, null, false); + return iceI_begin_ice_ping(context, null, null, false); } - internal const string __ice_ping_name = "ice_ping"; + private const string _ice_ping_name = "ice_ping"; /// <summary> /// Tests whether the target object of this proxy can be reached. @@ -1067,14 +1067,14 @@ namespace Ice /// <param name="result">The asynchronous result object returned by <code>begin_ice_ping</code>.</param> public void end_ice_ping(AsyncResult result) { - var resultI = AsyncResultI.check(result, this, __ice_ping_name); - ((OutgoingAsyncT<object>)resultI.OutgoingAsync).result__(resultI.wait()); + var resultI = AsyncResultI.check(result, this, _ice_ping_name); + ((OutgoingAsyncT<object>)resultI.OutgoingAsync).getResult(resultI.wait()); } - private AsyncResult<Callback_Object_ice_ping> begin_ice_ping(Dictionary<string, string> context, - AsyncCallback callback, - object cookie, - bool synchronous) + private AsyncResult<Callback_Object_ice_ping> iceI_begin_ice_ping(Dictionary<string, string> context, + AsyncCallback callback, + object cookie, + bool synchronous) { var completed = new OperationAsyncResultCompletionCallback<Callback_Object_ice_ping, object>( (Callback_Object_ice_ping cb, object result) => @@ -1083,15 +1083,15 @@ namespace Ice { cb.Invoke(); } - }, this, __ice_ping_name, cookie, callback); - ice_ping_invoke__(context, completed, synchronous); + }, this, _ice_ping_name, cookie, callback); + iceI_ice_ping(context, completed, synchronous); return completed; } - private void ice_ping_invoke__(Dictionary<string, string> context, OutgoingAsyncCompletionCallback completed, + private void iceI_ice_ping(Dictionary<string, string> context, OutgoingAsyncCompletionCallback completed, bool synchronous) { - getOutgoingAsync<object>(completed).invoke(__ice_ping_name, + getOutgoingAsync<object>(completed).invoke(_ice_ping_name, OperationMode.Nonmutating, FormatType.DefaultFormat, context, @@ -1108,7 +1108,7 @@ namespace Ice { try { - return ice_idsAsync(context, null, CancellationToken.None, true).Result; + return iceI_ice_idsAsync(context, null, CancellationToken.None, true).Result; } catch(AggregateException ex) { @@ -1128,14 +1128,14 @@ namespace Ice IProgress<bool> progress = null, CancellationToken cancel = new CancellationToken()) { - return ice_idsAsync(context, progress, cancel, false); + return iceI_ice_idsAsync(context, progress, cancel, false); } - private Task<string[]> ice_idsAsync(OptionalContext context, IProgress<bool> progress, CancellationToken cancel, - bool synchronous) + private Task<string[]> iceI_ice_idsAsync(OptionalContext context, IProgress<bool> progress, CancellationToken cancel, + bool synchronous) { var completed = new OperationTaskCompletionCallback<string[]>(progress, cancel); - ice_ids_invoke__(context, completed, false); + iceI_ice_ids(context, completed, false); return completed.Task; } @@ -1147,7 +1147,7 @@ namespace Ice /// <returns>An asynchronous result object.</returns> public AsyncResult begin_ice_ids(AsyncCallback callback, object cookie) { - return begin_ice_ids(new OptionalContext(), callback, cookie, false); + return iceI_begin_ice_ids(new OptionalContext(), callback, cookie, false); } /// <summary> @@ -1160,19 +1160,19 @@ namespace Ice public AsyncResult begin_ice_ids(OptionalContext context, AsyncCallback callback, object cookie) { - return begin_ice_ids(context, callback, cookie, false); + return iceI_begin_ice_ids(context, callback, cookie, false); } public AsyncResult<Callback_Object_ice_ids> begin_ice_ids(OptionalContext context = new OptionalContext()) { - return begin_ice_ids(context, null, null, false); + return iceI_begin_ice_ids(context, null, null, false); } - internal const string __ice_ids_name = "ice_ids"; + private const string _ice_ids_name = "ice_ids"; private AsyncResult<Callback_Object_ice_ids> - begin_ice_ids(Dictionary<string, string> context, AsyncCallback callback, object cookie, bool synchronous) + iceI_begin_ice_ids(Dictionary<string, string> context, AsyncCallback callback, object cookie, bool synchronous) { var completed = new OperationAsyncResultCompletionCallback<Callback_Object_ice_ids, string[]>( (Callback_Object_ice_ids cb, string[] result) => @@ -1181,8 +1181,8 @@ namespace Ice { cb.Invoke(result); } - }, this, __ice_ids_name, cookie, callback); - ice_ids_invoke__(context, completed, synchronous); + }, this, _ice_ids_name, cookie, callback); + iceI_ice_ids(context, completed, synchronous); return completed; } @@ -1194,15 +1194,15 @@ namespace Ice /// order. The first element of the returned array is always ::Ice::Object.</returns> public string[] end_ice_ids(AsyncResult result) { - var resultI = AsyncResultI.check(result, this, __ice_ids_name); - return ((OutgoingAsyncT<string[]>)resultI.OutgoingAsync).result__(resultI.wait()); + var resultI = AsyncResultI.check(result, this, _ice_ids_name); + return ((OutgoingAsyncT<string[]>)resultI.OutgoingAsync).getResult(resultI.wait()); } - private void ice_ids_invoke__(Dictionary<string, string> context, OutgoingAsyncCompletionCallback completed, - bool synchronous) + private void iceI_ice_ids(Dictionary<string, string> context, OutgoingAsyncCompletionCallback completed, + bool synchronous) { - checkAsyncTwowayOnly__(__ice_ids_name); - getOutgoingAsync<string[]>(completed).invoke(__ice_ids_name, + iceCheckAsyncTwowayOnly(_ice_ids_name); + getOutgoingAsync<string[]>(completed).invoke(_ice_ids_name, OperationMode.Nonmutating, FormatType.DefaultFormat, context, @@ -1218,7 +1218,7 @@ namespace Ice { try { - return ice_idAsync(context, null, CancellationToken.None, true).Result; + return iceI_ice_idAsync(context, null, CancellationToken.None, true).Result; } catch(AggregateException ex) { @@ -1237,14 +1237,14 @@ namespace Ice IProgress<bool> progress = null, CancellationToken cancel = new CancellationToken()) { - return ice_idAsync(context, progress, cancel, false); + return iceI_ice_idAsync(context, progress, cancel, false); } private Task<string> - ice_idAsync(OptionalContext context, IProgress<bool> progress, CancellationToken cancel, bool synchronous) + iceI_ice_idAsync(OptionalContext context, IProgress<bool> progress, CancellationToken cancel, bool synchronous) { var completed = new OperationTaskCompletionCallback<string>(progress, cancel); - ice_id_invoke__(context, completed, synchronous); + iceI_ice_id(context, completed, synchronous); return completed.Task; } @@ -1256,7 +1256,7 @@ namespace Ice /// <returns>An asynchronous result object.</returns> public AsyncResult begin_ice_id(AsyncCallback callback, object cookie) { - return begin_ice_id(new OptionalContext(), callback, cookie, false); + return iceI_begin_ice_id(new OptionalContext(), callback, cookie, false); } /// <summary> @@ -1269,7 +1269,7 @@ namespace Ice public AsyncResult begin_ice_id(OptionalContext context, AsyncCallback callback, object cookie) { - return begin_ice_id(context, callback, cookie, false); + return iceI_begin_ice_id(context, callback, cookie, false); } /// <summary> @@ -1280,13 +1280,13 @@ namespace Ice public AsyncResult<Callback_Object_ice_id> begin_ice_id(OptionalContext context = new OptionalContext()) { - return begin_ice_id(context, null, null, false); + return iceI_begin_ice_id(context, null, null, false); } - internal const string __ice_id_name = "ice_id"; + private const string _ice_id_name = "ice_id"; private AsyncResult<Callback_Object_ice_id> - begin_ice_id(Dictionary<string, string> context, AsyncCallback callback, object cookie, bool synchronous) + iceI_begin_ice_id(Dictionary<string, string> context, AsyncCallback callback, object cookie, bool synchronous) { var completed = new OperationAsyncResultCompletionCallback<Callback_Object_ice_id, string>( (Callback_Object_ice_id cb, string result) => @@ -1295,8 +1295,8 @@ namespace Ice { cb.Invoke(result); } - }, this, __ice_id_name, cookie, callback); - ice_id_invoke__(context, completed, synchronous); + }, this, _ice_id_name, cookie, callback); + iceI_ice_id(context, completed, synchronous); return completed; } @@ -1307,16 +1307,16 @@ namespace Ice /// <returns>The Slice type ID of the most-derived interface.</returns> public string end_ice_id(AsyncResult result) { - var resultI = AsyncResultI.check(result, this, __ice_id_name); - return ((OutgoingAsyncT<string>)resultI.OutgoingAsync).result__(resultI.wait()); + var resultI = AsyncResultI.check(result, this, _ice_id_name); + return ((OutgoingAsyncT<string>)resultI.OutgoingAsync).getResult(resultI.wait()); } - private void ice_id_invoke__(Dictionary<string, string> context, - OutgoingAsyncCompletionCallback completed, - bool synchronous) + private void iceI_ice_id(Dictionary<string, string> context, + OutgoingAsyncCompletionCallback completed, + bool synchronous) { - checkAsyncTwowayOnly__(__ice_id_name); - getOutgoingAsync<string>(completed).invoke(__ice_id_name, + iceCheckAsyncTwowayOnly(_ice_id_name); + getOutgoingAsync<string>(completed).invoke(_ice_id_name, OperationMode.Nonmutating, FormatType.DefaultFormat, context, @@ -1346,7 +1346,7 @@ namespace Ice { try { - var result = ice_invokeAsync(operation, mode, inEncaps, context, null, CancellationToken.None, true).Result; + var result = iceI_ice_invokeAsync(operation, mode, inEncaps, context, null, CancellationToken.None, true).Result; outEncaps = result.outEncaps; return result.returnValue; } @@ -1374,20 +1374,20 @@ namespace Ice IProgress<bool> progress = null, CancellationToken cancel = new CancellationToken()) { - return ice_invokeAsync(operation, mode, inEncaps, context, progress, cancel, false); + return iceI_ice_invokeAsync(operation, mode, inEncaps, context, progress, cancel, false); } private Task<Object_Ice_invokeResult> - ice_invokeAsync(string operation, - OperationMode mode, - byte[] inEncaps, - OptionalContext context, - IProgress<bool> progress, - CancellationToken cancel, - bool synchronous) + iceI_ice_invokeAsync(string operation, + OperationMode mode, + byte[] inEncaps, + OptionalContext context, + IProgress<bool> progress, + CancellationToken cancel, + bool synchronous) { var completed = new InvokeTaskCompletionCallback(progress, cancel); - ice_invoke_invoke__(operation, mode, inEncaps, context, completed, synchronous); + iceI_ice_invoke(operation, mode, inEncaps, context, completed, synchronous); return completed.Task; } @@ -1407,7 +1407,7 @@ namespace Ice AsyncCallback callback, object cookie) { - return begin_ice_invoke(operation, mode, inEncaps, new OptionalContext(), callback, cookie, false); + return iceI_begin_ice_invoke(operation, mode, inEncaps, new OptionalContext(), callback, cookie, false); } /// <summary> @@ -1428,7 +1428,7 @@ namespace Ice AsyncCallback callback, object cookie) { - return begin_ice_invoke(operation, mode, inEncaps, context, callback, cookie, false); + return iceI_begin_ice_invoke(operation, mode, inEncaps, context, callback, cookie, false); } /// <summary> @@ -1445,10 +1445,10 @@ namespace Ice byte[] inEncaps, OptionalContext context = new OptionalContext()) { - return begin_ice_invoke(operation, mode, inEncaps, context, null, null, false); + return iceI_begin_ice_invoke(operation, mode, inEncaps, context, null, null, false); } - internal const string __ice_invoke_name = "ice_invoke"; + private const string _ice_invoke_name = "ice_invoke"; /// <summary> /// Completes a dynamic invocation. @@ -1462,32 +1462,32 @@ namespace Ice /// it throws it directly.</returns> public bool end_ice_invoke(out byte[] outEncaps, AsyncResult result) { - var resultI = AsyncResultI.check(result, this, __ice_invoke_name); - var r = ((InvokeOutgoingAsyncT)resultI.OutgoingAsync).result__(resultI.wait()); + var resultI = AsyncResultI.check(result, this, _ice_invoke_name); + var r = ((InvokeOutgoingAsyncT)resultI.OutgoingAsync).getResult(resultI.wait()); outEncaps = r.outEncaps; return r.returnValue; } private AsyncResult<Callback_Object_ice_invoke> - begin_ice_invoke(string operation, - OperationMode mode, - byte[] inEncaps, - Dictionary<string, string> context, - AsyncCallback callback, - object cookie, - bool synchronous) - { - var completed = new InvokeAsyncResultCompletionCallback(this, __ice_invoke_name, cookie, callback); - ice_invoke_invoke__(operation, mode, inEncaps, context, completed, synchronous); + iceI_begin_ice_invoke(string operation, + OperationMode mode, + byte[] inEncaps, + Dictionary<string, string> context, + AsyncCallback callback, + object cookie, + bool synchronous) + { + var completed = new InvokeAsyncResultCompletionCallback(this, _ice_invoke_name, cookie, callback); + iceI_ice_invoke(operation, mode, inEncaps, context, completed, synchronous); return completed; } - private void ice_invoke_invoke__(string operation, - OperationMode mode, - byte[] inEncaps, - Dictionary<string, string> context, - OutgoingAsyncCompletionCallback completed, - bool synchronous) + private void iceI_ice_invoke(string operation, + OperationMode mode, + byte[] inEncaps, + Dictionary<string, string> context, + OutgoingAsyncCompletionCallback completed, + bool synchronous) { getInvokeOutgoingAsync(completed).invoke(operation, mode, inEncaps, context, synchronous); } @@ -2186,7 +2186,7 @@ namespace Ice var outgoing = new ProxyGetConnection(this, completed); try { - outgoing.invoke(__ice_getConnection_name); + outgoing.invoke(_ice_getConnection_name); } catch(Exception ex) { @@ -2200,7 +2200,7 @@ namespace Ice return begin_ice_getConnectionInternal(null, null); } - internal const string __ice_getConnection_name = "ice_getConnection"; + private const string _ice_getConnection_name = "ice_getConnection"; public AsyncResult begin_ice_getConnection(AsyncCallback cb, object cookie) { @@ -2209,7 +2209,7 @@ namespace Ice public Connection end_ice_getConnection(AsyncResult r) { - var resultI = AsyncResultI.check(r, this, __ice_getConnection_name); + var resultI = AsyncResultI.check(r, this, _ice_getConnection_name); resultI.wait(); return ((ProxyGetConnection)resultI.OutgoingAsync).getConnection(); } @@ -2217,11 +2217,11 @@ namespace Ice private AsyncResult<Callback_Object_ice_getConnection> begin_ice_getConnectionInternal(AsyncCallback callback, object cookie) { - var completed = new ProxyGetConnectionAsyncCallback(this, __ice_getConnection_name, cookie, callback); + var completed = new ProxyGetConnectionAsyncCallback(this, _ice_getConnection_name, cookie, callback); var outgoing = new ProxyGetConnection(this, completed); try { - outgoing.invoke(__ice_getConnection_name); + outgoing.invoke(_ice_getConnection_name); } catch(Exception ex) { @@ -2274,7 +2274,7 @@ namespace Ice } } - internal const string __ice_flushBatchRequests_name = "ice_flushBatchRequests"; + internal const string _ice_flushBatchRequests_name = "ice_flushBatchRequests"; public Task ice_flushBatchRequestsAsync(IProgress<bool> progress = null, CancellationToken cancel = new CancellationToken()) @@ -2283,7 +2283,7 @@ namespace Ice var outgoing = new ProxyFlushBatchAsync(this, completed); try { - outgoing.invoke(__ice_flushBatchRequests_name); + outgoing.invoke(_ice_flushBatchRequests_name); } catch(Exception ex) { @@ -2298,7 +2298,7 @@ namespace Ice string operation, object cookie, AsyncCallback callback) : - base(proxy.ice_getCommunicator(), ((ObjectPrxHelperBase)proxy).reference__().getInstance(), + base(proxy.ice_getCommunicator(), ((ObjectPrxHelperBase)proxy).iceReference().getInstance(), operation, cookie, callback) { _proxy = proxy; @@ -2332,11 +2332,11 @@ namespace Ice public AsyncResult begin_ice_flushBatchRequests(AsyncCallback cb = null, object cookie = null) { - var completed = new ProxyFlushBatchRequestsAsyncCallback(this, __ice_flushBatchRequests_name, cookie, cb); + var completed = new ProxyFlushBatchRequestsAsyncCallback(this, _ice_flushBatchRequests_name, cookie, cb); var outgoing = new ProxyFlushBatchAsync(this, completed); try { - outgoing.invoke(__ice_flushBatchRequests_name); + outgoing.invoke(_ice_flushBatchRequests_name); } catch(Exception ex) { @@ -2347,7 +2347,7 @@ namespace Ice public void end_ice_flushBatchRequests(AsyncResult r) { - var resultI = AsyncResultI.check(r, this, __ice_flushBatchRequests_name); + var resultI = AsyncResultI.check(r, this, _ice_flushBatchRequests_name); resultI.wait(); } @@ -2399,18 +2399,18 @@ namespace Ice return !Equals(lhs, rhs); } - public void write__(OutputStream os) + public void iceWrite(OutputStream os) { - _reference.getIdentity().write__(os); + _reference.getIdentity().iceWrite(os); _reference.streamWrite(os); } - public Reference reference__() + public Reference iceReference() { return _reference; } - public void copyFrom__(ObjectPrx from) + public void iceCopyFrom(ObjectPrx from) { lock(from) { @@ -2420,10 +2420,10 @@ namespace Ice } } - public int handleException__(Exception ex, RequestHandler handler, OperationMode mode, bool sent, + public int iceHandleException(Exception ex, RequestHandler handler, OperationMode mode, bool sent, ref int cnt) { - updateRequestHandler__(handler, null); // Clear the request handler + iceUpdateRequestHandler(handler, null); // Clear the request handler // // We only retry local exception, system exceptions aren't retried. @@ -2465,7 +2465,7 @@ namespace Ice } } - public void checkAsyncTwowayOnly__(string name) + public void iceCheckAsyncTwowayOnly(string name) { // // No mutex lock necessary, there is nothing mutable in this @@ -2478,7 +2478,7 @@ namespace Ice } } - public RequestHandler getRequestHandler__() + public RequestHandler iceGetRequestHandler() { if(_reference.getCacheConnection()) { @@ -2494,7 +2494,7 @@ namespace Ice } public BatchRequestQueue - getBatchRequestQueue__() + iceGetBatchRequestQueue() { lock(this) { @@ -2507,7 +2507,7 @@ namespace Ice } public RequestHandler - setRequestHandler__(RequestHandler handler) + iceSetRequestHandler(RequestHandler handler) { if(_reference.getCacheConnection()) { @@ -2523,7 +2523,7 @@ namespace Ice return handler; } - public void updateRequestHandler__(RequestHandler previous, RequestHandler handler) + public void iceUpdateRequestHandler(RequestHandler previous, RequestHandler handler) { if(_reference.getCacheConnection() && previous != null) { @@ -2607,22 +2607,22 @@ namespace Ice } public Object_Ice_invokeResult - result__(bool ok) + getResult(bool ok) { try { - var ret__ = new Object_Ice_invokeResult(); + var ret = new Object_Ice_invokeResult(); EncodingVersion encoding; - if(proxy_.reference__().getMode() == Reference.Mode.ModeTwoway) + if(proxy_.iceReference().getMode() == Reference.Mode.ModeTwoway) { - ret__.outEncaps = is_.readEncapsulation(out encoding); + ret.outEncaps = is_.readEncapsulation(out encoding); } else { - ret__.outEncaps = null; + ret.outEncaps = null; } - ret__.returnValue = ok; - return ret__; + ret.returnValue = ok; + return ret; } finally { @@ -2648,7 +2648,7 @@ namespace Ice Debug.Assert(r == this); try { - Object_Ice_invokeResult result = ((InvokeOutgoingAsyncT)outgoing_).result__(wait()); + Object_Ice_invokeResult result = ((InvokeOutgoingAsyncT)outgoing_).getResult(wait()); try { if(responseCallback_ != null) @@ -2692,7 +2692,7 @@ namespace Ice public override bool handleResponse(bool ok, OutgoingAsyncBase og) { - SetResult(((InvokeOutgoingAsyncT)og).result__(ok)); + SetResult(((InvokeOutgoingAsyncT)og).getResult(ok)); return false; } } @@ -2829,7 +2829,7 @@ namespace Ice var ok = bb.ice_isA("::Ice::Object"); Debug.Assert(ok); ObjectPrxHelper h = new ObjectPrxHelper(); - h.copyFrom__(bb); + h.iceCopyFrom(bb); d = h; } catch(FacetNotExistException) @@ -2860,7 +2860,7 @@ namespace Ice var ok = bb.ice_isA("::Ice::Object", ctx); Debug.Assert(ok); ObjectPrxHelper h = new ObjectPrxHelper(); - h.copyFrom__(bb); + h.iceCopyFrom(bb); d = h; } catch(FacetNotExistException) @@ -2895,7 +2895,7 @@ namespace Ice { var bb = b.ice_facet(f); var h = new ObjectPrxHelper(); - h.copyFrom__(bb); + h.iceCopyFrom(bb); d = h; } return d; diff --git a/csharp/src/Ice/ProxyFactory.cs b/csharp/src/Ice/ProxyFactory.cs index 11a204f7a10..159468ba8e3 100644 --- a/csharp/src/Ice/ProxyFactory.cs +++ b/csharp/src/Ice/ProxyFactory.cs @@ -17,7 +17,7 @@ namespace IceInternal { public Ice.ObjectPrx stringToProxy(string str) { - Reference r = instance_.referenceFactory().create(str, null); + Reference r = _instance.referenceFactory().create(str, null); return referenceToProxy(r); } @@ -26,7 +26,7 @@ namespace IceInternal if(proxy != null) { Ice.ObjectPrxHelperBase h = (Ice.ObjectPrxHelperBase) proxy; - return h.reference__().ToString(); + return h.iceReference().ToString(); } else { @@ -36,8 +36,8 @@ namespace IceInternal public Ice.ObjectPrx propertyToProxy(string prefix) { - string proxy = instance_.initializationData().properties.getProperty(prefix); - Reference r = instance_.referenceFactory().create(proxy, prefix); + string proxy = _instance.initializationData().properties.getProperty(prefix); + Reference r = _instance.referenceFactory().create(proxy, prefix); return referenceToProxy(r); } @@ -46,7 +46,7 @@ namespace IceInternal if(proxy != null) { Ice.ObjectPrxHelperBase h = (Ice.ObjectPrxHelperBase) proxy; - return h.reference__().toProperty(prefix); + return h.iceReference().toProperty(prefix); } else { @@ -57,9 +57,9 @@ namespace IceInternal public Ice.ObjectPrx streamToProxy(Ice.InputStream s) { Ice.Identity ident = new Ice.Identity(); - ident.read__(s); + ident.iceRead(s); - Reference r = instance_.referenceFactory().create(ident, s); + Reference r = _instance.referenceFactory().create(ident, s); return referenceToProxy(r); } @@ -79,8 +79,8 @@ namespace IceInternal public int checkRetryAfterException(Ice.LocalException ex, Reference @ref, ref int cnt) { - TraceLevels traceLevels = instance_.traceLevels(); - Ice.Logger logger = instance_.initializationData().logger; + TraceLevels traceLevels = _instance.traceLevels(); + Ice.Logger logger = _instance.initializationData().logger; // // We don't retry batch requests because the exception might have caused @@ -233,9 +233,9 @@ namespace IceInternal // internal ProxyFactory(Instance instance) { - instance_ = instance; + _instance = instance; - string[] arr = instance_.initializationData().properties.getPropertyAsList("Ice.RetryIntervals"); + string[] arr = _instance.initializationData().properties.getPropertyAsList("Ice.RetryIntervals"); if(arr.Length > 0) { @@ -273,7 +273,7 @@ namespace IceInternal } } - private Instance instance_; + private Instance _instance; private int[] _retryIntervals; } diff --git a/csharp/src/Ice/Reference.cs b/csharp/src/Ice/Reference.cs index 19493d35d0a..8ae5d9e78bf 100644 --- a/csharp/src/Ice/Reference.cs +++ b/csharp/src/Ice/Reference.cs @@ -34,7 +34,7 @@ namespace IceInternal public Mode getMode() { - return mode_; + return _mode; } public bool getSecure() @@ -44,43 +44,43 @@ namespace IceInternal public Ice.ProtocolVersion getProtocol() { - return protocol_; + return _protocol; } public Ice.EncodingVersion getEncoding() { - return encoding_; + return _encoding; } public Ice.Identity getIdentity() { - return identity_; + return _identity; } public string getFacet() { - return facet_; + return _facet; } public Instance getInstance() { - return instance_; + return _instance; } public Dictionary<string, string> getContext() { - return context_; + return _context; } public int getInvocationTimeout() { - return invocationTimeout_; + return _invocationTimeout; } public Ice.Communicator getCommunicator() { - return communicator_; + return _communicator; } public abstract EndpointI[] getEndpoints(); @@ -105,26 +105,26 @@ namespace IceInternal { newContext = _emptyContext; } - Reference r = instance_.referenceFactory().copy(this); + Reference r = _instance.referenceFactory().copy(this); if(newContext.Count == 0) { - r.context_ = _emptyContext; + r._context = _emptyContext; } else { - r.context_ = new Dictionary<string, string>(newContext); + r._context = new Dictionary<string, string>(newContext); } return r; } public Reference changeMode(Mode newMode) { - if(newMode == mode_) + if(newMode == _mode) { return this; } - Reference r = instance_.referenceFactory().copy(this); - r.mode_ = newMode; + Reference r = _instance.referenceFactory().copy(this); + r._mode = newMode; return r; } @@ -134,52 +134,52 @@ namespace IceInternal { return this; } - Reference r = instance_.referenceFactory().copy(this); + Reference r = _instance.referenceFactory().copy(this); r.secure_ = newSecure; return r; } public Reference changeIdentity(Ice.Identity newIdentity) { - if(newIdentity.Equals(identity_)) + if(newIdentity.Equals(_identity)) { return this; } - Reference r = instance_.referenceFactory().copy(this); - r.identity_ = newIdentity; // Identity is a value type, therefore a copy of newIdentity is made. + Reference r = _instance.referenceFactory().copy(this); + r._identity = newIdentity; // Identity is a value type, therefore a copy of newIdentity is made. return r; } public Reference changeFacet(string newFacet) { - if(newFacet.Equals(facet_)) + if(newFacet.Equals(_facet)) { return this; } - Reference r = instance_.referenceFactory().copy(this); - r.facet_ = newFacet; + Reference r = _instance.referenceFactory().copy(this); + r._facet = newFacet; return r; } public Reference changeInvocationTimeout(int newTimeout) { - if(newTimeout == invocationTimeout_) + if(newTimeout == _invocationTimeout) { return this; } - Reference r = instance_.referenceFactory().copy(this); - r.invocationTimeout_ = newTimeout; + Reference r = _instance.referenceFactory().copy(this); + r._invocationTimeout = newTimeout; return r; } public virtual Reference changeEncoding(Ice.EncodingVersion newEncoding) { - if(newEncoding.Equals(encoding_)) + if(newEncoding.Equals(_encoding)) { return this; } - Reference r = instance_.referenceFactory().copy(this); - r.encoding_ = newEncoding; + Reference r = _instance.referenceFactory().copy(this); + r._encoding = newEncoding; return r; } @@ -190,7 +190,7 @@ namespace IceInternal return this; } - Reference r = instance_.referenceFactory().copy(this); + Reference r = _instance.referenceFactory().copy(this); r.compress_ = newCompress; r.overrideCompress_ = true; return r; @@ -218,19 +218,19 @@ namespace IceInternal return hashValue_; } int h = 5381; - IceInternal.HashUtil.hashAdd(ref h, mode_); + IceInternal.HashUtil.hashAdd(ref h, _mode); IceInternal.HashUtil.hashAdd(ref h, secure_); - IceInternal.HashUtil.hashAdd(ref h, identity_); - IceInternal.HashUtil.hashAdd(ref h, context_); - IceInternal.HashUtil.hashAdd(ref h, facet_); + IceInternal.HashUtil.hashAdd(ref h, _identity); + IceInternal.HashUtil.hashAdd(ref h, _context); + IceInternal.HashUtil.hashAdd(ref h, _facet); IceInternal.HashUtil.hashAdd(ref h, overrideCompress_); if(overrideCompress_) { IceInternal.HashUtil.hashAdd(ref h, compress_); } - IceInternal.HashUtil.hashAdd(ref h, protocol_); - IceInternal.HashUtil.hashAdd(ref h, encoding_); - IceInternal.HashUtil.hashAdd(ref h, invocationTimeout_); + IceInternal.HashUtil.hashAdd(ref h, _protocol); + IceInternal.HashUtil.hashAdd(ref h, _encoding); + IceInternal.HashUtil.hashAdd(ref h, _invocationTimeout); hashValue_ = h; hashInitialized_ = true; return hashValue_; @@ -253,24 +253,24 @@ namespace IceInternal // // For compatibility with the old FacetPath. // - if(facet_.Length == 0) + if(_facet.Length == 0) { s.writeStringSeq(null); } else { - string[] facetPath = { facet_ }; + string[] facetPath = { _facet }; s.writeStringSeq(facetPath); } - s.writeByte((byte)mode_); + s.writeByte((byte)_mode); s.writeBool(secure_); if(!s.getEncoding().Equals(Ice.Util.Encoding_1_0)) { - protocol_.write__(s); - encoding_.write__(s); + _protocol.iceWrite(s); + _encoding.iceWrite(s); } // Derived class writes the remainder of the reference. @@ -290,14 +290,14 @@ namespace IceInternal // StringBuilder s = new StringBuilder(); - Ice.ToStringMode toStringMode = instance_.toStringMode(); + Ice.ToStringMode toStringMode = _instance.toStringMode(); // // If the encoded identity string contains characters which // the reference parser uses as separators, then we enclose // the identity string in quotes. // - string id = Ice.Util.identityToString(identity_, toStringMode); + string id = Ice.Util.identityToString(_identity, toStringMode); if(IceUtilInternal.StringUtil.findFirstOf(id, " :@") != -1) { s.Append('"'); @@ -309,7 +309,7 @@ namespace IceInternal s.Append(id); } - if(facet_.Length > 0) + if(_facet.Length > 0) { // // If the encoded facet string contains characters which @@ -317,7 +317,7 @@ namespace IceInternal // the facet string in quotes. // s.Append(" -f "); - string fs = IceUtilInternal.StringUtil.escapeString(facet_, "", toStringMode); + string fs = IceUtilInternal.StringUtil.escapeString(_facet, "", toStringMode); if(IceUtilInternal.StringUtil.findFirstOf(fs, " :@") != -1) { s.Append('"'); @@ -330,7 +330,7 @@ namespace IceInternal } } - switch(mode_) + switch(_mode) { case Mode.ModeTwoway: { @@ -368,7 +368,7 @@ namespace IceInternal s.Append(" -s"); } - if(!protocol_.Equals(Ice.Util.Protocol_1_0)) + if(!_protocol.Equals(Ice.Util.Protocol_1_0)) { // // We only print the protocol if it's not 1.0. It's fine as @@ -377,7 +377,7 @@ namespace IceInternal // stringToProxy. // s.Append(" -p "); - s.Append(Ice.Util.protocolVersionToString(protocol_)); + s.Append(Ice.Util.protocolVersionToString(_protocol)); } // @@ -386,7 +386,7 @@ namespace IceInternal // stringToProxy (and won't use Ice.Default.EncodingVersion). // s.Append(" -e "); - s.Append(Ice.Util.encodingVersionToString(encoding_)); + s.Append(Ice.Util.encodingVersionToString(_encoding)); return s.ToString(); @@ -407,7 +407,7 @@ namespace IceInternal Reference r = (Reference)obj; // Guaranteed to succeed. - if(mode_ != r.mode_) + if(_mode != r._mode) { return false; } @@ -417,17 +417,17 @@ namespace IceInternal return false; } - if(!identity_.Equals(r.identity_)) + if(!_identity.Equals(r._identity)) { return false; } - if(!Ice.CollectionComparer.Equals(context_, r.context_)) + if(!Ice.CollectionComparer.Equals(_context, r._context)) { return false; } - if(!facet_.Equals(r.facet_)) + if(!_facet.Equals(r._facet)) { return false; } @@ -441,17 +441,17 @@ namespace IceInternal return false; } - if(!protocol_.Equals(r.protocol_)) + if(!_protocol.Equals(r._protocol)) { return false; } - if(!encoding_.Equals(r.encoding_)) + if(!_encoding.Equals(r._encoding)) { return false; } - if(invocationTimeout_ != r.invocationTimeout_) + if(_invocationTimeout != r._invocationTimeout) { return false; } @@ -471,17 +471,17 @@ namespace IceInternal protected bool hashInitialized_; private static Dictionary<string, string> _emptyContext = new Dictionary<string, string>(); - private Instance instance_; - private Ice.Communicator communicator_; + private Instance _instance; + private Ice.Communicator _communicator; - private Mode mode_; - private Ice.Identity identity_; - private Dictionary<string, string> context_; - private string facet_; + private Mode _mode; + private Ice.Identity _identity; + private Dictionary<string, string> _context; + private string _facet; protected bool secure_; - private Ice.ProtocolVersion protocol_; - private Ice.EncodingVersion encoding_; - private int invocationTimeout_; + private Ice.ProtocolVersion _protocol; + private Ice.EncodingVersion _encoding; + private int _invocationTimeout; protected bool overrideCompress_; protected bool compress_; // Only used if _overrideCompress == true @@ -504,15 +504,15 @@ namespace IceInternal Debug.Assert(identity.category != null); Debug.Assert(facet != null); - instance_ = instance; - communicator_ = communicator; - mode_ = mode; - identity_ = identity; - context_ = context != null ? new Dictionary<string, string>(context) : _emptyContext; - facet_ = facet; - protocol_ = protocol; - encoding_ = encoding; - invocationTimeout_ = invocationTimeout; + _instance = instance; + _communicator = communicator; + _mode = mode; + _identity = identity; + _context = context != null ? new Dictionary<string, string>(context) : _emptyContext; + _facet = facet; + _protocol = protocol; + _encoding = encoding; + _invocationTimeout = invocationTimeout; secure_ = secure; hashInitialized_ = false; overrideCompress_ = false; @@ -728,7 +728,7 @@ namespace IceInternal compress = _fixedConnection.endpoint().compress(); } - return ((Ice.ObjectPrxHelperBase)proxy).setRequestHandler__(new ConnectionRequestHandler(this, + return ((Ice.ObjectPrxHelperBase)proxy).iceSetRequestHandler(new ConnectionRequestHandler(this, _fixedConnection, compress)); } @@ -1090,7 +1090,7 @@ namespace IceInternal if(_routerInfo != null) { Ice.ObjectPrxHelperBase h = (Ice.ObjectPrxHelperBase)_routerInfo.getRouter(); - Dictionary<String, String> routerProperties = h.reference__().toProperty(prefix + ".Router"); + Dictionary<String, String> routerProperties = h.iceReference().toProperty(prefix + ".Router"); foreach(KeyValuePair<string, string> entry in routerProperties) { properties[entry.Key] = entry.Value; @@ -1100,7 +1100,7 @@ namespace IceInternal if(_locatorInfo != null) { Ice.ObjectPrxHelperBase h = (Ice.ObjectPrxHelperBase)_locatorInfo.getLocator(); - Dictionary<String, String> locatorProperties = h.reference__().toProperty(prefix + ".Locator"); + Dictionary<String, String> locatorProperties = h.iceReference().toProperty(prefix + ".Locator"); foreach(KeyValuePair<string, string> entry in locatorProperties) { properties[entry.Key] = entry.Value; diff --git a/csharp/src/Ice/ReferenceFactory.cs b/csharp/src/Ice/ReferenceFactory.cs index eaca68feead..d5782ed7ffc 100644 --- a/csharp/src/Ice/ReferenceFactory.cs +++ b/csharp/src/Ice/ReferenceFactory.cs @@ -56,13 +56,13 @@ namespace IceInternal // Create new reference // return new FixedReference( - instance_, + _instance, _communicator, ident, "", // Facet connection.endpoint().datagram() ? Reference.Mode.ModeDatagram : Reference.Mode.ModeTwoway, connection.endpoint().secure(), - instance_.defaultsAndOverrides().defaultEncoding, + _instance.defaultsAndOverrides().defaultEncoding, connection); } @@ -169,7 +169,7 @@ namespace IceInternal string facet = ""; Reference.Mode mode = Reference.Mode.ModeTwoway; bool secure = false; - Ice.EncodingVersion encoding = instance_.defaultsAndOverrides().defaultEncoding; + Ice.EncodingVersion encoding = _instance.defaultsAndOverrides().defaultEncoding; Ice.ProtocolVersion protocol = Ice.Util.Protocol_1_0; string adapter = ""; @@ -450,7 +450,7 @@ namespace IceInternal } string es = s.Substring(beg, end - beg); - EndpointI endp = instance_.endpointFactoryManager().create(es, false); + EndpointI endp = _instance.endpointFactoryManager().create(es, false); if(endp != null) { endpoints.Add(endp); @@ -468,7 +468,7 @@ namespace IceInternal throw e2; } else if(unknownEndpoints.Count != 0 && - instance_.initializationData().properties.getPropertyAsIntWithDefault( + _instance.initializationData().properties.getPropertyAsIntWithDefault( "Ice.Warn.Endpoints", 1) > 0) { StringBuilder msg = new StringBuilder("Proxy contains unknown endpoints:"); @@ -479,7 +479,7 @@ namespace IceInternal msg.Append((string)unknownEndpoints[idx]); msg.Append("'"); } - instance_.initializationData().logger.warning(msg.ToString()); + _instance.initializationData().logger.warning(msg.ToString()); } EndpointI[] ep = endpoints.ToArray(); @@ -593,9 +593,9 @@ namespace IceInternal if(!s.getEncoding().Equals(Ice.Util.Encoding_1_0)) { protocol = new Ice.ProtocolVersion(); - protocol.read__(s); + protocol.iceRead(s); encoding = new Ice.EncodingVersion(); - encoding.read__(s); + encoding.iceRead(s); } else { @@ -612,7 +612,7 @@ namespace IceInternal endpoints = new EndpointI[sz]; for(int i = 0; i < sz; i++) { - endpoints[i] = instance_.endpointFactoryManager().read(s); + endpoints[i] = _instance.endpointFactoryManager().read(s); } } else @@ -630,7 +630,7 @@ namespace IceInternal return this; } - ReferenceFactory factory = new ReferenceFactory(instance_, _communicator); + ReferenceFactory factory = new ReferenceFactory(_instance, _communicator); factory._defaultLocator = _defaultLocator; factory._defaultRouter = defaultRouter; return factory; @@ -648,7 +648,7 @@ namespace IceInternal return this; } - ReferenceFactory factory = new ReferenceFactory(instance_, _communicator); + ReferenceFactory factory = new ReferenceFactory(_instance, _communicator); factory._defaultLocator = defaultLocator; factory._defaultRouter = _defaultRouter; return factory; @@ -664,7 +664,7 @@ namespace IceInternal // internal ReferenceFactory(Instance instance, Ice.Communicator communicator) { - instance_ = instance; + _instance = instance; _communicator = communicator; } @@ -697,7 +697,7 @@ namespace IceInternal List<string> unknownProps = new List<string>(); Dictionary<string, string> props - = instance_.initializationData().properties.getPropertiesForPrefix(prefix + "."); + = _instance.initializationData().properties.getPropertiesForPrefix(prefix + "."); foreach(String prop in props.Keys) { bool valid = false; @@ -727,7 +727,7 @@ namespace IceInternal message.Append("\n "); message.Append(s); } - instance_.initializationData().logger.warning(message.ToString()); + _instance.initializationData().logger.warning(message.ToString()); } } @@ -741,7 +741,7 @@ namespace IceInternal string adapterId, string propertyPrefix) { - DefaultsAndOverrides defaultsAndOverrides = instance_.defaultsAndOverrides(); + DefaultsAndOverrides defaultsAndOverrides = _instance.defaultsAndOverrides(); // // Default local proxy options. @@ -749,17 +749,17 @@ namespace IceInternal LocatorInfo locatorInfo = null; if(_defaultLocator != null) { - if(!((Ice.ObjectPrxHelperBase)_defaultLocator).reference__().getEncoding().Equals(encoding)) + if(!((Ice.ObjectPrxHelperBase)_defaultLocator).iceReference().getEncoding().Equals(encoding)) { - locatorInfo = instance_.locatorManager().get( + locatorInfo = _instance.locatorManager().get( (Ice.LocatorPrx)_defaultLocator.ice_encodingVersion(encoding)); } else { - locatorInfo = instance_.locatorManager().get(_defaultLocator); + locatorInfo = _instance.locatorManager().get(_defaultLocator); } } - RouterInfo routerInfo = instance_.routerManager().get(_defaultRouter); + RouterInfo routerInfo = _instance.routerManager().get(_defaultRouter); bool collocOptimized = defaultsAndOverrides.defaultCollocationOptimization; bool cacheConnection = true; bool preferSecure = defaultsAndOverrides.defaultPreferSecure; @@ -773,7 +773,7 @@ namespace IceInternal // if(propertyPrefix != null && propertyPrefix.Length > 0) { - Ice.Properties properties = instance_.initializationData().properties; + Ice.Properties properties = _instance.initializationData().properties; // // Warn about unknown properties. @@ -789,14 +789,14 @@ namespace IceInternal Ice.LocatorPrx locator = Ice.LocatorPrxHelper.uncheckedCast(_communicator.propertyToProxy(property)); if(locator != null) { - if(!((Ice.ObjectPrxHelperBase)locator).reference__().getEncoding().Equals(encoding)) + if(!((Ice.ObjectPrxHelperBase)locator).iceReference().getEncoding().Equals(encoding)) { - locatorInfo = instance_.locatorManager().get( + locatorInfo = _instance.locatorManager().get( (Ice.LocatorPrx)locator.ice_encodingVersion(encoding)); } else { - locatorInfo = instance_.locatorManager().get(locator); + locatorInfo = _instance.locatorManager().get(locator); } } @@ -808,11 +808,11 @@ namespace IceInternal { string s = "`" + property + "=" + properties.getProperty(property) + "': cannot set a router on a router; setting ignored"; - instance_.initializationData().logger.warning(s); + _instance.initializationData().logger.warning(s); } else { - routerInfo = instance_.routerManager().get(router); + routerInfo = _instance.routerManager().get(router); } } @@ -858,7 +858,7 @@ namespace IceInternal msg.Append(" `"); msg.Append(properties.getProperty(property)); msg.Append("': defaulting to -1"); - instance_.initializationData().logger.warning(msg.ToString()); + _instance.initializationData().logger.warning(msg.ToString()); } } @@ -876,7 +876,7 @@ namespace IceInternal msg.Append(" `"); msg.Append(properties.getProperty(property)); msg.Append("': defaulting to -1"); - instance_.initializationData().logger.warning(msg.ToString()); + _instance.initializationData().logger.warning(msg.ToString()); } } @@ -895,7 +895,7 @@ namespace IceInternal // // Create new reference // - return new RoutableReference(instance_, + return new RoutableReference(_instance, _communicator, ident, facet, @@ -916,7 +916,7 @@ namespace IceInternal context); } - private Instance instance_; + private Instance _instance; private Ice.Communicator _communicator; private Ice.RouterPrx _defaultRouter; private Ice.LocatorPrx _defaultLocator; diff --git a/csharp/src/Ice/RequestHandlerFactory.cs b/csharp/src/Ice/RequestHandlerFactory.cs index c30707f2492..1e4058738c6 100644 --- a/csharp/src/Ice/RequestHandlerFactory.cs +++ b/csharp/src/Ice/RequestHandlerFactory.cs @@ -26,7 +26,7 @@ namespace IceInternal Ice.ObjectAdapter adapter = _instance.objectAdapterFactory().findObjectAdapter(proxy); if(adapter != null) { - return proxy.setRequestHandler__(new CollocatedRequestHandler(rf, adapter)); + return proxy.iceSetRequestHandler(new CollocatedRequestHandler(rf, adapter)); } } @@ -54,7 +54,7 @@ namespace IceInternal { rf.getConnection(handler); } - return proxy.setRequestHandler__(handler.connect(proxy)); + return proxy.iceSetRequestHandler(handler.connect(proxy)); } internal void diff --git a/csharp/src/Ice/RouterInfo.cs b/csharp/src/Ice/RouterInfo.cs index 1a5fe9b0131..87f786ff0f2 100644 --- a/csharp/src/Ice/RouterInfo.cs +++ b/csharp/src/Ice/RouterInfo.cs @@ -207,7 +207,7 @@ namespace IceInternal // // If getClientProxy() return nil, use router endpoints. // - _clientEndpoints = ((Ice.ObjectPrxHelperBase)_router).reference__().getEndpoints(); + _clientEndpoints = ((Ice.ObjectPrxHelperBase)_router).iceReference().getEndpoints(); } else { @@ -223,7 +223,7 @@ namespace IceInternal clientProxy = clientProxy.ice_timeout(_router.ice_getConnection().timeout()); } - _clientEndpoints = ((Ice.ObjectPrxHelperBase)clientProxy).reference__().getEndpoints(); + _clientEndpoints = ((Ice.ObjectPrxHelperBase)clientProxy).iceReference().getEndpoints(); } } return _clientEndpoints; @@ -240,7 +240,7 @@ namespace IceInternal } serverProxy = serverProxy.ice_router(null); // The server proxy cannot be routed. - _serverEndpoints = ((Ice.ObjectPrxHelperBase)serverProxy).reference__().getEndpoints(); + _serverEndpoints = ((Ice.ObjectPrxHelperBase)serverProxy).iceReference().getEndpoints(); return _serverEndpoints; } } diff --git a/csharp/src/Ice/ServantManager.cs b/csharp/src/Ice/ServantManager.cs index 526e205c514..493b88cbc1a 100644 --- a/csharp/src/Ice/ServantManager.cs +++ b/csharp/src/Ice/ServantManager.cs @@ -19,7 +19,7 @@ public sealed class ServantManager { lock(this) { - Debug.Assert(instance_ != null); // Must not be called after destruction. + Debug.Assert(_instance != null); // Must not be called after destruction. if(facet == null) { @@ -37,11 +37,11 @@ public sealed class ServantManager if(m.ContainsKey(facet)) { Ice.AlreadyRegisteredException ex = new Ice.AlreadyRegisteredException(); - ex.id = Ice.Util.identityToString(ident, instance_.toStringMode()); + ex.id = Ice.Util.identityToString(ident, _instance.toStringMode()); ex.kindOfObject = "servant"; if(facet.Length > 0) { - ex.id += " -f " + IceUtilInternal.StringUtil.escapeString(facet, "", instance_.toStringMode()); + ex.id += " -f " + IceUtilInternal.StringUtil.escapeString(facet, "", _instance.toStringMode()); } throw ex; } @@ -55,7 +55,7 @@ public sealed class ServantManager { lock(this) { - Debug.Assert(instance_ != null); // Must not be called after destruction. + Debug.Assert(_instance != null); // Must not be called after destruction. Ice.Object obj = null; _defaultServantMap.TryGetValue(category, out obj); if(obj != null) @@ -74,7 +74,7 @@ public sealed class ServantManager { lock(this) { - Debug.Assert(instance_ != null); // Must not be called after destruction. + Debug.Assert(_instance != null); // Must not be called after destruction. if(facet == null) { @@ -87,11 +87,11 @@ public sealed class ServantManager if(m == null || !m.ContainsKey(facet)) { Ice.NotRegisteredException ex = new Ice.NotRegisteredException(); - ex.id = Ice.Util.identityToString(ident, instance_.toStringMode()); + ex.id = Ice.Util.identityToString(ident, _instance.toStringMode()); ex.kindOfObject = "servant"; if(facet.Length > 0) { - ex.id += " -f " + IceUtilInternal.StringUtil.escapeString(facet, "", instance_.toStringMode()); + ex.id += " -f " + IceUtilInternal.StringUtil.escapeString(facet, "", _instance.toStringMode()); } throw ex; } @@ -110,7 +110,7 @@ public sealed class ServantManager { lock(this) { - Debug.Assert(instance_ != null); // Must not be called after destruction. + Debug.Assert(_instance != null); // Must not be called after destruction. Ice.Object obj = null; _defaultServantMap.TryGetValue(category, out obj); @@ -131,14 +131,14 @@ public sealed class ServantManager { lock(this) { - Debug.Assert(instance_ != null); + Debug.Assert(_instance != null); Dictionary<string, Ice.Object> m; _servantMapMap.TryGetValue(ident, out m); if(m == null) { Ice.NotRegisteredException ex = new Ice.NotRegisteredException(); - ex.id = Ice.Util.identityToString(ident, instance_.toStringMode()); + ex.id = Ice.Util.identityToString(ident, _instance.toStringMode()); ex.kindOfObject = "servant"; throw ex; } @@ -158,7 +158,7 @@ public sealed class ServantManager // requests are received over the bidir connection after the // adapter was deactivated. // - //Debug.Assert(instance_ != null); // Must not be called after destruction. + //Debug.Assert(_instance != null); // Must not be called after destruction. if(facet == null) { @@ -189,7 +189,7 @@ public sealed class ServantManager { lock(this) { - Debug.Assert(instance_ != null); // Must not be called after destruction. + Debug.Assert(_instance != null); // Must not be called after destruction. Ice.Object obj = null; _defaultServantMap.TryGetValue(category, out obj); @@ -201,7 +201,7 @@ public sealed class ServantManager { lock(this) { - Debug.Assert(instance_ != null); // Must not be called after destruction. + Debug.Assert(_instance != null); // Must not be called after destruction. Dictionary<string, Ice.Object> m = _servantMapMap[ident]; if(m != null) @@ -224,7 +224,7 @@ public sealed class ServantManager // adapter was deactivated. // // - //Debug.Assert(instance_ != null); // Must not be called after destruction. + //Debug.Assert(_instance != null); // Must not be called after destruction. Dictionary<string, Ice.Object> m; _servantMapMap.TryGetValue(ident, out m); @@ -244,14 +244,14 @@ public sealed class ServantManager { lock(this) { - Debug.Assert(instance_ != null); // Must not be called after destruction. + Debug.Assert(_instance != null); // Must not be called after destruction. Ice.ServantLocator l; _locatorMap.TryGetValue(category, out l); if(l != null) { Ice.AlreadyRegisteredException ex = new Ice.AlreadyRegisteredException(); - ex.id = IceUtilInternal.StringUtil.escapeString(category, "", instance_.toStringMode()); + ex.id = IceUtilInternal.StringUtil.escapeString(category, "", _instance.toStringMode()); ex.kindOfObject = "servant locator"; throw ex; } @@ -264,14 +264,14 @@ public sealed class ServantManager { lock(this) { - Debug.Assert(instance_ != null); // Must not be called after destruction. + Debug.Assert(_instance != null); // Must not be called after destruction. Ice.ServantLocator l; _locatorMap.TryGetValue(category, out l); if(l == null) { Ice.NotRegisteredException ex = new Ice.NotRegisteredException(); - ex.id = IceUtilInternal.StringUtil.escapeString(category, "", instance_.toStringMode()); + ex.id = IceUtilInternal.StringUtil.escapeString(category, "", _instance.toStringMode()); ex.kindOfObject = "servant locator"; throw ex; } @@ -291,7 +291,7 @@ public sealed class ServantManager // adapter was deactivated. // // - //Debug.Assert(instance_ != null); // Must not be called after destruction. + //Debug.Assert(_instance != null); // Must not be called after destruction. Ice.ServantLocator result; _locatorMap.TryGetValue(category, out result); @@ -304,7 +304,7 @@ public sealed class ServantManager // public ServantManager(Instance instance, string adapterName) { - instance_ = instance; + _instance = instance; _adapterName = adapterName; } @@ -318,7 +318,7 @@ public sealed class ServantManager // //lock(this) //{ - //IceUtil.Assert.FinalizerAssert(instance_ == null); + //IceUtil.Assert.FinalizerAssert(_instance == null); //} } */ @@ -335,12 +335,12 @@ public sealed class ServantManager // // If the ServantManager has already been destroyed, we're done. // - if(instance_ == null) + if(_instance == null) { return; } - logger = instance_.initializationData().logger; + logger = _instance.initializationData().logger; _servantMapMap.Clear(); @@ -349,7 +349,7 @@ public sealed class ServantManager locatorMap = new Dictionary<string, Ice.ServantLocator>(_locatorMap); _locatorMap.Clear(); - instance_ = null; + _instance = null; } foreach(KeyValuePair<string, Ice.ServantLocator> p in locatorMap) @@ -368,7 +368,7 @@ public sealed class ServantManager } } - private Instance instance_; + private Instance _instance; private readonly string _adapterName; private Dictionary <Ice.Identity, Dictionary<string, Ice.Object>> _servantMapMap = new Dictionary<Ice.Identity, Dictionary<string, Ice.Object>>(); diff --git a/csharp/src/Ice/StreamWrapper.cs b/csharp/src/Ice/StreamWrapper.cs index 983182a9ff6..b41cb8a560a 100644 --- a/csharp/src/Ice/StreamWrapper.cs +++ b/csharp/src/Ice/StreamWrapper.cs @@ -25,24 +25,24 @@ namespace IceInternal // Slice sequences are encoded on the wire as a count of elements, followed // by the sequence contents. For arbitrary .NET classes, we do not know how // big the sequence that is eventually written will be. To avoid excessive - // data copying, this class maintains a private bytes_ array of 254 bytes and, + // data copying, this class maintains a private _bytes array of 254 bytes and, // initially, writes data into that array. If more than 254 bytes end up being // written, we write a dummy sequence size of 255 (which occupies five bytes // on the wire) into the stream and, once this class is disposed, patch - // that size to match the actual size. Otherwise, if the bytes_ buffer contains + // that size to match the actual size. Otherwise, if the _bytes buffer contains // fewer than 255 bytes when this class is disposed, we write the sequence size - // as a single byte, followed by the contents of the bytes_ buffer. + // as a single byte, followed by the contents of the _bytes buffer. // public class OutputStreamWrapper : System.IO.Stream, System.IDisposable { public OutputStreamWrapper(Ice.OutputStream s) { - s_ = s; - spos_ = s.pos(); - bytes_ = new byte[254]; - pos_ = 0; - length_ = 0; + _s = s; + _spos = s.pos(); + _bytes = new byte[254]; + _pos = 0; + _length = 0; } public override int Read(byte[] buffer, int offset, int count) @@ -62,38 +62,38 @@ namespace IceInternal Debug.Assert(array != null && offset >= 0 && count >= 0 && offset + count <= array.Length); try { - if(bytes_ != null) + if(_bytes != null) { // - // If we can fit the data into the first 254 bytes, write it to bytes_. + // If we can fit the data into the first 254 bytes, write it to _bytes. // - if(count <= bytes_.Length - pos_) + if(count <= _bytes.Length - _pos) { - System.Buffer.BlockCopy(array, offset, bytes_, pos_, count); - pos_ += count; + System.Buffer.BlockCopy(array, offset, _bytes, _pos, count); + _pos += count; return; } - s_.writeSize(255); // Dummy size, until we know how big the stream + _s.writeSize(255); // Dummy size, until we know how big the stream // really is and can patch the size. - if(pos_ > 0) + if(_pos > 0) { // - // Write the current contents of bytes_. + // Write the current contents of _bytes. // - s_.expand(pos_); - s_.getBuffer().b.put(bytes_, 0, pos_); + _s.expand(_pos); + _s.getBuffer().b.put(_bytes, 0, _pos); } - bytes_ = null; + _bytes = null; } // // Write data passed by caller. // - s_.expand(count); - s_.getBuffer().b.put(array, offset, count); - pos_ += count; + _s.expand(count); + _s.getBuffer().b.put(array, offset, count); + _pos += count; } catch(System.Exception ex) { @@ -105,37 +105,37 @@ namespace IceInternal { try { - if(bytes_ != null) + if(_bytes != null) { // - // If we can fit the data into the first 254 bytes, write it to bytes_. + // If we can fit the data into the first 254 bytes, write it to _bytes. // - if(pos_ < bytes_.Length) + if(_pos < _bytes.Length) { - bytes_[pos_++] = value; + _bytes[_pos++] = value; return; } - s_.writeSize(255); // Dummy size, until we know how big the stream + _s.writeSize(255); // Dummy size, until we know how big the stream // really is and can patch the size. - if(pos_ > 0) + if(_pos > 0) { // - // Write the current contents of bytes_. + // Write the current contents of _bytes. // - s_.expand(pos_); - s_.getBuffer().b.put(bytes_, 0, pos_); + _s.expand(_pos); + _s.getBuffer().b.put(_bytes, 0, _pos); } - bytes_ = null; + _bytes = null; } // // Write data passed by caller. // - s_.expand(1); - s_.getBuffer().b.put(value); - pos_ += 1; + _s.expand(1); + _s.getBuffer().b.put(value); + _pos += 1; } catch(System.Exception ex) { @@ -171,20 +171,20 @@ namespace IceInternal { try { - if(bytes_ != null) + if(_bytes != null) { - Debug.Assert(pos_ <= bytes_.Length); - s_.pos(spos_); - s_.writeSize(pos_); - s_.expand(pos_); - s_.getBuffer().b.put(bytes_, 0, pos_); + Debug.Assert(_pos <= _bytes.Length); + _s.pos(_spos); + _s.writeSize(_pos); + _s.expand(_pos); + _s.getBuffer().b.put(_bytes, 0, _pos); } else { - int currentPos = s_.pos(); - s_.pos(spos_); - s_.writeSize(pos_); // Patch previously-written dummy value. - s_.pos(currentPos); + int currentPos = _s.pos(); + _s.pos(_spos); + _s.writeSize(_pos); // Patch previously-written dummy value. + _s.pos(currentPos); } } catch(System.Exception ex) @@ -197,7 +197,7 @@ namespace IceInternal { get { - return length_; + return _length; } } @@ -205,7 +205,7 @@ namespace IceInternal { get { - return pos_; + return _pos; } set @@ -223,23 +223,23 @@ namespace IceInternal public override void SetLength(long value) { Debug.Assert(value >= 0); - length_ = value; + _length = value; } - private Ice.OutputStream s_; - private int spos_; - private byte[] bytes_; - private int pos_; - private long length_; + private Ice.OutputStream _s; + private int _spos; + private byte[] _bytes; + private int _pos; + private long _length; } public class InputStreamWrapper : System.IO.Stream, System.IDisposable { public InputStreamWrapper(int size, Ice.InputStream s) { - s_ = s; - pos_ = 0; - length_ = size; + _s = s; + _pos = 0; + _length = size; } public override int Read(byte[] buffer, int offset, int count) @@ -247,7 +247,7 @@ namespace IceInternal Debug.Assert(buffer != null && offset >= 0 && count >= 0 && offset + count <= buffer.Length); try { - s_.getBuffer().b.get(buffer, offset, count); + _s.getBuffer().b.get(buffer, offset, count); } catch(System.Exception ex) { @@ -260,7 +260,7 @@ namespace IceInternal { try { - return s_.getBuffer().b.get(); + return _s.getBuffer().b.get(); } catch(System.Exception ex) { @@ -321,7 +321,7 @@ namespace IceInternal { get { - return length_; + return _length; } } @@ -329,7 +329,7 @@ namespace IceInternal { get { - return pos_; + return _pos; } set @@ -345,17 +345,17 @@ namespace IceInternal { case SeekOrigin.Begin: { - pos_ = (int)offset; + _pos = (int)offset; break; } case SeekOrigin.Current: { - pos_ += (int)offset; + _pos += (int)offset; break; } case SeekOrigin.End: { - pos_ = (int)length_ + (int)offset; + _pos = (int)_length + (int)offset; break; } default: @@ -364,8 +364,8 @@ namespace IceInternal break; } } - s_.pos(pos_); - return pos_; + _s.pos(_pos); + return _pos; } public override void SetLength(long value) @@ -373,8 +373,8 @@ namespace IceInternal Debug.Assert(false); } - private Ice.InputStream s_; - private int pos_; - private long length_; + private Ice.InputStream _s; + private int _pos; + private long _length; } } diff --git a/csharp/src/Ice/TraceUtil.cs b/csharp/src/Ice/TraceUtil.cs index cb18fb957a9..8aec8ed6de9 100644 --- a/csharp/src/Ice/TraceUtil.cs +++ b/csharp/src/Ice/TraceUtil.cs @@ -183,7 +183,7 @@ namespace IceInternal } Ice.Identity identity = new Ice.Identity(); - identity.read__(str); + identity.iceRead(str); s.Write("\nidentity = " + Ice.Util.identityToString(identity, toStringMode)); string[] facet = str.readStringSeq(); diff --git a/csharp/src/Ice/UdpEndpointI.cs b/csharp/src/Ice/UdpEndpointI.cs index bdaa9ef35e9..0bcdfc61c82 100644 --- a/csharp/src/Ice/UdpEndpointI.cs +++ b/csharp/src/Ice/UdpEndpointI.cs @@ -259,8 +259,8 @@ namespace IceInternal base.streamWriteImpl(s); if(s.getEncoding().Equals(Ice.Util.Encoding_1_0)) { - Ice.Util.Protocol_1_0.write__(s); - Ice.Util.Encoding_1_0.write__(s); + Ice.Util.Protocol_1_0.iceWrite(s); + Ice.Util.Encoding_1_0.iceWrite(s); } // Not transmitted. //s.writeBool(_connect); diff --git a/csharp/src/Ice/UnknownSlicedValue.cs b/csharp/src/Ice/UnknownSlicedValue.cs index 4f31945a855..0d0d38c0264 100644 --- a/csharp/src/Ice/UnknownSlicedValue.cs +++ b/csharp/src/Ice/UnknownSlicedValue.cs @@ -32,16 +32,16 @@ namespace Ice return _unknownTypeId; } - public override void write__(OutputStream os__) + public override void iceWrite(OutputStream ostr) { - os__.startValue(_slicedData); - os__.endValue(); + ostr.startValue(_slicedData); + ostr.endValue(); } - public override void read__(InputStream is__) + public override void iceRead(InputStream istr) { - is__.startValue(); - _slicedData = is__.endValue(true); + istr.startValue(); + _slicedData = istr.endValue(true); } private string _unknownTypeId; diff --git a/csharp/src/Ice/Value.cs b/csharp/src/Ice/Value.cs index cf4fd0144d7..b3c9924811e 100644 --- a/csharp/src/Ice/Value.cs +++ b/csharp/src/Ice/Value.cs @@ -14,7 +14,7 @@ namespace Ice [Serializable] public abstract class Value : ICloneable { - public static readonly string static_id__ = "::Ice::Object"; + private const string _id = "::Ice::Object"; /// <summary> /// Returns the Slice type ID of the interface supported by this object. @@ -22,7 +22,7 @@ namespace Ice /// <returns>The return value is always ::Ice::Object.</returns> public static string ice_staticId() { - return static_id__; + return _id; } /// <summary> @@ -31,7 +31,7 @@ namespace Ice /// <returns>The return value is always ::Ice::Object.</returns> public virtual string ice_id() { - return static_id__; + return _id; } /// <summary> @@ -50,25 +50,25 @@ namespace Ice { } - public virtual void write__(OutputStream os__) + public virtual void iceWrite(OutputStream ostr) { - os__.startValue(null); - writeImpl__(os__); - os__.endValue(); + ostr.startValue(null); + iceWriteImpl(ostr); + ostr.endValue(); } - public virtual void read__(InputStream is__) + public virtual void iceRead(InputStream istr) { - is__.startValue(); - readImpl__(is__); - is__.endValue(false); + istr.startValue(); + iceReadImpl(istr); + istr.endValue(false); } - protected virtual void writeImpl__(OutputStream os__) + protected virtual void iceWriteImpl(OutputStream ostr) { } - protected virtual void readImpl__(InputStream is__) + protected virtual void iceReadImpl(InputStream istr) { } @@ -87,26 +87,26 @@ namespace Ice { public InterfaceByValue(string id) { - id_ = id; + _id = id; } public override string ice_id() { - return id_; + return _id; } - protected override void writeImpl__(OutputStream os__) + protected override void iceWriteImpl(OutputStream ostr) { - os__.startSlice(ice_id(), -1, true); - os__.endSlice(); + ostr.startSlice(ice_id(), -1, true); + ostr.endSlice(); } - protected override void readImpl__(InputStream is__) + protected override void iceReadImpl(InputStream istr) { - is__.startSlice(); - is__.endSlice(); + istr.startSlice(); + istr.endSlice(); } - private string id_; + private string _id; } } diff --git a/csharp/src/Ice/ValueWriter.cs b/csharp/src/Ice/ValueWriter.cs index 9973e8a51d4..811b3f0c8a0 100644 --- a/csharp/src/Ice/ValueWriter.cs +++ b/csharp/src/Ice/ValueWriter.cs @@ -70,7 +70,7 @@ namespace IceInternal { writeName(name, output); Ice.ObjectPrxHelperBase proxy = (Ice.ObjectPrxHelperBase)val; - output.print(proxy.reference__().ToString()); + output.print(proxy.iceReference().ToString()); } else if(val is Ice.Object) { diff --git a/csharp/src/IceSSL/TrustManager.cs b/csharp/src/IceSSL/TrustManager.cs index 2813ecdc942..d9f53b058c5 100644 --- a/csharp/src/IceSSL/TrustManager.cs +++ b/csharp/src/IceSSL/TrustManager.cs @@ -20,18 +20,18 @@ namespace IceSSL internal TrustManager(Ice.Communicator communicator) { Debug.Assert(communicator != null); - communicator_ = communicator; + _communicator = communicator; Ice.Properties properties = communicator.getProperties(); - traceLevel_ = properties.getPropertyAsInt("IceSSL.Trace.Security"); + _traceLevel = properties.getPropertyAsInt("IceSSL.Trace.Security"); string key = null; try { key = "IceSSL.TrustOnly"; - parse(properties.getProperty(key), rejectAll_, acceptAll_); + parse(properties.getProperty(key), _rejectAll, _acceptAll); key = "IceSSL.TrustOnly.Client"; - parse(properties.getProperty(key), rejectClient_, acceptClient_); + parse(properties.getProperty(key), _rejectClient, _acceptClient); key = "IceSSL.TrustOnly.Server"; - parse(properties.getProperty(key), rejectAllServer_, acceptAllServer_); + parse(properties.getProperty(key), _rejectAllServer, _acceptAllServer); Dictionary<string, string> dict = properties.getPropertiesForPrefix("IceSSL.TrustOnly.Server."); foreach(KeyValuePair<string, string> entry in dict) { @@ -42,11 +42,11 @@ namespace IceSSL parse(entry.Value, reject, accept); if(reject.Count > 0) { - rejectServer_[name] = reject; + _rejectServer[name] = reject; } if(accept.Count > 0) { - acceptServer_[name] = accept; + _acceptServer[name] = accept; } } } @@ -63,20 +63,20 @@ namespace IceSSL List<List<List<RFC2253.RDNPair>>> reject = new List<List<List<RFC2253.RDNPair>>>(), accept = new List<List<List<RFC2253.RDNPair>>>(); - if(rejectAll_.Count != 0) + if(_rejectAll.Count != 0) { - reject.Add(rejectAll_); + reject.Add(_rejectAll); } if(info.incoming) { - if(rejectAllServer_.Count != 0) + if(_rejectAllServer.Count != 0) { - reject.Add(rejectAllServer_); + reject.Add(_rejectAllServer); } if(info.adapterName.Length > 0) { List<List<RFC2253.RDNPair>> p = null; - if(rejectServer_.TryGetValue(info.adapterName, out p)) + if(_rejectServer.TryGetValue(info.adapterName, out p)) { reject.Add(p); } @@ -84,26 +84,26 @@ namespace IceSSL } else { - if(rejectClient_.Count != 0) + if(_rejectClient.Count != 0) { - reject.Add(rejectClient_); + reject.Add(_rejectClient); } } - if(acceptAll_.Count != 0) + if(_acceptAll.Count != 0) { - accept.Add(acceptAll_); + accept.Add(_acceptAll); } if(info.incoming) { - if(acceptAllServer_.Count != 0) + if(_acceptAllServer.Count != 0) { - accept.Add(acceptAllServer_); + accept.Add(_acceptAllServer); } if(info.adapterName.Length > 0) { List<List<RFC2253.RDNPair>> p = null; - if(acceptServer_.TryGetValue(info.adapterName, out p)) + if(_acceptServer.TryGetValue(info.adapterName, out p)) { accept.Add(p); } @@ -111,9 +111,9 @@ namespace IceSSL } else { - if(acceptClient_.Count != 0) + if(_acceptClient.Count != 0) { - accept.Add(acceptClient_); + accept.Add(_acceptClient); } } @@ -138,16 +138,16 @@ namespace IceSSL // // Decompose the subject DN into the RDNs. // - if(traceLevel_ > 0) + if(_traceLevel > 0) { if(info.incoming) { - communicator_.getLogger().trace("Security", "trust manager evaluating client:\n" + + _communicator.getLogger().trace("Security", "trust manager evaluating client:\n" + "subject = " + subjectName + "\n" + "adapter = " + info.adapterName + "\n" + desc); } else { - communicator_.getLogger().trace("Security", "trust manager evaluating server:\n" + + _communicator.getLogger().trace("Security", "trust manager evaluating server:\n" + "subject = " + subjectName + "\n" + desc); } } @@ -171,11 +171,11 @@ namespace IceSSL // foreach(List<List<RFC2253.RDNPair>> matchSet in reject) { - if(traceLevel_ > 0) + if(_traceLevel > 0) { StringBuilder s = new StringBuilder("trust manager rejecting PDNs:\n"); stringify(matchSet, s); - communicator_.getLogger().trace("Security", s.ToString()); + _communicator.getLogger().trace("Security", s.ToString()); } if(match(matchSet, dn)) { @@ -188,11 +188,11 @@ namespace IceSSL // foreach(List<List<RFC2253.RDNPair>> matchSet in accept) { - if(traceLevel_ > 0) + if(_traceLevel > 0) { StringBuilder s = new StringBuilder("trust manager accepting PDNs:\n"); stringify(matchSet, s); - communicator_.getLogger().trace("Security", s.ToString()); + _communicator.getLogger().trace("Security", s.ToString()); } if(match(matchSet, dn)) { @@ -202,7 +202,7 @@ namespace IceSSL } catch(RFC2253.ParseException e) { - communicator_.getLogger().warning( + _communicator.getLogger().warning( "IceSSL: unable to parse certificate DN `" + subjectName + "'\nreason: " + e.reason); } @@ -316,19 +316,19 @@ namespace IceSSL } } - private Ice.Communicator communicator_; - private int traceLevel_; + private Ice.Communicator _communicator; + private int _traceLevel; - private List<List<RFC2253.RDNPair>> rejectAll_ = new List<List<RFC2253.RDNPair>>(); - private List<List<RFC2253.RDNPair>> rejectClient_ = new List<List<RFC2253.RDNPair>>(); - private List<List<RFC2253.RDNPair>> rejectAllServer_ = new List<List<RFC2253.RDNPair>>(); - private Dictionary<string, List<List<RFC2253.RDNPair>>> rejectServer_ = + private List<List<RFC2253.RDNPair>> _rejectAll = new List<List<RFC2253.RDNPair>>(); + private List<List<RFC2253.RDNPair>> _rejectClient = new List<List<RFC2253.RDNPair>>(); + private List<List<RFC2253.RDNPair>> _rejectAllServer = new List<List<RFC2253.RDNPair>>(); + private Dictionary<string, List<List<RFC2253.RDNPair>>> _rejectServer = new Dictionary<string, List<List<RFC2253.RDNPair>>>(); - private List<List<RFC2253.RDNPair>> acceptAll_ = new List<List<RFC2253.RDNPair>>(); - private List<List<RFC2253.RDNPair>> acceptClient_ = new List<List<RFC2253.RDNPair>>(); - private List<List<RFC2253.RDNPair>> acceptAllServer_ = new List<List<RFC2253.RDNPair>>(); - private Dictionary<string, List<List<RFC2253.RDNPair>>> acceptServer_ = + private List<List<RFC2253.RDNPair>> _acceptAll = new List<List<RFC2253.RDNPair>>(); + private List<List<RFC2253.RDNPair>> _acceptClient = new List<List<RFC2253.RDNPair>>(); + private List<List<RFC2253.RDNPair>> _acceptAllServer = new List<List<RFC2253.RDNPair>>(); + private Dictionary<string, List<List<RFC2253.RDNPair>>> _acceptServer = new Dictionary<string, List<List<RFC2253.RDNPair>>>(); } } diff --git a/csharp/test/Ice/binding/AllTests.cs b/csharp/test/Ice/binding/AllTests.cs index 510cecec622..de76daa74f8 100644 --- a/csharp/test/Ice/binding/AllTests.cs +++ b/csharp/test/Ice/binding/AllTests.cs @@ -45,7 +45,7 @@ public class AllTests : TestCommon.TestApp { for (int i = 0; i < array.Count - 1; ++i) { - int r = rand_.Next(array.Count - i) + i; + int r = _rand.Next(array.Count - i) + i; Debug.Assert(r >= i && r < array.Count); if (r != i) { @@ -949,5 +949,5 @@ public class AllTests : TestCommon.TestApp com.shutdown(); } - private static System.Random rand_ = new System.Random(unchecked((int)System.DateTime.Now.Ticks)); + private static System.Random _rand = new System.Random(unchecked((int)System.DateTime.Now.Ticks)); } diff --git a/csharp/test/Ice/optional/AllTests.cs b/csharp/test/Ice/optional/AllTests.cs index 522d0ad9900..b012684c7d3 100644 --- a/csharp/test/Ice/optional/AllTests.cs +++ b/csharp/test/Ice/optional/AllTests.cs @@ -1021,7 +1021,7 @@ public class AllTests : TestCommon.TestApp os.startEncapsulation(); os.writeOptional(2, Ice.OptionalFormat.VSize); os.writeSize(1); - p1.Value.write__(os); + p1.Value.iceWrite(os); os.endEncapsulation(); inEncaps = os.finished(); initial.ice_invoke("opSmallStruct", Ice.OperationMode.Normal, inEncaps, out outEncaps); @@ -1030,11 +1030,11 @@ public class AllTests : TestCommon.TestApp test(@in.readOptional(1, Ice.OptionalFormat.VSize)); @in.skipSize(); Test.SmallStruct f = new Test.SmallStruct(); - f.read__(@in); + f.iceRead(@in); test(f.m == (byte)56); test(@in.readOptional(3, Ice.OptionalFormat.VSize)); @in.skipSize(); - f.read__(@in); + f.iceRead(@in); test(f.m == (byte)56); @in.endEncapsulation(); @@ -1070,7 +1070,7 @@ public class AllTests : TestCommon.TestApp os.startEncapsulation(); os.writeOptional(2, Ice.OptionalFormat.VSize); os.writeSize(4); - p1.Value.write__(os); + p1.Value.iceWrite(os); os.endEncapsulation(); inEncaps = os.finished(); initial.ice_invoke("opFixedStruct", Ice.OperationMode.Normal, inEncaps, out outEncaps); @@ -1079,11 +1079,11 @@ public class AllTests : TestCommon.TestApp test(@in.readOptional(1, Ice.OptionalFormat.VSize)); @in.skipSize(); Test.FixedStruct f = new Test.FixedStruct(); - f.read__(@in); + f.iceRead(@in); test(f.m == 56); test(@in.readOptional(3, Ice.OptionalFormat.VSize)); @in.skipSize(); - f.read__(@in); + f.iceRead(@in); test(f.m == 56); @in.endEncapsulation(); @@ -1124,7 +1124,7 @@ public class AllTests : TestCommon.TestApp os.startEncapsulation(); os.writeOptional(2, Ice.OptionalFormat.FSize); int pos = os.startSize(); - p1.Value.write__(os); + p1.Value.iceWrite(os); os.endSize(pos); os.endEncapsulation(); inEncaps = os.finished(); @@ -1134,11 +1134,11 @@ public class AllTests : TestCommon.TestApp test(@in.readOptional(1, Ice.OptionalFormat.FSize)); @in.skip(4); Test.VarStruct v = new Test.VarStruct(); - v.read__(@in); + v.iceRead(@in); test(v.m.Equals("test")); test(@in.readOptional(3, Ice.OptionalFormat.FSize)); @in.skip(4); - v.read__(@in); + v.iceRead(@in); test(v.m.Equals("test")); @in.endEncapsulation(); diff --git a/csharp/test/Ice/stream/AllTests.cs b/csharp/test/Ice/stream/AllTests.cs index e7aba7107df..19eef43c41d 100644 --- a/csharp/test/Ice/stream/AllTests.cs +++ b/csharp/test/Ice/stream/AllTests.cs @@ -69,7 +69,7 @@ public class AllTests : TestCommon.TestApp public override void write(Ice.OutputStream outS) { - obj.write__(outS); + obj.iceWrite(outS); called = true; } @@ -82,7 +82,7 @@ public class AllTests : TestCommon.TestApp public override void read(Ice.InputStream inS) { obj = new MyClass(); - obj.read__(inS); + obj.iceRead(inS); called = true; } diff --git a/csharp/test/IceSSL/configuration/CertificateVerifierI.cs b/csharp/test/IceSSL/configuration/CertificateVerifierI.cs index d571566636d..13c25af56b9 100644 --- a/csharp/test/IceSSL/configuration/CertificateVerifierI.cs +++ b/csharp/test/IceSSL/configuration/CertificateVerifierI.cs @@ -18,34 +18,34 @@ public class CertificateVerifierI : IceSSL.CertificateVerifier public bool verify(IceSSL.NativeConnectionInfo info) { - hadCert_ = info.nativeCerts != null; - invoked_ = true; - return returnValue_; + _hadCert = info.nativeCerts != null; + _invoked = true; + return _returnValue; } internal void reset() { - returnValue_ = true; - invoked_ = false; - hadCert_ = false; + _returnValue = true; + _invoked = false; + _hadCert = false; } internal void returnValue(bool b) { - returnValue_ = b; + _returnValue = b; } internal bool invoked() { - return invoked_; + return _invoked; } internal bool hadCert() { - return hadCert_; + return _hadCert; } - private bool returnValue_; - private bool invoked_; - private bool hadCert_; + private bool _returnValue; + private bool _invoked; + private bool _hadCert; } diff --git a/csharp/test/IceSSL/configuration/PasswordCallbackI.cs b/csharp/test/IceSSL/configuration/PasswordCallbackI.cs index aafde7fe3e3..e88c97a0fbf 100644 --- a/csharp/test/IceSSL/configuration/PasswordCallbackI.cs +++ b/csharp/test/IceSSL/configuration/PasswordCallbackI.cs @@ -15,17 +15,17 @@ public class PasswordCallbackI : IceSSL.PasswordCallback { public PasswordCallbackI() { - password_ = createSecureString("password"); + _password = createSecureString("password"); } public PasswordCallbackI(string password) { - password_ = createSecureString(password); + _password = createSecureString(password); } public SecureString getPassword(string file) { - return password_; + return _password; } public SecureString getImportPassword(string file) @@ -44,5 +44,5 @@ public class PasswordCallbackI : IceSSL.PasswordCallback return result; } - private SecureString password_; + private SecureString _password; } diff --git a/csharp/test/IceSSL/configuration/TestI.cs b/csharp/test/IceSSL/configuration/TestI.cs index b144dc0af9d..c3d66c08450 100644 --- a/csharp/test/IceSSL/configuration/TestI.cs +++ b/csharp/test/IceSSL/configuration/TestI.cs @@ -16,7 +16,7 @@ internal sealed class ServerI : ServerDisp_ { internal ServerI(Ice.Communicator communicator) { - communicator_ = communicator; + _communicator = communicator; } public override void @@ -66,7 +66,7 @@ internal sealed class ServerI : ServerDisp_ internal void destroy() { - communicator_.destroy(); + _communicator.destroy(); } private static void test(bool b) @@ -77,7 +77,7 @@ internal sealed class ServerI : ServerDisp_ } } - private Ice.Communicator communicator_; + private Ice.Communicator _communicator; } internal sealed class ServerFactoryI : ServerFactoryDisp_ @@ -103,7 +103,7 @@ internal sealed class ServerFactoryI : ServerFactoryDisp_ Ice.ObjectAdapter adapter = communicator.createObjectAdapterWithEndpoints("ServerAdapter", "ssl"); ServerI server = new ServerI(communicator); Ice.ObjectPrx obj = adapter.addWithUUID(server); - servers_[obj.ice_getIdentity()] = server; + _servers[obj.ice_getIdentity()] = server; adapter.activate(); return ServerPrxHelper.uncheckedCast(obj); } @@ -111,19 +111,19 @@ internal sealed class ServerFactoryI : ServerFactoryDisp_ public override void destroyServer(ServerPrx srv, Ice.Current current) { Ice.Identity key = srv.ice_getIdentity(); - if(servers_.Contains(key)) + if(_servers.Contains(key)) { - ServerI server = servers_[key] as ServerI; + ServerI server = _servers[key] as ServerI; server.destroy(); - servers_.Remove(key); + _servers.Remove(key); } } public override void shutdown(Ice.Current current) { - test(servers_.Count == 0); + test(_servers.Count == 0); current.adapter.getCommunicator().shutdown(); } - private Hashtable servers_ = new Hashtable(); + private Hashtable _servers = new Hashtable(); } diff --git a/csharp/test/Slice/keyword/Client.cs b/csharp/test/Slice/keyword/Client.cs index e2835a837ba..79cef005fb7 100644 --- a/csharp/test/Slice/keyword/Client.cs +++ b/csharp/test/Slice/keyword/Client.cs @@ -24,7 +24,7 @@ public class Client public sealed class caseI : @abstract.caseDisp_ { public override Task<int> - catchAsync(int @checked, Ice.Current current__) + catchAsync(int @checked, Ice.Current current) { return Task<int>.FromResult(0); } @@ -32,14 +32,14 @@ public class Client public sealed class decimalI : @abstract.decimalDisp_ { - public override void @default(Ice.Current current__) + public override void @default(Ice.Current current) { } } public sealed class delegateI : @abstract.delegateDisp_ { - public override void foo(@abstract.casePrx @else, out int @event, Ice.Current current__) + public override void foo(@abstract.casePrx @else, out int @event, Ice.Current current) { @event = 0; } @@ -48,7 +48,7 @@ public class Client public sealed class explicitI : @abstract.explicitDisp_ { public override Task<int> - catchAsync(int @checked, Ice.Current current__) + catchAsync(int @checked, Ice.Current current) { return Task<int>.FromResult(0); } @@ -58,7 +58,7 @@ public class Client test(current.operation == "default"); } - public override void foo(@abstract.casePrx @else, out int @event, Ice.Current current__) + public override void foo(@abstract.casePrx @else, out int @event, Ice.Current current) { @event = 0; } |