summaryrefslogtreecommitdiff
path: root/cpp/src/Slice/CsUtil.cpp
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2006-06-08 14:15:20 +0000
committerMark Spruiell <mes@zeroc.com>2006-06-08 14:15:20 +0000
commitf85a964893e985543dd87a1da616a445130761ac (patch)
tree8a8a8a610c8740f8944faa21e00b16e9a1ed88f3 /cpp/src/Slice/CsUtil.cpp
parentFix (diff)
downloadice-f85a964893e985543dd87a1da616a445130761ac.tar.bz2
ice-f85a964893e985543dd87a1da616a445130761ac.tar.xz
ice-f85a964893e985543dd87a1da616a445130761ac.zip
fix for bug 774: simplify use of streaming API in templates
Diffstat (limited to 'cpp/src/Slice/CsUtil.cpp')
-rwxr-xr-xcpp/src/Slice/CsUtil.cpp45
1 files changed, 40 insertions, 5 deletions
diff --git a/cpp/src/Slice/CsUtil.cpp b/cpp/src/Slice/CsUtil.cpp
index 5eaf8c340d0..5118fdd0484 100755
--- a/cpp/src/Slice/CsUtil.cpp
+++ b/cpp/src/Slice/CsUtil.cpp
@@ -463,13 +463,27 @@ Slice::CsGenerator::writeMarshalUnmarshalCode(Output &out,
{
if(marshal)
{
- out << nl << param << ".write__(" << stream << ");";
+ if(streamingAPI)
+ {
+ out << nl << param << ".ice_write(" << stream << ");";
+ }
+ else
+ {
+ out << nl << param << ".write__(" << stream << ");";
+ }
}
else
{
string typeS = typeToString(type);
out << nl << param << " = new " << typeS << "();";
- out << nl << param << ".read__(" << stream << ");";
+ if(streamingAPI)
+ {
+ out << nl << param << ".ice_read(" << stream << ");";
+ }
+ else
+ {
+ out << nl << param << ".read__(" << stream << ");";
+ }
}
return;
}
@@ -756,7 +770,14 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out,
out << nl << stream << ".writeSize(" << param << '.' << limitID << ");";
out << nl << "for(int ix__ = 0; ix__ < " << param << '.' << limitID << "; ++ix__)";
out << sb;
- out << nl << param << "[ix__].write__(" << stream << ");";
+ if(streamingAPI)
+ {
+ out << nl << param << "[ix__].ice_write(" << stream << ");";
+ }
+ else
+ {
+ out << nl << param << "[ix__].write__(" << stream << ");";
+ }
out << eb;
out << eb;
}
@@ -793,12 +814,26 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out,
{
out << nl << param << "[ix__] = new " << typeS << "();";
}
- out << nl << param << "[ix__].read__(" << stream << ");";
+ if(streamingAPI)
+ {
+ out << nl << param << "[ix__].ice_read(" << stream << ");";
+ }
+ else
+ {
+ out << nl << param << "[ix__].read__(" << stream << ");";
+ }
}
else
{
out << nl << typeS << " val__ = new " << typeS << "();";
- out << nl << "val__.read__(" << stream << ");";
+ if(streamingAPI)
+ {
+ out << nl << "val__.ice_read(" << stream << ");";
+ }
+ else
+ {
+ out << nl << "val__.read__(" << stream << ");";
+ }
out << nl << param << ".Add(val__);";
}
if(!streamingAPI && type->isVariableLength())