summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/Object.cpp
diff options
context:
space:
mode:
authorMatthew Newhook <matthew@zeroc.com>2005-09-07 07:17:14 +0000
committerMatthew Newhook <matthew@zeroc.com>2005-09-07 07:17:14 +0000
commit1b601b793ee92ef2d6aa573c5c1345f56856a5f1 (patch)
treebdd9dbae09ddc1b5ae1e54d9d1923d46b5d25438 /cpp/src/Ice/Object.cpp
parentBug 355. (diff)
downloadice-1b601b793ee92ef2d6aa573c5c1345f56856a5f1.tar.bz2
ice-1b601b793ee92ef2d6aa573c5c1345f56856a5f1.tar.xz
ice-1b601b793ee92ef2d6aa573c5c1345f56856a5f1.zip
http://bugzilla.zeroc.com/bugzilla/show_bug.cgi?id=353
Diffstat (limited to 'cpp/src/Ice/Object.cpp')
-rw-r--r--cpp/src/Ice/Object.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/cpp/src/Ice/Object.cpp b/cpp/src/Ice/Object.cpp
index 83a4aa7251d..dc1c2626ac9 100644
--- a/cpp/src/Ice/Object.cpp
+++ b/cpp/src/Ice/Object.cpp
@@ -242,6 +242,42 @@ Ice::__patch__ObjectPtr(void* __addr, ObjectPtr& v)
*p = v;
}
+static string
+operationModeToString(OperationMode mode)
+{
+ switch(mode)
+ {
+ case Normal:
+ return "::Ice::Normal";
+
+ case Nonmutating:
+ return "::Ice::Nonmutating";
+
+ case Idempotent:
+ return "::Ice::Idempotent";
+ }
+
+ ostringstream os;
+ os << "unknown value (" << mode << ")";
+ return os.str();
+}
+
+void
+Ice::Object::__checkMode(OperationMode expected, OperationMode received) const
+{
+ if(expected != received)
+ {
+ Ice::MarshalException ex(__FILE__, __LINE__);
+ std::ostringstream __reason;
+ __reason << "unexpected operation mode. expected = "
+ << operationModeToString(expected)
+ << " received = "
+ << operationModeToString(received);
+ ex.reason = __reason.str();
+ throw ex;
+ }
+}
+
DispatchStatus
Ice::Blobject::__dispatch(Incoming& in, const Current& current)
{