diff options
author | Jose <jose@zeroc.com> | 2012-08-10 23:53:37 +0200 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2012-08-10 23:53:37 +0200 |
commit | 1d5c04bb8c0e786a717e36467e17f34bcc4f1d95 (patch) | |
tree | c1c91f034589260e97033131061d536ecfc2b9cb /cpp/include/Ice/CommunicatorAsync.h | |
parent | ICE-4702 - Poor hash algorithm (diff) | |
download | ice-1d5c04bb8c0e786a717e36467e17f34bcc4f1d95.tar.bz2 ice-1d5c04bb8c0e786a717e36467e17f34bcc4f1d95.tar.xz ice-1d5c04bb8c0e786a717e36467e17f34bcc4f1d95.zip |
C++11 ami lambda support
Diffstat (limited to 'cpp/include/Ice/CommunicatorAsync.h')
-rw-r--r-- | cpp/include/Ice/CommunicatorAsync.h | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/cpp/include/Ice/CommunicatorAsync.h b/cpp/include/Ice/CommunicatorAsync.h index 26915051f8d..cb7dfeb288c 100644 --- a/cpp/include/Ice/CommunicatorAsync.h +++ b/cpp/include/Ice/CommunicatorAsync.h @@ -42,11 +42,41 @@ public: catch(::Ice::Exception& ex) { ::IceInternal::CallbackNC<T>::__exception(__result, ex); - return; } } }; +#ifdef ICE_CPP11 +class Cpp11FnCallbackNC_Communicator_flushBatchRequests : virtual public ::IceInternal::Cpp11FnCallbackNC +{ +public: + + Cpp11FnCallbackNC_Communicator_flushBatchRequests( + const ::IceInternal::Function<void (const ::Ice::Exception&)>& excb, + const ::IceInternal::Function<void (bool)>& sentcb) : + ::IceInternal::Cpp11FnCallbackNC(excb, sentcb) + { + CallbackBase::checkCallback(true, excb != nullptr); + } + + virtual void + __completed(const ::Ice::AsyncResultPtr& __result) const + { + ::Ice::CommunicatorPtr __com = __result->getCommunicator(); + assert(__com); + try + { + __com->end_flushBatchRequests(__result); + assert(false); + } + catch(::Ice::Exception& ex) + { + ::IceInternal::Cpp11FnCallbackNC::__exception(__result, ex); + } + } +}; +#endif + template<class T> Callback_Communicator_flushBatchRequestsPtr newCallback_Communicator_flushBatchRequests(const IceUtil::Handle<T>& instance, void (T::*excb)(const ::Ice::Exception&), @@ -90,7 +120,6 @@ public: catch(::Ice::Exception& ex) { ::IceInternal::Callback<T, CT>::__exception(__result, ex); - return; } } }; |