summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/client/SessionBase.cpp
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2008-04-20 12:10:37 +0000
committerGordon Sim <gsim@apache.org>2008-04-20 12:10:37 +0000
commit0637677cf6653256b67c82dcb74f35133601220c (patch)
tree8507bb8373e8b6dfd8c9b96fcb4b262fd4d61501 /cpp/src/qpid/client/SessionBase.cpp
parent48dab065ef526f68a5a7d4c4ba22c5b8b2e2e026 (diff)
downloadqpid-python-0637677cf6653256b67c82dcb74f35133601220c.tar.gz
QPID-920: converted c++ client to use final 0-10 protocol
* connection handler converted to using invoker & proxy and updated to final method defs * SessionCore & ExecutionHandler replace by SessionImpl * simplified handling of completion & results, removed handling of responses git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@649915 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/client/SessionBase.cpp')
-rw-r--r--cpp/src/qpid/client/SessionBase.cpp29
1 files changed, 23 insertions, 6 deletions
diff --git a/cpp/src/qpid/client/SessionBase.cpp b/cpp/src/qpid/client/SessionBase.cpp
index 0e1fa67bda..d6a7571e9f 100644
--- a/cpp/src/qpid/client/SessionBase.cpp
+++ b/cpp/src/qpid/client/SessionBase.cpp
@@ -19,6 +19,7 @@
*
*/
#include "SessionBase.h"
+#include "qpid/framing/all_method_bodies.h"
namespace qpid {
namespace client {
@@ -26,7 +27,7 @@ using namespace framing;
SessionBase::SessionBase() {}
SessionBase::~SessionBase() {}
-SessionBase::SessionBase(shared_ptr<SessionCore> core) : impl(core) {}
+SessionBase::SessionBase(shared_ptr<SessionImpl> core) : impl(core) {}
void SessionBase::suspend() { impl->suspend(); }
void SessionBase::close() { impl->close(); }
@@ -37,14 +38,30 @@ SynchronousMode SessionBase::getSynchronous() const {
return SynchronousMode(impl->isSync());
}
-Execution& SessionBase::getExecution() { return impl->getExecution(); }
+Execution& SessionBase::getExecution()
+{
+ return *impl;
+}
+
+void SessionBase::sync()
+{
+ ExecutionSyncBody b;
+ b.setSync(true);
+ impl->send(b).wait(*impl);
+}
+
Uuid SessionBase::getId() const { return impl->getId(); }
framing::FrameSet::shared_ptr SessionBase::get() { return impl->get(); }
-void SessionBase::sync() {
- Execution& ex = getExecution();
- ex.syncWait(ex.lastSent());
- impl->assertOpen();
+SessionBase::ScopedSync::ScopedSync(SessionBase& s) : session(s), change(!s.isSynchronous())
+{
+ if (change) session.setSynchronous(true);
}
+SessionBase::ScopedSync::~ScopedSync()
+{
+ if (change) session.setSynchronous(false);
+}
+
+
}} // namespace qpid::client