diff options
| author | Alan Conway <aconway@apache.org> | 2007-08-27 13:50:17 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2007-08-27 13:50:17 +0000 |
| commit | 6888f1bec4682e1a444772cc3d17f4e59ba3c351 (patch) | |
| tree | 7a726bb88e282bda6423ec3057dd65bb62645700 /qpid/cpp/rubygen | |
| parent | 4d6bb608337f0aa6a4f8d96ae0df5fffd981f113 (diff) | |
| download | qpid-python-6888f1bec4682e1a444772cc3d17f4e59ba3c351.tar.gz | |
* src/qpid/framing/FrameDefaultVisitor.h:
Visitor for all concrete frame body types.
Override to handle specific bodies (methods or header/content)
and provide default handling for others.
* rubygen/MethodBodyDefaultVisitor.rb:
Visitor for MethodBodies with visit functions that call
virtual defaultVisit(). Override to handle specific methods
and give default behavior for others.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@570121 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/rubygen')
| -rwxr-xr-x | qpid/cpp/rubygen/MethodBodyDefaultVisitor.rb | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/qpid/cpp/rubygen/MethodBodyDefaultVisitor.rb b/qpid/cpp/rubygen/MethodBodyDefaultVisitor.rb new file mode 100755 index 0000000000..d1212153ca --- /dev/null +++ b/qpid/cpp/rubygen/MethodBodyDefaultVisitor.rb @@ -0,0 +1,34 @@ +#!/usr/bin/env ruby +$: << ".." # Include .. in load path +require 'cppgen' + +class MethodBodyDefaultVisitorGen < CppGen + + def initialize(outdir, amqp) + super(outdir, amqp) + set_classname("qpid::framing::MethodBodyDefaultVisitor") + end + + def generate() + h_file(@filename) { + include "qpid/framing/MethodBodyConstVisitor" + namespace(@namespace) { + genl + cpp_class(@classname, "public MethodBodyConstVisitor") { + genl "public:" + genl "virtual void defaultVisit() = 0;" + @amqp.methods_.each { |m| + genl "virtual void visit(const #{m.body_name}&);" } + }}} + + cpp_file(@filename) { + include(@filename) + namespace(@namespace) { + @amqp.methods_.each { |m| + genl "void #{@classname}::visit(const #{m.body_name}&) { defaultVisit(); }" + }}} + end +end + +MethodBodyDefaultVisitorGen.new(Outdir, Amqp).generate(); + |
