summaryrefslogtreecommitdiff
path: root/cpp/src/slice2cpp/Gen.cpp
diff options
context:
space:
mode:
authorMichi Henning <michi@zeroc.com>2002-09-04 05:39:57 +0000
committerMichi Henning <michi@zeroc.com>2002-09-04 05:39:57 +0000
commita5da64185ba234ae8dfdec11764e1821bbc67a57 (patch)
tree4aa60640dbb0b01960e8aa644ef9179594e28b6d /cpp/src/slice2cpp/Gen.cpp
parentfix (diff)
downloadice-a5da64185ba234ae8dfdec11764e1821bbc67a57.tar.bz2
ice-a5da64185ba234ae8dfdec11764e1821bbc67a57.tar.xz
ice-a5da64185ba234ae8dfdec11764e1821bbc67a57.zip
Changed Current.ice to use enum OperationMode to distinguish between
Normal, Nonmutating, and Idempotent operations. Fixed bug introduced into Freeze with previous changes for saving object state. (State wasn't saved for idempotent operations.) Retested everything. I'm getting a failure in the Yellow (C++) tests, and another failure in the IceBox (Java) tests, but I don't think these are related to these changes.
Diffstat (limited to 'cpp/src/slice2cpp/Gen.cpp')
-rw-r--r--cpp/src/slice2cpp/Gen.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp
index ec98cd7ef34..2aff386f41b 100644
--- a/cpp/src/slice2cpp/Gen.cpp
+++ b/cpp/src/slice2cpp/Gen.cpp
@@ -1276,7 +1276,7 @@ Slice::Gen::ProxyVisitor::visitOperation(const OperationPtr& p)
C << eb;
C << nl << "catch(const ::IceInternal::NonRepeatable& __ex)";
C << sb;
- if(p->idempotent())
+ if(p->mode() == Operation::Idempotent || p->mode() == Operation::Nonmutating)
{
C << nl << "__handleException(*__ex.get(), __cnt);";
}
@@ -1547,7 +1547,7 @@ Slice::Gen::DelegateMVisitor::visitOperation(const OperationPtr& p)
C << sb;
C << nl << "static const ::std::string __operation(\"" << p->name() << "\");";
C << nl << "::IceInternal::Outgoing __out(__connection, __reference, __operation, "
- << (p->idempotent() ? "true" : "false") << ", __context);";
+ << "static_cast< ::Ice::OperationMode>(" << p->mode() << "), __context);";
if(ret || !outParams.empty() || !throws.empty())
{
C << nl << "::IceInternal::BasicStream* __is = __out.is();";
@@ -1732,8 +1732,8 @@ Slice::Gen::DelegateDVisitor::visitOperation(const OperationPtr& p)
C << sp << nl << retS << nl << "IceDelegateD" << scoped << paramsDecl;
C << sb;
C << nl << "::Ice::Current __current;";
- C << nl << "__initCurrent(__current, \"" << p->name() << "\", " << (p->idempotent() ? "true" : "false")
- << ", __context);";
+ C << nl << "__initCurrent(__current, \"" << p->name()
+ << "\", static_cast< ::Ice::OperationMode>(" << p->mode() << "), __context);";
C << nl << "while(true)";
C << sb;
C << nl << "::IceInternal::Direct __direct(__adapter, __current);";
@@ -2280,7 +2280,7 @@ Slice::Gen::ObjectVisitor::visitOperation(const OperationPtr& p)
}
}
- bool nonmutating = p->nonmutating();
+ bool nonmutating = p->mode() == Operation::Nonmutating;
H << sp;
H << nl << exp2 << "virtual " << retS << ' ' << name << params << (nonmutating ? " const" : "") << " = 0;";
@@ -2832,7 +2832,7 @@ Slice::Gen::ImplVisitor::visitClassDefStart(const ClassDefPtr& p)
}
H.restoreIndent();
- bool nonmutating = op->nonmutating();
+ bool nonmutating = op->mode() == Operation::Nonmutating;
H << ")" << (nonmutating ? " const" : "") << ";";