diff options
Diffstat (limited to 'cpp/src/Ice/Proxy.cpp')
-rw-r--r-- | cpp/src/Ice/Proxy.cpp | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/cpp/src/Ice/Proxy.cpp b/cpp/src/Ice/Proxy.cpp index 61577f7351d..6524a4ce9c3 100644 --- a/cpp/src/Ice/Proxy.cpp +++ b/cpp/src/Ice/Proxy.cpp @@ -320,7 +320,6 @@ IceProxy::Ice::Object::ice_invoke_async(const AMI_Object_ice_invokePtr& cb, const vector<Byte>& inParams, const Context& context) { - __checkTwowayOnly("ice_invoke_async"); cb->__invoke(this, operation, mode, inParams, context); } @@ -766,6 +765,12 @@ IceProxy::Ice::Object::__rethrowException(const LocalException& ex) ex.ice_throw(); } +// +// Overloaded for const char* and const string& because, most of time, +// we call this with a const char* and we want to avoid the overhead +// of constructing a string. +// + void IceProxy::Ice::Object::__checkTwowayOnly(const char* name) const { @@ -782,6 +787,22 @@ IceProxy::Ice::Object::__checkTwowayOnly(const char* name) const } } +void +IceProxy::Ice::Object::__checkTwowayOnly(const string& name) const +{ + // + // No mutex lock necessary, there is nothing mutable in this + // operation. + // + + if(!ice_isTwoway()) + { + TwowayOnlyException ex(__FILE__, __LINE__); + ex.operation = name; + throw ex; + } +} + ostream& operator<<(ostream& os, const ::IceProxy::Ice::Object& p) { |