diff options
author | Alan Conway <aconway@apache.org> | 2008-10-09 19:36:51 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2008-10-09 19:36:51 +0000 |
commit | d6901e52ab3ee9c40eddc4ad3b4787127c36d874 (patch) | |
tree | 85b9ba2e0d0922be150480392ec1b706a6df5cd0 /cpp/src/qpid/client/SessionImpl.h | |
parent | 016ae5acebab0eaf6dd70f5d4d653fdfee93925d (diff) | |
download | qpid-python-d6901e52ab3ee9c40eddc4ad3b4787127c36d874.tar.gz |
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
Diffstat (limited to 'cpp/src/qpid/client/SessionImpl.h')
-rw-r--r-- | cpp/src/qpid/client/SessionImpl.h | 18 |
1 files changed, 13 insertions, 5 deletions
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<ConnectionImpl>, uint16_t channel, uint64_t maxFrameSize); + SessionImpl(const std::string& name, shared_ptr<ConnectionImpl>); ~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<ConnectionImpl> connection; - framing::FrameHandler::MemFunRef<SessionImpl, &SessionImpl::proxyOut> ioHandler; + shared_ptr<ConnectionImpl> connection(); + shared_ptr<ConnectionImpl> connectionShared; + boost::weak_ptr<ConnectionImpl> connectionWeak; + bool weakPtr; + framing::ChannelHandler channel; framing::AMQP_ServerProxy::Session proxy; |