summaryrefslogtreecommitdiff
path: root/cpp/rubygen/samples/Operations.rb
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2007-08-21 15:51:41 +0000
committerGordon Sim <gsim@apache.org>2007-08-21 15:51:41 +0000
commitbb2883b9f5cfad0e028a9849ed91e36418a2d0ff (patch)
tree555686e2e819a875048610d88c2cee8e336b3687 /cpp/rubygen/samples/Operations.rb
parent955d5ccb544ff4f56d35c40aa8934cbf4dfff14e (diff)
downloadqpid-python-bb2883b9f5cfad0e028a9849ed91e36418a2d0ff.tar.gz
Refresh of transitional xml to more closely reflect latest specification
Initial execution-result support (not yet handled on c++ client) Generation is now all done through the ruby code (it is a little slower at present I'm afraid, will try to speed it up over the next weeks) git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@568174 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/rubygen/samples/Operations.rb')
-rwxr-xr-xcpp/rubygen/samples/Operations.rb85
1 files changed, 0 insertions, 85 deletions
diff --git a/cpp/rubygen/samples/Operations.rb b/cpp/rubygen/samples/Operations.rb
deleted file mode 100755
index 6b0a24a26c..0000000000
--- a/cpp/rubygen/samples/Operations.rb
+++ /dev/null
@@ -1,85 +0,0 @@
-#!/usr/bin/env ruby
-# Usage: output_directory xml_spec_file [xml_spec_file...]
-#
-$: << '..'
-require 'cppgen'
-
-class OperationsGen < CppGen
-
- def initialize(chassis, outdir, amqp)
- super(outdir, amqp)
- @chassis=chassis
- @classname="AMQP_#{@chassis.caps}Operations"
- end
-
- def handler_method (m)
- gen "\nvirtual void #{m.cppname}("
- gen m.signature.join(",\n")
- gen ") = 0;\n"
- end
-
- def handler_classname(c) c.name.caps+"Handler"; end
-
- def handler_class(c)
- handlerclass=handler_classname c
- gen <<EOS
-// ==================== class #{handlerclass} ====================
-class #{handlerclass} : Invocable {
- // Constructors and destructors
- public:
- #{handlerclass}(){};
- virtual ~#{handlerclass}() {}
- // Protocol methods
-EOS
- c.amqp_methods_on(@chassis).each { |m| handler_method(m) }
- gen <<EOS
-}; // class #{handlerclass}
-
-
-EOS
- end
-
- def handler_get(c)
- handlerclass=handler_classname c
- gen "virtual #{handlerclass}* get#{handlerclass}() = 0;\n"
- end
-
- def generate()
- h_file("#{@classname}.h") {
- gen <<EOS
-#include <sstream>
-#include "qpid/framing/ProtocolVersion.h"
-
-namespace qpid {
-namespace framing {
-
-class #{@classname} {
-
- public:
- virtual ~#{@classname}() {}
-
- virtual ProtocolVersion getVersion() const = 0;
-
- // Include framing constant declarations
- #include "AMQP_Constants.h"
-
- // Inner classes
-EOS
- indent { @amqp.amqp_classes.each { |c| handler_class(c) } }
- gen <<EOS
-
- // Method handler get methods
-
-EOS
- indent { @amqp.amqp_classes.each { |c| handler_get(c) } }
- gen <<EOS
-}; /* class #{@classname} */
-}
-EOS
-}
- end
-end
-
-OperationsGen.new("client",ARGV[0], Amqp).generate()
-OperationsGen.new("server",ARGV[0], Amqp).generate()
-