diff options
author | Bernard Normier <bernard@zeroc.com> | 2014-07-24 16:06:51 +0000 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2014-07-24 16:06:51 +0000 |
commit | ac23953bb2f5ab0bac337f15d4d8739e7aa1ce5c (patch) | |
tree | 3af419df5b8c46c809d579fdcd7165135f452d8f /cpp/src/Ice/CommunicatorI.cpp | |
parent | VS 2010 build fix (diff) | |
download | ice-ac23953bb2f5ab0bac337f15d4d8739e7aa1ce5c.tar.bz2 ice-ac23953bb2f5ab0bac337f15d4d8739e7aa1ce5c.tar.xz ice-ac23953bb2f5ab0bac337f15d4d8739e7aa1ce5c.zip |
Completed fix for ICE-5567: move various C++11 classes/functions out of line
Diffstat (limited to 'cpp/src/Ice/CommunicatorI.cpp')
-rw-r--r-- | cpp/src/Ice/CommunicatorI.cpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/cpp/src/Ice/CommunicatorI.cpp b/cpp/src/Ice/CommunicatorI.cpp index 2af374c1fb5..8bc80d47363 100644 --- a/cpp/src/Ice/CommunicatorI.cpp +++ b/cpp/src/Ice/CommunicatorI.cpp @@ -222,6 +222,45 @@ Ice::CommunicatorI::begin_flushBatchRequests(const Callback_Communicator_flushBa return __begin_flushBatchRequests(cb, cookie); } +#ifdef ICE_CPP11 +AsyncResultPtr +Ice::CommunicatorI::begin_flushBatchRequests( + const IceInternal::Function<void (const Exception&)>& exception, + const IceInternal::Function<void (bool)>& sent) +{ + class Cpp11CB : public IceInternal::Cpp11FnCallbackNC + { + + public: + + Cpp11CB(const IceInternal::Function<void (const Exception&)>& excb, + const IceInternal::Function<void (bool)>& sentcb) : + IceInternal::Cpp11FnCallbackNC(excb, sentcb) + { + CallbackBase::checkCallback(true, excb != nullptr); + } + + virtual void + __completed(const AsyncResultPtr& __result) const + { + CommunicatorPtr __com = __result->getCommunicator(); + assert(__com); + try + { + __com->end_flushBatchRequests(__result); + assert(false); + } + catch(const Exception& ex) + { + IceInternal::Cpp11FnCallbackNC::__exception(__result, ex); + } + } + }; + + return __begin_flushBatchRequests(new Cpp11CB(exception, sent), 0); +} +#endif + namespace { |