summaryrefslogtreecommitdiff
path: root/cpp/test/Ice/interceptor/AMDInterceptorI.cpp
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2016-01-08 21:10:14 +0100
committerJose <jose@zeroc.com>2016-01-08 21:10:14 +0100
commit93ab5a8f08970ad49c6f973b965b8fbefb63882f (patch)
tree18c00abdc514ca90a7ab6e1acc5b350847843681 /cpp/test/Ice/interceptor/AMDInterceptorI.cpp
parentC++98 test minor build fix (diff)
downloadice-93ab5a8f08970ad49c6f973b965b8fbefb63882f.tar.bz2
ice-93ab5a8f08970ad49c6f973b965b8fbefb63882f.tar.xz
ice-93ab5a8f08970ad49c6f973b965b8fbefb63882f.zip
C++11 fix Exception::ice_clone to use exception_ptr
Diffstat (limited to 'cpp/test/Ice/interceptor/AMDInterceptorI.cpp')
-rw-r--r--cpp/test/Ice/interceptor/AMDInterceptorI.cpp21
1 files changed, 20 insertions, 1 deletions
diff --git a/cpp/test/Ice/interceptor/AMDInterceptorI.cpp b/cpp/test/Ice/interceptor/AMDInterceptorI.cpp
index fdda272658e..eb4fec01954 100644
--- a/cpp/test/Ice/interceptor/AMDInterceptorI.cpp
+++ b/cpp/test/Ice/interceptor/AMDInterceptorI.cpp
@@ -12,6 +12,8 @@
#include <Test.h>
#include <TestCommon.h>
+using namespace std;
+
AMDInterceptorI::AMDInterceptorI(const Ice::ObjectPtr& servant) :
InterceptorI(servant),
_defaultCb(new DispatchInterceptorAsyncCallbackI(*this)),
@@ -82,7 +84,11 @@ void
AMDInterceptorI::setActualStatus(const IceUtil::Exception& e)
{
IceUtil::Mutex::Lock lock(_mutex);
+#ifdef ICE_CPP11_MAPPING
+ _exception = e.ice_clone();
+#else
_exception.reset(e.ice_clone());
+#endif
_actualStatus = Ice::DispatchAsync;
}
@@ -93,20 +99,33 @@ AMDInterceptorI::getActualStatus() const
return _actualStatus;
}
+#ifdef ICE_CPP11_MAPPING
+exception_ptr
+AMDInterceptorI::getException() const
+{
+ IceUtil::Mutex::Lock lock(_mutex);
+ return _exception;
+}
+#else
IceUtil::Exception*
AMDInterceptorI::getException() const
{
IceUtil::Mutex::Lock lock(_mutex);
return _exception.get();
}
-
+#endif
+
void
AMDInterceptorI::clear()
{
InterceptorI::clear();
IceUtil::Mutex::Lock lock(_mutex);
_actualStatus = Ice::DispatchAsync;
+#ifdef ICE_CPP11_MAPPING
+ _exception = nullptr;
+#else
_exception.reset();
+#endif
}