diff options
author | Benoit Foucher <benoit@zeroc.com> | 2017-02-06 11:17:34 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2017-02-06 11:17:34 +0100 |
commit | 18ab8207bd14def950fd399c60d9ee54fab75d3b (patch) | |
tree | a82af333127184acc6be6e0969919cb20be5e8b3 /cpp/src/Ice/CommunicatorI.h | |
parent | Fixed ICE-7548 - getAdminProxy no longer returns 0 if synchronization is in p... (diff) | |
download | ice-18ab8207bd14def950fd399c60d9ee54fab75d3b.tar.bz2 ice-18ab8207bd14def950fd399c60d9ee54fab75d3b.tar.xz ice-18ab8207bd14def950fd399c60d9ee54fab75d3b.zip |
Fixed ICE-7169 and ICE-7375 - add option to specify if batch requests flushed with the communicator/connection should be compressed
Diffstat (limited to 'cpp/src/Ice/CommunicatorI.h')
-rw-r--r-- | cpp/src/Ice/CommunicatorI.h | 51 |
1 files changed, 45 insertions, 6 deletions
diff --git a/cpp/src/Ice/CommunicatorI.h b/cpp/src/Ice/CommunicatorI.h index c1ef6279068..5c9035261f8 100644 --- a/cpp/src/Ice/CommunicatorI.h +++ b/cpp/src/Ice/CommunicatorI.h @@ -16,6 +16,41 @@ #include <Ice/Initialize.h> #include <Ice/Communicator.h> #include <Ice/CommunicatorAsync.h> +#include <Ice/OutgoingAsync.h> + +namespace IceInternal +{ + +// +// Class for handling Ice::Communicator::begin_flushBatchRequests +// +class CommunicatorFlushBatchAsync : public OutgoingAsyncBase +{ +public: + + virtual ~CommunicatorFlushBatchAsync(); + + CommunicatorFlushBatchAsync(const InstancePtr&); + + void flushConnection(const Ice::ConnectionIPtr&, Ice::CompressBatch); + void invoke(const std::string&, Ice::CompressBatch); + +#ifdef ICE_CPP11_MAPPING + std::shared_ptr<CommunicatorFlushBatchAsync> shared_from_this() + { + return std::static_pointer_cast<CommunicatorFlushBatchAsync>(OutgoingAsyncBase::shared_from_this()); + } +#endif + +private: + + void check(bool); + + int _useCount; + InvocationObserver _observer; +}; + +} namespace Ice { @@ -68,16 +103,18 @@ public: virtual ValueFactoryManagerPtr getValueFactoryManager() const; - virtual void flushBatchRequests(); + virtual void flushBatchRequests(CompressBatch); #ifdef ICE_CPP11_MAPPING virtual ::std::function<void()> - flushBatchRequestsAsync(::std::function<void(::std::exception_ptr)>, + flushBatchRequestsAsync(CompressBatch, + ::std::function<void(::std::exception_ptr)>, ::std::function<void(bool)> = nullptr); #else - virtual AsyncResultPtr begin_flushBatchRequests(); - virtual AsyncResultPtr begin_flushBatchRequests(const CallbackPtr&, const LocalObjectPtr& = 0); - virtual AsyncResultPtr begin_flushBatchRequests(const Callback_Communicator_flushBatchRequestsPtr&, + virtual AsyncResultPtr begin_flushBatchRequests(CompressBatch); + virtual AsyncResultPtr begin_flushBatchRequests(CompressBatch, const CallbackPtr&, const LocalObjectPtr& = 0); + virtual AsyncResultPtr begin_flushBatchRequests(CompressBatch, + const Callback_Communicator_flushBatchRequestsPtr&, const LocalObjectPtr& = 0); virtual void end_flushBatchRequests(const AsyncResultPtr&); @@ -113,7 +150,9 @@ private: friend ICE_API ::IceUtil::TimerPtr IceInternal::getInstanceTimer(const ::Ice::CommunicatorPtr&); #ifndef ICE_CPP11_MAPPING - AsyncResultPtr _iceI_begin_flushBatchRequests(const IceInternal::CallbackBasePtr&, const LocalObjectPtr&); + AsyncResultPtr _iceI_begin_flushBatchRequests(CompressBatch, + const IceInternal::CallbackBasePtr&, + const LocalObjectPtr&); #endif const ::IceInternal::InstancePtr _instance; |