diff options
author | Benoit Foucher <benoit@zeroc.com> | 2015-03-10 12:12:10 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2015-03-10 12:12:10 +0100 |
commit | c6ca68d97aa5bbc2a172e3e35171b5452657fa22 (patch) | |
tree | 46edcca4c8e313285a205bf6fad7c56c452c0cc0 /cpp/src/Ice/Initialize.cpp | |
parent | Minor JS style fixes (diff) | |
download | ice-c6ca68d97aa5bbc2a172e3e35171b5452657fa22.tar.bz2 ice-c6ca68d97aa5bbc2a172e3e35171b5452657fa22.tar.xz ice-c6ca68d97aa5bbc2a172e3e35171b5452657fa22.zip |
ICE-6170 - fixed behavior of batch requests
Diffstat (limited to 'cpp/src/Ice/Initialize.cpp')
-rw-r--r-- | cpp/src/Ice/Initialize.cpp | 36 |
1 files changed, 31 insertions, 5 deletions
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<void (const DispatcherCallPtr&, const C class Cpp11Dispatcher : public Dispatcher { public: - + Cpp11Dispatcher(const ::std::function<void (const DispatcherCallPtr&, const ConnectionPtr)>& cb) : _cb(cb) { } - + virtual void dispatch(const DispatcherCallPtr& call, const ConnectionPtr& conn) { _cb(call, conn); } - + private: const ::std::function<void (const DispatcherCallPtr&, const ConnectionPtr)> _cb; }; @@ -399,3 +399,29 @@ Ice::newDispatcher(const ::std::function<void (const DispatcherCallPtr&, const C return new Cpp11Dispatcher(cb); } #endif + +#ifdef ICE_CPP11 +Ice::BatchRequestInterceptorPtr +Ice::newBatchRequestInterceptor(const ::std::function<void (const BatchRequest&, int, int)>& cb) +{ + class Cpp11BatchRequestInterceptor : public BatchRequestInterceptor + { + public: + + Cpp11BatchRequestInterceptor(const ::std::function<void (const BatchRequest&, int, int)>& cb) : + _cb(cb) + { + } + + virtual void enqueue(const BatchRequest& request, int count, int size) + { + _cb(request, count, size); + } + + private: + const ::std::function<void (const BatchRequest&, int, int)> _cb; + }; + + return new Cpp11BatchRequestInterceptor(cb); +} +#endif |