From 1d5c04bb8c0e786a717e36467e17f34bcc4f1d95 Mon Sep 17 00:00:00 2001 From: Jose Date: Fri, 10 Aug 2012 23:53:37 +0200 Subject: C++11 ami lambda support --- cpp/include/Ice/ConnectionAsync.h | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) (limited to 'cpp/include/Ice/ConnectionAsync.h') diff --git a/cpp/include/Ice/ConnectionAsync.h b/cpp/include/Ice/ConnectionAsync.h index 5d850e577f4..4a27138aa53 100644 --- a/cpp/include/Ice/ConnectionAsync.h +++ b/cpp/include/Ice/ConnectionAsync.h @@ -42,11 +42,40 @@ public: catch(::Ice::Exception& ex) { ::IceInternal::CallbackNC::__exception(__result, ex); - return; } } }; +#ifdef ICE_CPP11 +class Cpp11FnCallbackNC_Connection_flushBatchRequests : virtual public ::IceInternal::Cpp11FnCallbackNC +{ +public: + + Cpp11FnCallbackNC_Connection_flushBatchRequests(const ::IceInternal::Function& excb, + const ::IceInternal::Function& sentcb) : + ::IceInternal::Cpp11FnCallbackNC(excb, sentcb) + { + CallbackBase::checkCallback(true, excb != nullptr); + } + + virtual void + __completed(const ::Ice::AsyncResultPtr& __result) const + { + ::Ice::ConnectionPtr __con = __result->getConnection(); + assert(__con); + try + { + __con->end_flushBatchRequests(__result); + assert(false); + } + catch(::Ice::Exception& ex) + { + ::IceInternal::Cpp11FnCallbackNC::__exception(__result, ex); + } + } +}; +#endif + template Callback_Connection_flushBatchRequestsPtr newCallback_Connection_flushBatchRequests(const IceUtil::Handle& instance, void (T::*excb)(const ::Ice::Exception&), @@ -90,7 +119,6 @@ public: catch(::Ice::Exception& ex) { ::IceInternal::Callback::__exception(__result, ex); - return; } } }; -- cgit v1.2.3