From c11f9a79eec63da7aa6e6dac248a689a9d461beb Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Tue, 31 Jul 2007 20:00:10 +0000 Subject: Ruby code generator for C++. Not yet in active use yet but two sample templates are provided. Note: same dependency story as java codegen: distribution has pre-generated code so ruby not required to build a distro. Only required for svn working copy builds. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@561468 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/rubygen/samples/Proxy.rb | 153 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 153 insertions(+) create mode 100755 cpp/rubygen/samples/Proxy.rb (limited to 'cpp/rubygen/samples/Proxy.rb') diff --git a/cpp/rubygen/samples/Proxy.rb b/cpp/rubygen/samples/Proxy.rb new file mode 100755 index 0000000000..f7765f3729 --- /dev/null +++ b/cpp/rubygen/samples/Proxy.rb @@ -0,0 +1,153 @@ +#!/usr/bin/env ruby +$: << ".." # Include .. in load path +require 'cppgen' + +class ProxyGen < CppGen + + def initialize(chassis, outdir, amqp) + super(outdir, amqp) + @chassis=chassis + @classname="AMQP_#{@chassis.caps}Proxy" + end + + def include(m) gen "#include \"#{m.body_name}.h\"\n"; end + + def proxy_member(c) c.name.lcaps+"Proxy"; end + + def inner_class_decl(c) + cname=c.name.caps + gen < +#include "#{@classname}.h" +#include "qpid/framing/ChannelAdapter.h" +#include "qpid/framing/amqp_types_full.h" +EOS + @amqp.methods_on(@chassis).each { |m| include(m) } + gen <