summaryrefslogtreecommitdiff
path: root/cpp/src/Slice/JavaUtil.cpp
diff options
context:
space:
mode:
authorBrent Eagles <brent@zeroc.com>2005-04-05 11:27:37 +0000
committerBrent Eagles <brent@zeroc.com>2005-04-05 11:27:37 +0000
commit39c3a0f56b6dc3b4e9c43c2a08ec0e8bfb01015d (patch)
treebaa4226358702a82ca34cef2e19c3b8ab39512ea /cpp/src/Slice/JavaUtil.cpp
parentfix for bug 178 (diff)
downloadice-39c3a0f56b6dc3b4e9c43c2a08ec0e8bfb01015d.tar.bz2
ice-39c3a0f56b6dc3b4e9c43c2a08ec0e8bfb01015d.tar.xz
ice-39c3a0f56b6dc3b4e9c43c2a08ec0e8bfb01015d.zip
Removing class support from slice2javae and slice2cppe translators.
removed generation of object marshalling code added validation code for parsers added feature set flag to slice parser library (defaults to Ice feature set)
Diffstat (limited to 'cpp/src/Slice/JavaUtil.cpp')
-rw-r--r--cpp/src/Slice/JavaUtil.cpp179
1 files changed, 99 insertions, 80 deletions
diff --git a/cpp/src/Slice/JavaUtil.cpp b/cpp/src/Slice/JavaUtil.cpp
index 88ca2adf72f..049b62da2f4 100644
--- a/cpp/src/Slice/JavaUtil.cpp
+++ b/cpp/src/Slice/JavaUtil.cpp
@@ -154,6 +154,13 @@ Slice::JavaGenerator::JavaGenerator(const string& dir) :
{
}
+Slice::JavaGenerator::JavaGenerator(const string& dir, Slice::FeatureProfile profile) :
+ _featureProfile(profile),
+ _dir(dir),
+ _out(0)
+{
+}
+
Slice::JavaGenerator::~JavaGenerator()
{
assert(_out == 0);
@@ -660,28 +667,31 @@ Slice::JavaGenerator::writeMarshalUnmarshalCode(Output& out,
}
case Builtin::KindObject:
{
- if(marshal)
- {
- out << nl << stream << ".writeObject(" << v << ");";
- }
- else
- {
- if(holder)
+ if(_featureProfile != Slice::IceE)
+ {
+ if(marshal)
{
- out << nl << stream << ".readObject(" << param << ".getPatcher());";
+ out << nl << stream << ".writeObject(" << v << ");";
}
else
{
- if(patchParams.empty())
- {
- out << nl << stream << ".readObject(new Patcher());";
- }
- else
- {
- out << nl << stream << ".readObject(" << patchParams << ");";
- }
+ if(holder)
+ {
+ out << nl << stream << ".readObject(" << param << ".getPatcher());";
+ }
+ else
+ {
+ if(patchParams.empty())
+ {
+ out << nl << stream << ".readObject(new Patcher());";
+ }
+ else
+ {
+ out << nl << stream << ".readObject(" << patchParams << ");";
+ }
+ }
}
- }
+ }
break;
}
case Builtin::KindObjectProxy:
@@ -723,29 +733,32 @@ Slice::JavaGenerator::writeMarshalUnmarshalCode(Output& out,
ClassDeclPtr cl = ClassDeclPtr::dynamicCast(type);
if(cl)
{
- if(marshal)
- {
- out << nl << stream << ".writeObject(" << v << ");";
- }
- else
- {
- string typeS = typeToString(type, TypeModeIn, package);
- if(holder)
+ if(_featureProfile != Slice::IceE)
+ {
+ if(marshal)
{
- out << nl << stream << ".readObject(" << param << ".getPatcher());";
+ out << nl << stream << ".writeObject(" << v << ");";
}
else
{
- if(patchParams.empty())
- {
- out << nl << stream << ".readObject(new Patcher());";
- }
- else
- {
- out << nl << stream << ".readObject(" << patchParams << ");";
- }
+ string typeS = typeToString(type, TypeModeIn, package);
+ if(holder)
+ {
+ out << nl << stream << ".readObject(" << param << ".getPatcher());";
+ }
+ else
+ {
+ if(patchParams.empty())
+ {
+ out << nl << stream << ".readObject(new Patcher());";
+ }
+ else
+ {
+ out << nl << stream << ".readObject(" << patchParams << ");";
+ }
+ }
}
- }
+ }
return;
}
@@ -1551,28 +1564,31 @@ Slice::JavaGenerator::writeStreamMarshalUnmarshalCode(Output& out,
}
case Builtin::KindObject:
{
- if(marshal)
- {
- out << nl << stream << ".writeObject(" << v << ");";
- }
- else
- {
- if(holder)
- {
- out << nl << stream << ".readObject((Ice.ReadObjectCallback)" << param << ".getPatcher());";
- }
- else
- {
- if(patchParams.empty())
- {
- out << nl << stream << ".readObject(new Patcher());";
- }
- else
- {
- out << nl << stream << ".readObject(" << patchParams << ");";
- }
- }
- }
+ if(_featureProfile != Slice::IceE)
+ {
+ if(marshal)
+ {
+ out << nl << stream << ".writeObject(" << v << ");";
+ }
+ else
+ {
+ if(holder)
+ {
+ out << nl << stream << ".readObject((Ice.ReadObjectCallback)" << param << ".getPatcher());";
+ }
+ else
+ {
+ if(patchParams.empty())
+ {
+ out << nl << stream << ".readObject(new Patcher());";
+ }
+ else
+ {
+ out << nl << stream << ".readObject(" << patchParams << ");";
+ }
+ }
+ }
+ }
break;
}
case Builtin::KindObjectProxy:
@@ -1614,29 +1630,32 @@ Slice::JavaGenerator::writeStreamMarshalUnmarshalCode(Output& out,
ClassDeclPtr cl = ClassDeclPtr::dynamicCast(type);
if(cl)
{
- if(marshal)
- {
- out << nl << stream << ".writeObject(" << v << ");";
- }
- else
- {
- string typeS = typeToString(type, TypeModeIn, package);
- if(holder)
- {
- out << nl << stream << ".readObject(" << param << ".getPatcher());";
- }
- else
- {
- if(patchParams.empty())
- {
- out << nl << stream << ".readObject(new Patcher());";
- }
- else
- {
- out << nl << stream << ".readObject(" << patchParams << ");";
- }
- }
- }
+ if(_featureProfile != Slice::IceE)
+ {
+ if(marshal)
+ {
+ out << nl << stream << ".writeObject(" << v << ");";
+ }
+ else
+ {
+ string typeS = typeToString(type, TypeModeIn, package);
+ if(holder)
+ {
+ out << nl << stream << ".readObject(" << param << ".getPatcher());";
+ }
+ else
+ {
+ if(patchParams.empty())
+ {
+ out << nl << stream << ".readObject(new Patcher());";
+ }
+ else
+ {
+ out << nl << stream << ".readObject(" << patchParams << ");";
+ }
+ }
+ }
+ }
return;
}