From 95ad2adfc443b227eba224279188c36906c1db66 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Thu, 28 Jul 2011 18:28:56 +0000 Subject: Merge branch 'visibility-hidden' into qpid-3163 git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/qpid-3163@1151956 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/rubygen/0-10/exceptions.rb | 11 +++--- .../rubygen/framing.0-10/MethodBodyConstVisitor.rb | 7 ++-- qpid/cpp/rubygen/framing.0-10/Session.rb | 40 +++++++++++----------- qpid/cpp/rubygen/framing.0-10/constants.rb | 17 ++++----- 4 files changed, 39 insertions(+), 36 deletions(-) (limited to 'qpid/cpp/rubygen') diff --git a/qpid/cpp/rubygen/0-10/exceptions.rb b/qpid/cpp/rubygen/0-10/exceptions.rb index 02e3a5d547..726f2fc4fb 100755 --- a/qpid/cpp/rubygen/0-10/exceptions.rb +++ b/qpid/cpp/rubygen/0-10/exceptions.rb @@ -33,7 +33,8 @@ class GenExceptions < CppGen name=c.name.typename+suffix+"Exception" genl doxygen_comment { genl c.doc } - struct(name, "public #{base}") { + cpp_extern_class("QPID_COMMON_CLASS_EXTERN", name, "public #{base}") { + public genl "#{name}(const std::string& msg=std::string())" genl " : #{base}(#{ns}::#{c.name.shout}, msg) {}" protected @@ -41,11 +42,11 @@ class GenExceptions < CppGen } } end - + def gen_exceptions() - h_file("#{@dir}/exceptions") { + h_file("#{@dir}/exceptions") { include "qpid/amqp_0_10/Exception" - namespace("#{@ns}") { + namespace("#{@ns}") { error_code = @amqp.class_("execution").domain("error-code").enum exceptions_for_enum(error_code, "SessionAbortedException", "execution") genl @@ -62,7 +63,7 @@ class GenExceptions < CppGen } } end - + def generate() gen_exceptions end diff --git a/qpid/cpp/rubygen/framing.0-10/MethodBodyConstVisitor.rb b/qpid/cpp/rubygen/framing.0-10/MethodBodyConstVisitor.rb index d784e589df..69111af4aa 100755 --- a/qpid/cpp/rubygen/framing.0-10/MethodBodyConstVisitor.rb +++ b/qpid/cpp/rubygen/framing.0-10/MethodBodyConstVisitor.rb @@ -21,7 +21,7 @@ $: << ".." # Include .. in load path require 'cppgen' class MethodBodyConstVisitorGen < CppGen - + def initialize(outdir, amqp) super(outdir, amqp) @namespace="qpid::framing" @@ -31,9 +31,10 @@ class MethodBodyConstVisitorGen < CppGen def generate() h_file("#{@filename}") { - namespace(@namespace) { + include("qpid/CommonImportExport.h") + namespace(@namespace) { @amqp.methods_.each { |m| genl "class #{m.body_name};" } - cpp_class("MethodBodyConstVisitor") { + cpp_extern_class("QPID_COMMON_CLASS_EXTERN", "MethodBodyConstVisitor") { genl "public:" genl "virtual ~MethodBodyConstVisitor() {}" @amqp.methods_.each { |m| genl "virtual void visit(const #{m.body_name}&) = 0;" } diff --git a/qpid/cpp/rubygen/framing.0-10/Session.rb b/qpid/cpp/rubygen/framing.0-10/Session.rb index e800df9b2e..15079192f8 100755 --- a/qpid/cpp/rubygen/framing.0-10/Session.rb +++ b/qpid/cpp/rubygen/framing.0-10/Session.rb @@ -18,7 +18,7 @@ # under the License. # # Usage: output_directory xml_spec_file [xml_spec_file...] -# +# $: << '..' require 'cppgen' @@ -31,7 +31,7 @@ class CppGen gen_methods.each { |m| m.set_sync_default(sync_default) } end - + # Generates a doxygen comment for AmqpMethod m. def doxygen(m) doxygen_comment { @@ -125,7 +125,7 @@ end class SessionNoKeywordGen < CppGen include SyncAsync - + def initialize(outdir, amqp, async) super(outdir, amqp) @async=async @@ -140,25 +140,25 @@ class SessionNoKeywordGen < CppGen h_file(@file) { include "qpid/client/#{@version_base}.h" include "qpid/client/ClientImportExport.h" - namespace(@namespace) { + namespace(@namespace) { doxygen_comment { genl "AMQP #{@amqp.version} #{sync_adjective} session API." genl @amqp.class_("session").doc # FIXME aconway 2008-05-23: additional doc on sync/async use. } - cpp_class(@classname, "public #{@version_base}") { + cpp_extern_class("QPID_CLIENT_CLASS_EXTERN", @classname, "public #{@version_base}") { public decl_ctor_opeq() session_methods(sync_default).each { |m| genl doxygen(m) - args=m.sig_c_default.join(", ") - genl "QPID_CLIENT_EXTERN #{m.return_type(@async)} #{m.session_function}(#{args});" + args=m.sig_c_default.join(", ") + genl "QPID_CLIENT_EXTERN #{m.return_type(@async)} #{m.session_function}(#{args});" } } }} - cpp_file(@file) { + cpp_file(@file) { include "qpid/client/#{@classname}" include "qpid/framing/all_method_bodies.h" include "qpid/client/SessionImpl.h" @@ -228,11 +228,11 @@ class SessionGen < CppGen # Generate keyword tag declarations. genl "#define BOOST_PARAMETER_MAX_ARITY #{max_arity}" include "" - namespace("qpid::client::arg") { + namespace("qpid::client::arg") { keyword_methods.map{ |m| m.param_names_c }.flatten.uniq.each { |k| genl "BOOST_PARAMETER_KEYWORD(keyword_tags, #{k})" }} - } + } public_api("#{@fqclass.file}.h") h_file(@fqclass.file) { include @fqbase.file @@ -263,7 +263,7 @@ declarations. \\ingroup clientapi -\\details +\\details

Publishing Messages