summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/BatchRequestQueue.h
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2015-03-10 12:12:10 +0100
committerBenoit Foucher <benoit@zeroc.com>2015-03-10 12:12:10 +0100
commitc6ca68d97aa5bbc2a172e3e35171b5452657fa22 (patch)
tree46edcca4c8e313285a205bf6fad7c56c452c0cc0 /cpp/src/Ice/BatchRequestQueue.h
parentMinor JS style fixes (diff)
downloadice-c6ca68d97aa5bbc2a172e3e35171b5452657fa22.tar.bz2
ice-c6ca68d97aa5bbc2a172e3e35171b5452657fa22.tar.xz
ice-c6ca68d97aa5bbc2a172e3e35171b5452657fa22.zip
ICE-6170 - fixed behavior of batch requests
Diffstat (limited to 'cpp/src/Ice/BatchRequestQueue.h')
-rw-r--r--cpp/src/Ice/BatchRequestQueue.h59
1 files changed, 59 insertions, 0 deletions
diff --git a/cpp/src/Ice/BatchRequestQueue.h b/cpp/src/Ice/BatchRequestQueue.h
new file mode 100644
index 00000000000..6a082af1921
--- /dev/null
+++ b/cpp/src/Ice/BatchRequestQueue.h
@@ -0,0 +1,59 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2015 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+#ifndef ICE_BATCH_REQUEST_QUEUE_H
+#define ICE_BATCH_REQUEST_QUEUE_H
+
+#include <IceUtil/Shared.h>
+#include <IceUtil/Mutex.h>
+#include <IceUtil/Monitor.h>
+#include <IceUtil/UniquePtr.h>
+
+#include <Ice/BatchRequestInterceptor.h>
+#include <Ice/BatchRequestQueueF.h>
+#include <Ice/InstanceF.h>
+#include <Ice/BasicStream.h>
+
+namespace IceInternal
+{
+
+class BatchRequestQueue : public IceUtil::Shared, private IceUtil::Monitor<IceUtil::Mutex>
+{
+public:
+
+ BatchRequestQueue(const InstancePtr&, bool);
+
+ void prepareBatchRequest(BasicStream*);
+ void finishBatchRequest(BasicStream*, const Ice::ObjectPrx&, const std::string&);
+ void abortBatchRequest(BasicStream*);
+
+ int swap(BasicStream*);
+
+ void destroy(const Ice::LocalException&);
+ bool isEmpty();
+
+ void enqueueBatchRequest();
+
+private:
+
+ void waitStreamInUse(bool);
+
+ Ice::BatchRequestInterceptorPtr _interceptor;
+ BasicStream _batchStream;
+ bool _batchStreamInUse;
+ bool _batchStreamCanFlush;
+ int _batchRequestNum;
+ size_t _batchMarker;
+ IceUtil::UniquePtr<Ice::LocalException> _exception;
+ size_t _maxSize;
+};
+
+};
+
+#endif