diff options
| author | Alan Conway <aconway@apache.org> | 2008-02-27 16:37:48 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2008-02-27 16:37:48 +0000 |
| commit | 0731e05211ff5e47e6a8b2c006bd6012da5cc161 (patch) | |
| tree | c30b793e7db0471caf9cc9b2226fdf20a353c8f9 /cpp/rubygen/99-0/MethodBodyDefaultVisitor.rb | |
| parent | 178e1ad48948e5818ee3922cb73e515f581557d6 (diff) | |
| download | qpid-python-0731e05211ff5e47e6a8b2c006bd6012da5cc161.tar.gz | |
Generate code for both 0-99 preview and 0-10 final specs .
0-10 final: extended code generation and non-generated support classes.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@631638 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/rubygen/99-0/MethodBodyDefaultVisitor.rb')
| -rwxr-xr-x | cpp/rubygen/99-0/MethodBodyDefaultVisitor.rb | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/cpp/rubygen/99-0/MethodBodyDefaultVisitor.rb b/cpp/rubygen/99-0/MethodBodyDefaultVisitor.rb new file mode 100755 index 0000000000..a74b0c06d6 --- /dev/null +++ b/cpp/rubygen/99-0/MethodBodyDefaultVisitor.rb @@ -0,0 +1,35 @@ +#!/usr/bin/env ruby +$: << ".." # Include .. in load path +require 'cppgen' + +class MethodBodyDefaultVisitorGen < CppGen + + def initialize(outdir, amqp) + super(outdir, amqp) + @namespace, @classname, @filename = parse_classname("qpid::framing::MethodBodyDefaultVisitor") + end + + def generate() + h_file(@filename) { + include "qpid/framing/MethodBodyConstVisitor" + namespace(@namespace) { + genl "class AMQMethodBody;" + cpp_class(@classname, "public MethodBodyConstVisitor") { + genl "public:" + genl "virtual void defaultVisit(const AMQMethodBody&) = 0;" + @amqp.methods_.each { |m| + genl "virtual void visit(const #{m.body_name}&);" } + }}} + + cpp_file(@filename) { + include(@filename) + include("all_method_bodies.h") + namespace(@namespace) { + @amqp.methods_.each { |m| + genl "void #{@classname}::visit(const #{m.body_name}& b) { defaultVisit(b); }" + }}} + end +end + +MethodBodyDefaultVisitorGen.new($outdir, $amqp).generate(); + |
