Author: aconway
Date: Tue Aug 21 14:52:31 2007
New Revision: 568298

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

Undo revision 568249, causing tests to hang.

------------------------------------------------------------------------
r568249 | gsim | 2007-08-21 16:11:20 -0400 (Tue, 21 Aug 2007) | 3 lines

Invocation now uses the visitor mechanism


------------------------------------------------------------------------

Modified:
    incubator/qpid/trunk/qpid/cpp/rubygen/templates/structs.rb
    incubator/qpid/trunk/qpid/cpp/src/qpid/framing/AMQMethodBody.cpp
    incubator/qpid/trunk/qpid/cpp/src/qpid/framing/AMQMethodBody.h

Modified: incubator/qpid/trunk/qpid/cpp/rubygen/templates/structs.rb
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/rubygen/templates/structs.rb?rev=568298&r1=568297&r2=568298&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/rubygen/templates/structs.rb (original)
+++ incubator/qpid/trunk/qpid/cpp/rubygen/templates/structs.rb Tue Aug 21 
14:52:31 2007
@@ -129,6 +129,45 @@
     inline ClassId amqpClassId() const { return CLASS_ID; }
     inline MethodId amqpMethodId() const { return METHOD_ID; }
 EOS
+    if (s.is_server_method?)
+      gen <<EOS
+    void invoke(AMQP_ServerOperations& target)
+    {
+        target.get#{s.amqp_parent.cppname}Handler()->#{s.cppname}
+            (            
+EOS
+      if (s.amqp_parent.name == "message" && (s.name == "transfer" || s.name 
== "append"))
+        indent(4) { genl "*this" }
+      else
+        indent(4) { genl s.param_names.join(",\n") }
+      end
+    
+      genl <<EOS
+            );
+    }
+
+    bool invoke(Invocable* target)
+    {
+        AMQP_ServerOperations::#{s.amqp_parent.cppname}Handler* ptr 
+            = 
dynamic_cast<AMQP_ServerOperations::#{s.amqp_parent.cppname}Handler*>(target);
+        if (ptr) {
+            ptr->#{s.cppname}(
+EOS
+      if (s.amqp_parent.name == "message" && (s.name == "transfer" || s.name 
== "append"))
+        indent(5) { genl "*this" }
+      else
+        indent(5) { genl s.param_names.join(",\n") }
+      end
+
+      gen <<EOS
+                    );
+            return true;
+        } else {
+            return false;
+        }
+    }
+EOS
+      end
   end
 
   def define_constructor(name, s)

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/framing/AMQMethodBody.cpp
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/framing/AMQMethodBody.cpp?rev=568298&r1=568297&r2=568298&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/framing/AMQMethodBody.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/framing/AMQMethodBody.cpp Tue Aug 21 
14:52:31 2007
@@ -19,25 +19,10 @@
  *
  */
 #include "AMQMethodBody.h"
-#include "qpid/framing/InvocationVisitor.h"
 
 namespace qpid {
 namespace framing {
 
 AMQMethodBody::~AMQMethodBody() {}
-
-void AMQMethodBody::invoke(AMQP_ServerOperations& ops) 
-{ 
-    InvocationVisitor v(&ops);
-    accept(v);
-    assert(v.wasHandled()); 
-}
-
-bool AMQMethodBody::invoke(Invocable* invocable) 
-{ 
-    InvocationVisitor v(invocable);
-    accept(v);
-    return v.wasHandled(); 
-}
 
 }} // namespace qpid::framing

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/framing/AMQMethodBody.h
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/framing/AMQMethodBody.h?rev=568298&r1=568297&r2=568298&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/framing/AMQMethodBody.h (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/framing/AMQMethodBody.h Tue Aug 21 
14:52:31 2007
@@ -50,8 +50,8 @@
     virtual MethodId amqpMethodId() const = 0;
     virtual ClassId  amqpClassId() const = 0;
     
-    void invoke(AMQP_ServerOperations&);
-    bool invoke(Invocable*);
+    virtual void invoke(AMQP_ServerOperations&) { assert(0); }
+    virtual bool invoke(Invocable*) { return false; }
 
     template <class T> bool isA() const {
         return amqpClassId()==T::CLASS_ID && amqpMethodId()==T::METHOD_ID;


Reply via email to