#!/usr/bin/env ruby $: << ".." # Include .. in load path require 'cppgen' class InvocationVisitor < CppGen def initialize(outdir, amqp) super(outdir, amqp) @namespace="qpid::framing" @classname="InvocationVisitor" @filename="qpid/framing/InvocationVisitor" end def invocation_args(m) if (m.parent.name == "message" && (m.name == "transfer" || m.name == "append")) "body" else m.param_names.collect {|p| "body.get" + p.caps + "()" }.join(",\n") end end def null_visit(m) genl "void InvocationVisitor::visit(const #{m.body_name}&){}" end def define_visit(m) if (m.fields.size > 0) body = "body" else body = "/*body*/" end gen <(invocable); } else { ptr = ops->get#{m.parent.cppname}Handler(); } if (ptr) { EOS if (m.result) indent(2) { genl "encode<#{m.result.struct.cpptype.name}>(ptr->#{m.cppname}(#{invocation_args(m)}), result);" } else indent(2) { genl "ptr->#{m.cppname}(#{invocation_args(m)});" } end gen <