From c6ca68d97aa5bbc2a172e3e35171b5452657fa22 Mon Sep 17 00:00:00 2001 From: Benoit Foucher Date: Tue, 10 Mar 2015 12:12:10 +0100 Subject: ICE-6170 - fixed behavior of batch requests --- cpp/src/Ice/Initialize.cpp | 36 +++++++++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) (limited to 'cpp/src/Ice/Initialize.cpp') diff --git a/cpp/src/Ice/Initialize.cpp b/cpp/src/Ice/Initialize.cpp index e17e405bf7b..0e286f99c0c 100644 --- a/cpp/src/Ice/Initialize.cpp +++ b/cpp/src/Ice/Initialize.cpp @@ -194,8 +194,8 @@ inline void checkIceVersion(Int version) { throw VersionMismatchException(__FILE__, __LINE__); } - -# endif + +# endif #endif } @@ -381,17 +381,17 @@ Ice::newDispatcher(const ::std::function& cb) : _cb(cb) { } - + virtual void dispatch(const DispatcherCallPtr& call, const ConnectionPtr& conn) { _cb(call, conn); } - + private: const ::std::function _cb; }; @@ -399,3 +399,29 @@ Ice::newDispatcher(const ::std::function& cb) +{ + class Cpp11BatchRequestInterceptor : public BatchRequestInterceptor + { + public: + + Cpp11BatchRequestInterceptor(const ::std::function& cb) : + _cb(cb) + { + } + + virtual void enqueue(const BatchRequest& request, int count, int size) + { + _cb(request, count, size); + } + + private: + const ::std::function _cb; + }; + + return new Cpp11BatchRequestInterceptor(cb); +} +#endif -- cgit v1.2.3