diff options
author | Alan Conway <aconway@apache.org> | 2007-09-18 16:05:48 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2007-09-18 16:05:48 +0000 |
commit | e0bf5acc51a983b2cb5c3d959b513d21a2cb57c1 (patch) | |
tree | 102c70e2e96cf745f4592f78f178fc2152a0eb78 /cpp/src | |
parent | 01e3826d26fd0efecd1663835143da15ebaa828d (diff) | |
download | qpid-python-e0bf5acc51a983b2cb5c3d959b513d21a2cb57c1.tar.gz |
* rubygen/templates/Proxy.rb, src/qpid/framing/Proxy.cpp, Proxy.h:
Drop ChannelAdapter, construct Proxy from FrameHandler.
* src/qpid/framing/amqp_types.h: Added missing decl for class Uuid.
* src/qpid/broker/HandlerImpl.h, src/qpid/broker/ConnectionAdapter.cpp: Fix Proxy constructor calls
* src/qpid/framing/AMQFrame.h (class AMQFrame): construct from AMQBody only.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@576963 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/qpid/broker/ConnectionAdapter.cpp | 3 | ||||
-rw-r--r-- | cpp/src/qpid/broker/HandlerImpl.h | 3 | ||||
-rw-r--r-- | cpp/src/qpid/framing/AMQFrame.h | 4 | ||||
-rw-r--r-- | cpp/src/qpid/framing/Proxy.cpp | 13 | ||||
-rw-r--r-- | cpp/src/qpid/framing/Proxy.h | 16 | ||||
-rw-r--r-- | cpp/src/qpid/framing/amqp_types.h | 1 |
6 files changed, 25 insertions, 15 deletions
diff --git a/cpp/src/qpid/broker/ConnectionAdapter.cpp b/cpp/src/qpid/broker/ConnectionAdapter.cpp index 7672daed10..c38800f458 100644 --- a/cpp/src/qpid/broker/ConnectionAdapter.cpp +++ b/cpp/src/qpid/broker/ConnectionAdapter.cpp @@ -22,6 +22,7 @@ #include "ConnectionAdapter.h" #include "Connection.h" +#include "qpid/framing/ChannelAdapter.h" using namespace qpid; using namespace qpid::broker; @@ -75,7 +76,7 @@ ConnectionAdapter::ConnectionAdapter(Connection& connection) } ConnectionAdapter::Handler:: Handler(Connection& c, ConnectionAdapter& a) : - proxy(a), client(proxy.getConnection()), connection(c) {} + proxy(a.getHandlers().out), client(proxy.getConnection()), connection(c) {} void ConnectionAdapter::Handler::startOk(const FieldTable& /*clientProperties*/, diff --git a/cpp/src/qpid/broker/HandlerImpl.h b/cpp/src/qpid/broker/HandlerImpl.h index 5a2c5fec79..6350aa32c5 100644 --- a/cpp/src/qpid/broker/HandlerImpl.h +++ b/cpp/src/qpid/broker/HandlerImpl.h @@ -21,6 +21,7 @@ #include "Broker.h" #include "qpid/framing/AMQP_ClientProxy.h" +#include "qpid/framing/ChannelAdapter.h" namespace qpid { namespace broker { @@ -35,7 +36,7 @@ class Session; struct CoreRefs { CoreRefs(Session& ch, Connection& c, Broker& b, framing::ChannelAdapter& a) - : session(ch), connection(c), broker(b), adapter(a), proxy(a) {} + : session(ch), connection(c), broker(b), adapter(a), proxy(a.getHandlers().out) {} Session& session; Connection& connection; diff --git a/cpp/src/qpid/framing/AMQFrame.h b/cpp/src/qpid/framing/AMQFrame.h index f4aec72e4c..392b8c0c01 100644 --- a/cpp/src/qpid/framing/AMQFrame.h +++ b/cpp/src/qpid/framing/AMQFrame.h @@ -48,6 +48,10 @@ class AMQFrame : public AMQDataBlock setBody(b); } + AMQFrame(const AMQBody& b) : bof(true), eof(true), bos(true), eos(true), subchannel(0), channel(0) { + setBody(b); + } + ChannelId getChannel() const { return channel; } void setChannel(ChannelId c) { channel = c; } diff --git a/cpp/src/qpid/framing/Proxy.cpp b/cpp/src/qpid/framing/Proxy.cpp index 0b2a882a49..b47060028f 100644 --- a/cpp/src/qpid/framing/Proxy.cpp +++ b/cpp/src/qpid/framing/Proxy.cpp @@ -17,16 +17,21 @@ */ #include "Proxy.h" -#include "ChannelAdapter.h" -#include "ProtocolVersion.h" +#include "AMQFrame.h" namespace qpid { namespace framing { Proxy::~Proxy() {} -ProtocolVersion Proxy::getProtocolVersion() const { - return channel.getVersion(); +void Proxy::send(const AMQBody& b) { + AMQFrame f(b); + out.handle(f); +} + + +ProtocolVersion Proxy::getVersion() const { + return ProtocolVersion(); } }} // namespace qpid::framing diff --git a/cpp/src/qpid/framing/Proxy.h b/cpp/src/qpid/framing/Proxy.h index 279f219ddd..b6ac897e96 100644 --- a/cpp/src/qpid/framing/Proxy.h +++ b/cpp/src/qpid/framing/Proxy.h @@ -19,31 +19,29 @@ * */ +#include "FrameHandler.h" #include "ProtocolVersion.h" -#include "amqp_types.h" namespace qpid { namespace framing { -class ChannelAdapter; -class FieldTable; -class Content; -class Uuid; +class AMQBody; /** * Base class for proxies. */ class Proxy { - public: - Proxy(ChannelAdapter& ch) : channel(ch) {} + Proxy(FrameHandler& h) : out(h) {} virtual ~Proxy(); - ProtocolVersion getProtocolVersion() const; + void send(const AMQBody&); + + ProtocolVersion getVersion() const; protected: - ChannelAdapter& channel; + FrameHandler& out; }; }} // namespace qpid::framing diff --git a/cpp/src/qpid/framing/amqp_types.h b/cpp/src/qpid/framing/amqp_types.h index bfd5b2206f..b922d33dbc 100644 --- a/cpp/src/qpid/framing/amqp_types.h +++ b/cpp/src/qpid/framing/amqp_types.h @@ -53,6 +53,7 @@ typedef uint16_t ReplyCode; class Content; class FieldTable; class SequenceNumberSet; +class Uuid; // Useful constants |