summaryrefslogtreecommitdiff
path: root/cpp/src/Slice/CsUtil.cpp
diff options
context:
space:
mode:
authorMichi Henning <michi@zeroc.com>2004-04-01 05:02:02 +0000
committerMichi Henning <michi@zeroc.com>2004-04-01 05:02:02 +0000
commit5953a354aed4513ae3aad4d4ec03ca8d750277fd (patch)
tree35ab559f7d33ce0c7e47871fd4907d709d8725c3 /cpp/src/Slice/CsUtil.cpp
parentfix (diff)
downloadice-5953a354aed4513ae3aad4d4ec03ca8d750277fd.tar.bz2
ice-5953a354aed4513ae3aad4d4ec03ca8d750277fd.tar.xz
ice-5953a354aed4513ae3aad4d4ec03ca8d750277fd.zip
Fixed bug in code generator for sequences of structs.
Diffstat (limited to 'cpp/src/Slice/CsUtil.cpp')
-rwxr-xr-xcpp/src/Slice/CsUtil.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/cpp/src/Slice/CsUtil.cpp b/cpp/src/Slice/CsUtil.cpp
index 7a8713cc3e7..4a29dc6cb94 100755
--- a/cpp/src/Slice/CsUtil.cpp
+++ b/cpp/src/Slice/CsUtil.cpp
@@ -600,6 +600,30 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out,
return;
}
+ StructPtr st = StructPtr::dynamicCast(type);
+ if(st)
+ {
+ if(marshal)
+ {
+ out << nl << stream << ".writeSize(" << param << ".Count);";
+ out << nl << "for(int __i = 0; __i < " << param << ".Count; ++__i)";
+ out << sb;
+ out << nl << param << "[__i].__write(" << stream << ");";
+ out << eb;
+ }
+ else
+ {
+ out << nl << "int sz = " << stream << ".readSize();";
+ out << nl << "for(int __i = 0; __i < " << param << ".Count; ++__i)";
+ out << sb;
+ string typeS = typeToString(st);
+ out << nl << param << ".Add(new " << typeS << "());";
+ out << nl << param << "[__i].__read(" << stream << ");";
+ out << eb;
+ }
+ return;
+ }
+
EnumPtr en = EnumPtr::dynamicCast(type);
if(en)