You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ac...@apache.org on 2013/10/30 18:21:31 UTC
svn commit: r1537187 - in /qpid/trunk/qpid/cpp/src/qpid:
broker/AsyncCompletion.h broker/SemanticState.cpp broker/SessionState.cpp
broker/SessionState.h ha/PrimaryTxObserver.cpp
Author: aconway
Date: Wed Oct 30 17:21:31 2013
New Revision: 1537187
URL: http://svn.apache.org/r1537187
Log:
QPID-5139: HA correct compile error on older C++ compilers.
- Added constructors for AsyncCompletion::Callback so subclasses can be copied.
- Get rid of intrusive_ptr::reset
Modified:
qpid/trunk/qpid/cpp/src/qpid/broker/AsyncCompletion.h
qpid/trunk/qpid/cpp/src/qpid/broker/SemanticState.cpp
qpid/trunk/qpid/cpp/src/qpid/broker/SessionState.cpp
qpid/trunk/qpid/cpp/src/qpid/broker/SessionState.h
qpid/trunk/qpid/cpp/src/qpid/ha/PrimaryTxObserver.cpp
Modified: qpid/trunk/qpid/cpp/src/qpid/broker/AsyncCompletion.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/AsyncCompletion.h?rev=1537187&r1=1537186&r2=1537187&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/AsyncCompletion.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/AsyncCompletion.h Wed Oct 30 17:21:31 2013
@@ -91,7 +91,13 @@ class AsyncCompletion : public virtual R
*/
class Callback : public RefCounted
{
- public:
+ public:
+ // Normally RefCounted objects cannot be copied.
+ // Allow Callback objects to be copied (by subclasses implementing clone())
+ // The copy has an initial refcount of 0
+ Callback(const Callback&) : RefCounted() {}
+ Callback() {}
+
virtual void completed(bool) = 0;
virtual boost::intrusive_ptr<Callback> clone() = 0;
};
Modified: qpid/trunk/qpid/cpp/src/qpid/broker/SemanticState.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/SemanticState.cpp?rev=1537187&r1=1537186&r2=1537187&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/SemanticState.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/SemanticState.cpp Wed Oct 30 17:21:31 2013
@@ -221,7 +221,7 @@ void SemanticState::startDtx(const std::
if (!dtxSelected) {
throw CommandInvalidException(QPID_MSG("Session has not been selected for use with dtx"));
}
- dtxBuffer.reset(new DtxBuffer(xid));
+ dtxBuffer = new DtxBuffer(xid);
txBuffer = dtxBuffer;
session.getBroker().getBrokerObservers().startDtx(dtxBuffer);
if (join) {
@@ -242,7 +242,7 @@ void SemanticState::endDtx(const std::st
}
- txBuffer.reset();//ops on this session no longer transactional
+ txBuffer = 0;//ops on this session no longer transactional
checkDtxTimeout();
if (fail) {
@@ -250,7 +250,7 @@ void SemanticState::endDtx(const std::st
} else {
dtxBuffer->markEnded();
}
- dtxBuffer.reset();
+ dtxBuffer = 0;
}
void SemanticState::suspendDtx(const std::string& xid)
@@ -259,12 +259,12 @@ void SemanticState::suspendDtx(const std
throw CommandInvalidException(
QPID_MSG("xid specified on start was " << dtxBuffer->getXid() << ", but " << xid << " specified on suspend"));
}
- txBuffer.reset();//ops on this session no longer transactional
+ txBuffer = 0;//ops on this session no longer transactional
checkDtxTimeout();
dtxBuffer->setSuspended(true);
suspendedXids[xid] = dtxBuffer;
- dtxBuffer.reset();
+ dtxBuffer = 0;
}
void SemanticState::resumeDtx(const std::string& xid)
@@ -297,7 +297,7 @@ void SemanticState::resumeDtx(const std:
void SemanticState::checkDtxTimeout()
{
if (dtxBuffer->isExpired()) {
- dtxBuffer.reset();
+ dtxBuffer = 0;
throw DtxTimeoutException();
}
}
Modified: qpid/trunk/qpid/cpp/src/qpid/broker/SessionState.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/SessionState.cpp?rev=1537187&r1=1537186&r2=1537187&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/SessionState.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/SessionState.cpp Wed Oct 30 17:21:31 2013
@@ -398,7 +398,7 @@ void SessionState::IncompleteIngressMsgX
session->completeCommand(id, requiresAccept, requiresSync);
}
}
- completerContext.reset();
+ completerContext = 0;
}
Modified: qpid/trunk/qpid/cpp/src/qpid/broker/SessionState.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/SessionState.h?rev=1537187&r1=1537186&r2=1537187&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/SessionState.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/SessionState.h Wed Oct 30 17:21:31 2013
@@ -259,10 +259,6 @@ class SessionState : public qpid::Sessio
completerContext(ss.getAsyncCommandCompleter())
{}
- AsyncCommandContext(const AsyncCommandContext& x) :
- id(x.id), requiresSync(x.requiresSync), completerContext(x.completerContext)
- {}
-
virtual ~AsyncCommandContext() {}
protected:
Modified: qpid/trunk/qpid/cpp/src/qpid/ha/PrimaryTxObserver.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/ha/PrimaryTxObserver.cpp?rev=1537187&r1=1537186&r2=1537187&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/ha/PrimaryTxObserver.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/ha/PrimaryTxObserver.cpp Wed Oct 30 17:21:31 2013
@@ -200,7 +200,7 @@ void PrimaryTxObserver::end(sys::Mutex::
// Don't destroy the tx-queue until the transaction is complete and there
// are no connected subscriptions.
if (txBuffer && complete && unfinished.empty()) {
- txBuffer.reset(); // Break pointer cycle.
+ txBuffer = 0; // Break pointer cycle.
try {
haBroker.getBroker().deleteQueue(txQueue->getName(), haBroker.getUserId(), string());
} catch (const std::exception& e) {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org