diff options
Diffstat (limited to 'cppe/src')
-rw-r--r-- | cppe/src/IceE/Object.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/cppe/src/IceE/Object.cpp b/cppe/src/IceE/Object.cpp index 0f0b93dc16e..7346597ffd4 100644 --- a/cppe/src/IceE/Object.cpp +++ b/cppe/src/IceE/Object.cpp @@ -10,6 +10,7 @@ #include <IceE/Object.h> #include <IceE/Incoming.h> #include <IceE/LocalException.h> +#include <IceE/SafeStdio.h> using namespace std; using namespace Ice; @@ -163,6 +164,36 @@ Ice::Object::__dispatch(Incoming& in, const Current& current) return DispatchOperationNotExist; } +static const char* +operationModeToString(OperationMode mode) +{ + switch(mode) + { + case Normal: + return "::Ice::Normal"; + + case Nonmutating: + return "::Ice::Nonmutating"; + + case Idempotent: + return "::Ice::Idempotent"; + } + + return "???"; +} + +void +Ice::Object::__checkMode(OperationMode expected, OperationMode received) +{ + if(expected != received) + { + Ice::MarshalException ex(__FILE__, __LINE__); + ex.reason = Ice::printfToString("unexpected operation mode. expected = %s received = %s", + operationModeToString(expected), operationModeToString(received)); + throw ex; + } +} + DispatchStatus Ice::Blobject::__dispatch(Incoming& in, const Current& current) { |