summaryrefslogtreecommitdiff
path: root/cpp/src/Slice/CPlusPlusUtil.cpp
diff options
context:
space:
mode:
authorMarc Laukien <marc@zeroc.com>2003-03-22 02:52:20 +0000
committerMarc Laukien <marc@zeroc.com>2003-03-22 02:52:20 +0000
commit5fd59161a2887aa50cdefac4df300792a7804544 (patch)
tree08013bd6735eed32a5ebfa65090f94fba789a751 /cpp/src/Slice/CPlusPlusUtil.cpp
parentFixed unmarshaling side for classes that have a member that is only forward (diff)
downloadice-5fd59161a2887aa50cdefac4df300792a7804544.tar.bz2
ice-5fd59161a2887aa50cdefac4df300792a7804544.tar.xz
ice-5fd59161a2887aa50cdefac4df300792a7804544.zip
marshal code optimization
Diffstat (limited to 'cpp/src/Slice/CPlusPlusUtil.cpp')
-rw-r--r--cpp/src/Slice/CPlusPlusUtil.cpp76
1 files changed, 4 insertions, 72 deletions
diff --git a/cpp/src/Slice/CPlusPlusUtil.cpp b/cpp/src/Slice/CPlusPlusUtil.cpp
index 6909df3d44d..1baee9853e6 100644
--- a/cpp/src/Slice/CPlusPlusUtil.cpp
+++ b/cpp/src/Slice/CPlusPlusUtil.cpp
@@ -418,39 +418,6 @@ Slice::writeMarshalUnmarshalCode(Output& out, const TypePtr& type, const string&
}
}
- ClassDeclPtr cl = ClassDeclPtr::dynamicCast(type);
- if(cl)
- {
- out << sb;
- string scope = fixKwd(cl->scope());
- if(marshal)
- {
- out << nl << scope << "__write(" << stream << ", " << fixedParam << ");";
- }
- else
- {
- ClassDefPtr def = cl->definition();
- string factory;
- string type;
- if(def && !def->isAbstract())
- {
- factory = fixKwd(cl->scoped());
- factory += "::ice_factory()";
- type = fixKwd(cl->scoped());
- type += "::ice_staticId()";
- }
- else
- {
- factory = "0";
- type = "\"\"";
- }
- out << nl << scope << "__read(" << stream << ", " << type << ", " << factory << ", " << fixedParam << ");";
- }
- out << eb;
-
- return;
- }
-
StructPtr st = StructPtr::dynamicCast(type);
if(st)
{
@@ -628,48 +595,13 @@ Slice::writeGenericMarshalUnmarshalCode(Output& out, const TypePtr& type, const
}
else
{
- out << nl << fixedParam << " = " << stream << deref << streamFunc << outputBuiltinTable[builtin->kind()]
- << "(" << tagName << ");";
+ out << nl << fixedParam << " = " << stream << deref << streamFunc
+ << outputBuiltinTable[builtin->kind()] << "(" << tagName << ");";
}
return;
}
}
- ClassDeclPtr cl = ClassDeclPtr::dynamicCast(type);
- if(cl)
- {
- string scope = fixKwd(cl->scope());
- out << sb;
- if(marshal)
- {
- out << nl << scope << "__" << streamFunc << "Object(" << stream << ", " << tagName << ", "
- << fixedParam << ");";
- }
- else
- {
- ClassDefPtr def = cl->definition();
- string factory;
- string type;
- if(def && !def->isAbstract())
- {
- factory = fixKwd(cl->scoped());
- factory += "::ice_factory()";
- type = fixKwd(cl->scoped());
- type += "::ice_staticId()";
- }
- else
- {
- factory = "0";
- type = "\"\"";
- }
- out << nl << scope << "__" << streamFunc << "Object(" << stream << ", " << tagName << ", "
- << type << ", " << factory << ", " << fixedParam << ");";
- }
- out << eb;
-
- return;
- }
-
StructPtr st = StructPtr::dynamicCast(type);
if(st)
{
@@ -690,8 +622,8 @@ Slice::writeGenericMarshalUnmarshalCode(Output& out, const TypePtr& type, const
}
else
{
- out << nl << fixedParam << " = " << stream << deref << streamFunc << outputBuiltinTable[builtin->kind()]
- << "Seq(" << tagName << ");";
+ out << nl << fixedParam << " = " << stream << deref << streamFunc
+ << outputBuiltinTable[builtin->kind()] << "Seq(" << tagName << ");";
}
}
else