summaryrefslogtreecommitdiff
path: root/qpid/cpp/rubygen/framing.0-10
diff options
context:
space:
mode:
Diffstat (limited to 'qpid/cpp/rubygen/framing.0-10')
-rwxr-xr-xqpid/cpp/rubygen/framing.0-10/MethodBodyConstVisitor.rb7
-rwxr-xr-xqpid/cpp/rubygen/framing.0-10/Session.rb40
-rwxr-xr-xqpid/cpp/rubygen/framing.0-10/constants.rb17
3 files changed, 33 insertions, 31 deletions
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 "<boost/parameter.hpp>"
- 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
<h2>Publishing Messages</h2>
<ul>
@@ -274,7 +274,7 @@ declarations.
for (int i=0; i&lt;10; i++) {
message.setData(message_data.str());
- async(session).messageTransfer(arg::content=message, arg::destination="amq.direct");
+ async(session).messageTransfer(arg::content=message, arg::destination="amq.direct");
}
session.sync();
@@ -359,23 +359,23 @@ session.sync();
<h2>Accepting, Acquiring, Rejecting, or Releasing Messages</h2>
<ul>
<li><p>messageAccept() &mdash; acknowledges messages</p>
-<pre>SequenceSet tobeAccepted;
-toAccepted.add(msg.getId());
+<pre>SequenceSet tobeAccepted;
+toAccepted.add(msg.getId());
session.messageAccept(toBeAccepted);</pre>
</li>
<li><p>messageAcquire()</p>
<pre>SequenceSet tobeAcquired;
-toBeAcquired.add(msg.getId());
+toBeAcquired.add(msg.getId());
session.messageAcquire(toBeAcquired);</pre>
</li>
<li><p>messageReject()</p>
-<pre>SequenceSet tobeRejected;
-toRejected.add(msg.getId());
+<pre>SequenceSet tobeRejected;
+toRejected.add(msg.getId());
session.messageReject(toBeRejected);</pre>
</li>
<li><p>messageRelease()</p>
-<pre>SequenceSet tobeReleased;
-toReleased.add(msg.getId());
+<pre>SequenceSet tobeReleased;
+toReleased.add(msg.getId());
session.messageRelease(toBeReleased);</pre></li>
</ul>
@@ -394,7 +394,7 @@ session.messageRelease(toBeReleased);</pre></li>
EOS
}
# Session class.
- cpp_class(@classname,"public #{@base}") {
+ cpp_extern_class("QPID_COMMON_CLASS_EXTERN", @classname,"public #{@base}") {
public
decl_ctor_opeq()
private
diff --git a/qpid/cpp/rubygen/framing.0-10/constants.rb b/qpid/cpp/rubygen/framing.0-10/constants.rb
index 85bfb96ac0..63bf107e38 100755
--- a/qpid/cpp/rubygen/framing.0-10/constants.rb
+++ b/qpid/cpp/rubygen/framing.0-10/constants.rb
@@ -21,7 +21,7 @@ $: << ".." # Include .. in load path
require 'cppgen'
class ConstantsGen < CppGen
-
+
def initialize(outdir, amqp)
super(outdir, amqp)
@namespace="qpid::framing"
@@ -51,11 +51,11 @@ class ConstantsGen < CppGen
def typecode_h_cpp
path="#{@dir}/TypeCode"
- public_api(path+".h")
+ public_api(path+".h")
h_file(path) {
include("<iosfwd>")
include("\"qpid/sys/IntegerTypes.h\"")
- namespace(@namespace) {
+ namespace(@namespace) {
scope("enum TypeCode {", "};") {
genl @amqp.types.map { |t| "#{typecode_enum t} = #{t.code}" if t.code }.compact.join(",\n")
}
@@ -80,7 +80,7 @@ EOS
include("qpid/Exception.h")
include("qpid/Msg.h")
include("<ostream>")
- namespace(@namespace) {
+ namespace(@namespace) {
scope("const char* typeName(TypeCode t) {") {
scope("switch (t) {") {
@amqp.types.each { |t| genl "case #{typecode_enum t}: return \"#{t.name}\";" if t.code }
@@ -105,7 +105,7 @@ EOS
}
}
end
-
+
def enum_h()
public_api("#{@dir}/enum.h")
h_file("#{@dir}/enum.h") {
@@ -125,7 +125,7 @@ EOS
def declare_enum(enum)
# Generated like this: enum containing_class::Foo { FOO_X, FOO_Y; }
name="#{enum.parent.name.caps}"
- prefix=enum.parent.name.shout+"_"
+ prefix=enum.parent.name.shout+"_"
scope("enum #{name} {","};") {
genl enum.choices.collect { |c| "#{prefix}#{c.name.shout}=#{c.value}" }.join(",\n")
}
@@ -136,7 +136,8 @@ EOS
value="#{package}::#{enum.parent.name.shout}_#{c.name.shout}"
genl
doxygen_comment { genl c.doc }
- struct(c.name.caps+"Exception", base) {
+ cpp_extern_class("QPID_COMMON_CLASS_EXTERN", c.name.caps+"Exception", "public #{base}") {
+ public
genl "std::string getPrefix() const { return \"#{c.name}\"; }"
genl "#{c.name.caps}Exception(const std::string& msg=std::string()) : #{base}(#{value}, \"\"+msg) {}"
}
@@ -156,7 +157,7 @@ EOS
enum = @amqp.class_(class_name).domain(domain_name).enum
enum.choices.each { |c|
assign = "holder = new #{c.name.caps}Exception(text); " unless c.name == "normal"
- genl "case #{c.value}: #{assign}break;"
+ genl "case #{c.value}: #{assign}break;"
}
genl "default: holder = new #{invalid}(QPID_MSG(\"Bad #{enum.parent.name}: \" << code << \": \" << text));"
}