Author: gsim
Date: Wed Aug 22 01:54:54 2007
New Revision: 568517

URL: http://svn.apache.org/viewvc?rev=568517&view=rev
Log:
Reapply rev 568249 with the changes made to the generator this time, rather 
than the generated file itself.


Modified:
    incubator/qpid/trunk/qpid/cpp/rubygen/templates/InvocationVisitor.rb
    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/InvocationVisitor.rb
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/rubygen/templates/InvocationVisitor.rb?rev=568517&r1=568516&r2=568517&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/rubygen/templates/InvocationVisitor.rb 
(original)
+++ incubator/qpid/trunk/qpid/cpp/rubygen/templates/InvocationVisitor.rb Wed 
Aug 22 01:54:54 2007
@@ -71,8 +71,8 @@
           }
           genl "public:"
           indent { 
-            genl "InvocationVisitor(AMQP_ServerOperations* _ops) : ops(_ops), 
invocable(0) {}" 
-            genl "InvocationVisitor(Invocable* _invocable) : ops(0), 
invocable(_invocable) {}" 
+            genl "InvocationVisitor(AMQP_ServerOperations* _ops) : ops(_ops), 
invocable(0), succeeded(false) {}" 
+            genl "InvocationVisitor(Invocable* _invocable) : ops(0), 
invocable(_invocable), succeeded(false) {}" 
             genl "const std::string& getResult() const { return result; }"
             genl "const bool hasResult() const { return !result.empty(); }"
             genl "bool wasHandled() const { return succeeded; }"

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=568517&r1=568516&r2=568517&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/rubygen/templates/structs.rb (original)
+++ incubator/qpid/trunk/qpid/cpp/rubygen/templates/structs.rb Wed Aug 22 
01:54:54 2007
@@ -129,45 +129,6 @@
     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=568517&r1=568516&r2=568517&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/framing/AMQMethodBody.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/framing/AMQMethodBody.cpp Wed Aug 22 
01:54:54 2007
@@ -19,10 +19,25 @@
  *
  */
 #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=568517&r1=568516&r2=568517&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/framing/AMQMethodBody.h (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/framing/AMQMethodBody.h Wed Aug 22 
01:54:54 2007
@@ -50,8 +50,8 @@
     virtual MethodId amqpMethodId() const = 0;
     virtual ClassId  amqpClassId() const = 0;
     
-    virtual void invoke(AMQP_ServerOperations&) { assert(0); }
-    virtual bool invoke(Invocable*) { return false; }
+    void invoke(AMQP_ServerOperations&);
+    bool invoke(Invocable*);
 
     template <class T> bool isA() const {
         return amqpClassId()==T::CLASS_ID && amqpMethodId()==T::METHOD_ID;


Reply via email to