From 0731e05211ff5e47e6a8b2c006bd6012da5cc161 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Wed, 27 Feb 2008 16:37:48 +0000 Subject: 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 --- cpp/rubygen/99-0/MethodBodyDefaultVisitor.rb | 35 ++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 cpp/rubygen/99-0/MethodBodyDefaultVisitor.rb (limited to 'cpp/rubygen/99-0/MethodBodyDefaultVisitor.rb') 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(); + -- cgit v1.2.1