diff options
author | Jose <jose@zeroc.com> | 2016-01-11 17:21:46 +0100 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2016-01-11 17:21:46 +0100 |
commit | 6fece3700ac31712b6d8892108a17e01cb2614be (patch) | |
tree | 9cdcfed91e78c9bd226881ee594f58a09fba38a6 /cpp/src/Ice/AsyncResult.cpp | |
parent | Fix Ice/location test failures with C++11 (diff) | |
download | ice-6fece3700ac31712b6d8892108a17e01cb2614be.tar.bz2 ice-6fece3700ac31712b6d8892108a17e01cb2614be.tar.xz ice-6fece3700ac31712b6d8892108a17e01cb2614be.zip |
Add ICE_RESET_EXCEPTION macro to simplify C++ builds
Diffstat (limited to 'cpp/src/Ice/AsyncResult.cpp')
-rw-r--r-- | cpp/src/Ice/AsyncResult.cpp | 43 |
1 files changed, 9 insertions, 34 deletions
diff --git a/cpp/src/Ice/AsyncResult.cpp b/cpp/src/Ice/AsyncResult.cpp index 5848747810e..7387366cbed 100644 --- a/cpp/src/Ice/AsyncResult.cpp +++ b/cpp/src/Ice/AsyncResult.cpp @@ -50,7 +50,7 @@ AsyncResult::getCommunicator() const ConnectionPtr AsyncResult::getConnection() const { - return 0; + return ICE_NULLPTR; } ObjectPrxPtr @@ -299,11 +299,7 @@ AsyncResult::finished(const Ice::Exception& ex) { IceUtil::Monitor<IceUtil::Mutex>::Lock sync(_monitor); _state |= Done; -#ifdef ICE_CPP11_MAPPING - _exception = ex.ice_clone(); -#else - _exception.reset(ex.ice_clone()); -#endif + ICE_RESET_EXCEPTION(_exception, ex.ice_clone()); _cancellationHandler = 0; _observer.failed(ex.ice_name()); if(!_callback) @@ -438,55 +434,34 @@ AsyncResult::cancel(const Ice::LocalException& ex) CancellationHandlerPtr handler; { IceUtil::Monitor<IceUtil::Mutex>::Lock sync(_monitor); -#ifdef ICE_CPP11_MAPPING - _cancellationException = ex.ice_clone(); -#else - _cancellationException.reset(ex.ice_clone()); -#endif + ICE_RESET_EXCEPTION(_cancellationException, ex.ice_clone()); if(!_cancellationHandler) { return; } handler = _cancellationHandler; } -#ifdef ICE_CPP11_MAPPING - handler->asyncRequestCanceled(dynamic_pointer_cast<OutgoingAsyncBase>(shared_from_this()), ex); -#else - handler->asyncRequestCanceled(OutgoingAsyncBasePtr::dynamicCast(this), ex); -#endif + handler->asyncRequestCanceled(ICE_DYNAMIC_CAST(OutgoingAsyncBase, shared_from_this()), ex); } void AsyncResult::cancelable(const CancellationHandlerPtr& handler) { IceUtil::Monitor<IceUtil::Mutex>::Lock sync(_monitor); -#ifdef ICE_CPP11_MAPPING - if(_cancellationException) - { - try - { - rethrow_exception(_cancellationException); - } - catch(const Ice::Exception&) - { - _cancellationException = nullptr; - throw; - } - } -#else - if(_cancellationException.get()) + + + if(ICE_EXCEPTION_GET(_cancellationException)) { try { - _cancellationException->ice_throw(); + ICE_RETHROW_EXCEPTION(_cancellationException); } catch(const Ice::Exception&) { - _cancellationException.reset(0); + ICE_RESET_EXCEPTION(_cancellationException, ICE_NULLPTR); throw; } } -#endif _cancellationHandler = handler; } |