summaryrefslogtreecommitdiff
path: root/qpid/cpp/rubygen
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2007-12-07 19:13:09 +0000
committerAlan Conway <aconway@apache.org>2007-12-07 19:13:09 +0000
commit93a87010ba58b42e2fe153504b4781978d128a6c (patch)
tree27c545a130a3ed4c83472db2c2ae07306c862e5a /qpid/cpp/rubygen
parent506d0479f23c39f75dc03a22f4b8adf52d281022 (diff)
downloadqpid-python-93a87010ba58b42e2fe153504b4781978d128a6c.tar.gz
Summary:
- Replaced InProcessBroker with BrokerFixture, uses a full loopback broker for more realistic tests. - Extracted non-generated parts of Session_0_10 into SessionBase. - Sundry small fixes. src/tests/BrokerFixture.h - in process broker with loopback connections. - tests can force a disorderly disconnect. src/qpid/client/Connector.h - back door to private members for BrokerFixture. - close() in destructor to avoid leaks. src/qpid/client/ConnectionImpl.h,cpp: - close() in destructor, to fix hang when destroyed without being closed. src/qpid/client/CompletionTracker.h,.cpp: - Fixed race in close/add. src/qpid/client/SessionBase.h,cpp: - Extracted all non-generated code from Session_0_10 into SessionBase - Added sync() src/tests/exception_test.cpp: Converted to boost & BrokerFixture src/tests/ClientChannelTest.cpp, ClientSessionTest.cpp: Use BrokerFixture git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@602182 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/rubygen')
-rw-r--r--qpid/cpp/rubygen/templates/Session.rb59
1 files changed, 6 insertions, 53 deletions
diff --git a/qpid/cpp/rubygen/templates/Session.rb b/qpid/cpp/rubygen/templates/Session.rb
index 167422d3a9..ff578b251c 100644
--- a/qpid/cpp/rubygen/templates/Session.rb
+++ b/qpid/cpp/rubygen/templates/Session.rb
@@ -68,19 +68,8 @@ class SessionNoKeywordGen < CppGen
def generate()
h_file(@file) {
- include "qpid/framing/amqp_framing.h"
- include "qpid/framing/Uuid.h"
- include "qpid/framing/amqp_structs.h"
- include "qpid/framing/ProtocolVersion.h"
- include "qpid/framing/MethodContent.h"
- include "qpid/framing/TransferContent.h"
- include "qpid/client/Completion.h"
- include "qpid/client/ConnectionImpl.h"
- include "qpid/client/Response.h"
- include "qpid/client/SessionCore.h"
- include "qpid/client/TypedResult.h"
- include "qpid/shared_ptr.h"
- include "<string>"
+ include "qpid/client/SessionBase.h"
+
namespace("qpid::client") {
genl "using std::string;"
genl "using framing::Content;"
@@ -94,59 +83,23 @@ class SessionNoKeywordGen < CppGen
genl "AMQP #{@amqp.version} session API."
genl @amqp.class_("session").doc
}
- cpp_class(@classname) {
+ cpp_class(@classname, "public SessionBase") {
public
- gen <<EOS
-#{@classname}();
-
-/** Get the next message frame-set from the session. */
-framing::FrameSet::shared_ptr get() { return impl->get(); }
-
-/** Get the session ID */
-Uuid getId() const { return impl->getId(); }
-
-/** @param sync if true all session methods block till a response arrives. */
-void setSynchronous(bool sync) { impl->setSync(sync); }
-
-/** Suspend the session, can be resumed on a different connection.
- * @see Connection::resume()
- */
-void suspend();
-
-/** Close the session */
-void close();
-
-Execution& execution() { return impl->getExecution(); }
-
-typedef framing::TransferContent DefaultContent;
-EOS
+ genl "Session_0_10() {}"
+ genl "Session_0_10(shared_ptr<SessionCore> core) : SessionBase(core) {}"
session_methods.each { |m|
genl
doxygen(m)
args=m.sig_c_default.join(", ")
genl "#{m.return_type} #{m.session_function}(#{args});"
}
- genl
- protected
- gen <<EOS
-shared_ptr<SessionCore> impl;
-framing::ProtocolVersion version;
-friend class Connection;
-#{@classname}(shared_ptr<SessionCore>);
-EOS
}}}}
cpp_file(@file) {
include @classname
include "qpid/framing/all_method_bodies.h"
namespace(@namespace) {
- gen <<EOS
-using namespace framing;
-#{@classname}::#{@classname}() {}
-#{@classname}::#{@classname}(shared_ptr<SessionCore> core) : impl(core) {}
-void #{@classname}::suspend() { impl->suspend(); }
-void #{@classname}::close() { impl->close(); }
-EOS
+ genl "using namespace framing;"
session_methods.each { |m|
genl
sig=m.signature_c.join(", ")