summaryrefslogtreecommitdiff
path: root/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
commit7bc8f20e59e8f18926119a4bc5fdb5be262c500c (patch)
tree5112c5428872273dd26092cb5c8bdc3af3beb00e /cpp/rubygen
parent237c3437a5a4b68c483af77c5d1346104ca404a0 (diff)
downloadqpid-python-7bc8f20e59e8f18926119a4bc5fdb5be262c500c.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/qpid@602182 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/rubygen')
-rw-r--r--cpp/rubygen/templates/Session.rb59
1 files changed, 6 insertions, 53 deletions
diff --git a/cpp/rubygen/templates/Session.rb b/cpp/rubygen/templates/Session.rb
index 167422d3a9..ff578b251c 100644
--- a/cpp/rubygen/templates/Session.rb
+++ b/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(", ")