From d6901e52ab3ee9c40eddc4ad3b4787127c36d874 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Thu, 9 Oct 2008 19:36:51 +0000 Subject: Client-side support for amq.faiover exchange. Connection::getKnownBrokers provides latest list. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@703237 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/client/SessionImpl.h | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'cpp/src/qpid/client/SessionImpl.h') diff --git a/cpp/src/qpid/client/SessionImpl.h b/cpp/src/qpid/client/SessionImpl.h index 49a65ed568..54ace77254 100644 --- a/cpp/src/qpid/client/SessionImpl.h +++ b/cpp/src/qpid/client/SessionImpl.h @@ -28,7 +28,8 @@ #include "qpid/SessionId.h" #include "qpid/SessionState.h" -#include "qpid/shared_ptr.h" +#include "boost/shared_ptr.hpp" +#include "boost/weak_ptr.hpp" #include "qpid/framing/FrameHandler.h" #include "qpid/framing/ChannelHandler.h" #include "qpid/framing/SequenceNumber.h" @@ -63,7 +64,7 @@ class SessionImpl : public framing::FrameHandler::InOutHandler, private framing::AMQP_ClientOperations::ExecutionHandler { public: - SessionImpl(const std::string& name, shared_ptr, uint16_t channel, uint64_t maxFrameSize); + SessionImpl(const std::string& name, shared_ptr); ~SessionImpl(); @@ -106,6 +107,11 @@ public: /** Get timeout in seconds. */ uint32_t getTimeout() const; + /** Make this session use a weak_ptr to the ConnectionImpl. + * Used for sessions created by the ConnectionImpl itself. + */ + void setWeakPtr(bool weak=true); + private: enum State { INACTIVE, @@ -131,7 +137,6 @@ private: void handleIn(framing::AMQFrame& frame); void handleOut(framing::AMQFrame& frame); - void proxyOut(framing::AMQFrame& frame); void deliver(framing::AMQFrame& frame); Future sendCommand(const framing::AMQBody&, const framing::MethodContent* = 0); @@ -175,8 +180,11 @@ private: const uint64_t maxFrameSize; const SessionId id; - shared_ptr connection; - framing::FrameHandler::MemFunRef ioHandler; + shared_ptr connection(); + shared_ptr connectionShared; + boost::weak_ptr connectionWeak; + bool weakPtr; + framing::ChannelHandler channel; framing::AMQP_ServerProxy::Session proxy; -- cgit v1.2.1