summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/client/Future.h
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2007-09-28 15:06:12 +0000
committerGordon Sim <gsim@apache.org>2007-09-28 15:06:12 +0000
commitb46c7467a0422e16f63f6b7d7fabb8d1ca9a2cff (patch)
treeed896b93d4ebd1c7357fee7569c37564d913f999 /cpp/src/qpid/client/Future.h
parent816b56837d862980e9086fe8ed02b84ca764eb1f (diff)
downloadqpid-python-b46c7467a0422e16f63f6b7d7fabb8d1ca9a2cff.tar.gz
Minor refactoring of execution layer
Set sync bit when session is in sync mode git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@580380 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/client/Future.h')
-rw-r--r--cpp/src/qpid/client/Future.h19
1 files changed, 15 insertions, 4 deletions
diff --git a/cpp/src/qpid/client/Future.h b/cpp/src/qpid/client/Future.h
index c2f3b426da..667a19e942 100644
--- a/cpp/src/qpid/client/Future.h
+++ b/cpp/src/qpid/client/Future.h
@@ -48,9 +48,16 @@ public:
void sync(SessionCore& session)
{
- if (!complete) {
+ if (!isComplete(session)) {
+ session.getExecution().syncTo(command);
+ wait(session);
+ }
+ }
+
+ void wait(SessionCore& session)
+ {
+ if (!isComplete(session)) {
FutureCompletion callback;
- session.getExecution().flushTo(command);
session.getExecution().getCompletionTracker().listenForCompletion(
command,
boost::bind(&FutureCompletion::completed, &callback)
@@ -83,8 +90,12 @@ public:
}
}
- bool isComplete() {
- return complete;
+ bool isComplete(SessionCore& session) {
+ return complete || session.getExecution().isComplete(command);
+ }
+
+ bool isCompleteUpTo(SessionCore& session) {
+ return complete || session.getExecution().isCompleteUpTo(command);
}
void setCommandId(const framing::SequenceNumber& id) { command = id; }