qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acon...@apache.org
Subject svn commit: r576963 - in /incubator/qpid/trunk/qpid/cpp: rubygen/templates/ src/qpid/broker/ src/qpid/framing/
Date Tue, 18 Sep 2007 16:05:49 GMT
Author: aconway
Date: Tue Sep 18 09:05:48 2007
New Revision: 576963

URL: http://svn.apache.org/viewvc?rev=576963&view=rev
Log:

	* 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.

Modified:
    incubator/qpid/trunk/qpid/cpp/rubygen/templates/Proxy.rb
    incubator/qpid/trunk/qpid/cpp/src/qpid/broker/ConnectionAdapter.cpp
    incubator/qpid/trunk/qpid/cpp/src/qpid/broker/HandlerImpl.h
    incubator/qpid/trunk/qpid/cpp/src/qpid/framing/AMQFrame.h
    incubator/qpid/trunk/qpid/cpp/src/qpid/framing/Proxy.cpp
    incubator/qpid/trunk/qpid/cpp/src/qpid/framing/Proxy.h
    incubator/qpid/trunk/qpid/cpp/src/qpid/framing/amqp_types.h

Modified: incubator/qpid/trunk/qpid/cpp/rubygen/templates/Proxy.rb
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/rubygen/templates/Proxy.rb?rev=576963&r1=576962&r2=576963&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/rubygen/templates/Proxy.rb (original)
+++ incubator/qpid/trunk/qpid/cpp/rubygen/templates/Proxy.rb Tue Sep 18 09:05:48 2007
@@ -15,16 +15,11 @@
   
   def inner_class_decl(c)
     cname=c.name.caps
-    cpp_class(cname) {
-          gen <<EOS          
-ChannelAdapter& channel;
-
+    cpp_class(cname, "Proxy") {
+          gen <<EOS
 public:
-#{cname}(ChannelAdapter& ch) : channel(ch) {}
-virtual ~#{cname}() {}
-
+#{cname}(FrameHandler& f) : Proxy(f) {}
 static #{cname}& get(#{@classname}& proxy) { return proxy.get#{cname}(); }
-
 EOS
       c.methods_on(@chassis).each { |m|
         genl "virtual void #{m.cppname}(#{m.signature.join(",\n            ")});"
@@ -37,8 +32,8 @@
     c.methods_on(@chassis).each { |m| 
       genl "void #{@classname}::#{cname}::#{m.cppname}(#{m.signature.join(", ")})"
       scope { 
-        params=(["channel.getVersion()"]+m.param_names).join(", ")
-        genl "channel.send(#{m.body_name}(#{params}));"
+        params=(["getVersion()"]+m.param_names).join(", ")
+        genl "send(#{m.body_name}(#{params}));"
       }}
   end
 
@@ -46,10 +41,11 @@
     # .h file
     h_file(@filename) {
       include "qpid/framing/Proxy.h"
+      include "qpid/framing/amqp_types.h"
       namespace("qpid::framing") { 
         cpp_class(@classname, "public Proxy") {
           public
-          genl "#{@classname}(ChannelAdapter& ch);"
+          genl "#{@classname}(FrameHandler& out);"
           genl
           @amqp.classes.each { |c|
             inner_class_decl(c)
@@ -65,14 +61,13 @@
   cpp_file(@filename) {
       include "<sstream>"
       include "#{@classname}.h"
-      include "qpid/framing/ChannelAdapter.h"
       include "qpid/framing/amqp_types_full.h"
       Amqp.methods_on(@chassis).each { |m| include "qpid/framing/"+m.body_name }
       genl
       namespace("qpid::framing") { 
-        genl "#{@classname}::#{@classname}(ChannelAdapter& ch) :"
-        gen "    Proxy(ch)"
-        @amqp.classes.each { |c| gen ",\n    "+proxy_member(c)+"(channel)" }
+        genl "#{@classname}::#{@classname}(FrameHandler& f) :"
+        gen "    Proxy(f)"
+        @amqp.classes.each { |c| gen ",\n    "+proxy_member(c)+"(f)" }
         genl "{}\n"
         @amqp.classes.each { |c| inner_class_defn(c) }
       }}

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/broker/ConnectionAdapter.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/broker/ConnectionAdapter.cpp?rev=576963&r1=576962&r2=576963&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/broker/ConnectionAdapter.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/broker/ConnectionAdapter.cpp Tue Sep 18 09:05:48
2007
@@ -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::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*/,

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/broker/HandlerImpl.h
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/broker/HandlerImpl.h?rev=576963&r1=576962&r2=576963&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/broker/HandlerImpl.h (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/broker/HandlerImpl.h Tue Sep 18 09:05:48 2007
@@ -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 @@
 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;

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/framing/AMQFrame.h
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/framing/AMQFrame.h?rev=576963&r1=576962&r2=576963&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/framing/AMQFrame.h (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/framing/AMQFrame.h Tue Sep 18 09:05:48 2007
@@ -48,6 +48,10 @@
         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; }
 

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/framing/Proxy.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/framing/Proxy.cpp?rev=576963&r1=576962&r2=576963&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/framing/Proxy.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/framing/Proxy.cpp Tue Sep 18 09:05:48 2007
@@ -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

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/framing/Proxy.h
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/framing/Proxy.h?rev=576963&r1=576962&r2=576963&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/framing/Proxy.h (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/framing/Proxy.h Tue Sep 18 09:05:48 2007
@@ -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

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/framing/amqp_types.h
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/framing/amqp_types.h?rev=576963&r1=576962&r2=576963&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/framing/amqp_types.h (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/framing/amqp_types.h Tue Sep 18 09:05:48 2007
@@ -53,6 +53,7 @@
 class Content;
 class FieldTable;
 class SequenceNumberSet;
+class Uuid;
 
 // Useful constants
 



Mime
View raw message