summaryrefslogtreecommitdiff
path: root/cpp/lib/common/framing/MethodContext.h
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2007-01-19 21:33:27 +0000
committerAlan Conway <aconway@apache.org>2007-01-19 21:33:27 +0000
commite861284318186f8d9cd64a7ddcc28b8d20b98721 (patch)
tree6dac612d65297dc5f104350884fc01385c69ecda /cpp/lib/common/framing/MethodContext.h
parent226be67c91b25a5ba8efdd9ba88566033ec97718 (diff)
downloadqpid-python-e861284318186f8d9cd64a7ddcc28b8d20b98721.tar.gz
Last big refactoring for 0-9 framing. Still need additional tests &
debugging but the overall structure is all in place. * configure.ac: Added -Wno_virtual_overload warning * ChannelTest.cpp, MessageBuilderTest.cpp: Fixed virtual overload warnings. * ChannelAdapter.cpp: Common base for client/broker adapters. Creates invocation context, handles request/resposne IDs. * CppGenerator.java: - Proxies send methods using MethodContext. * Various .h files: removed unnecessary #includes, added to requred .cpp files. * ConnectionContext: renamed from SessionContext. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/qpid.0-9@497963 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/lib/common/framing/MethodContext.h')
-rw-r--r--cpp/lib/common/framing/MethodContext.h32
1 files changed, 23 insertions, 9 deletions
diff --git a/cpp/lib/common/framing/MethodContext.h b/cpp/lib/common/framing/MethodContext.h
index 13d5f658ca..1aa4be8f1e 100644
--- a/cpp/lib/common/framing/MethodContext.h
+++ b/cpp/lib/common/framing/MethodContext.h
@@ -19,6 +19,9 @@
*
*/
+#include "OutputHandler.h"
+#include "ProtocolVersion.h"
+
namespace qpid {
namespace framing {
@@ -26,11 +29,14 @@ class BodyHandler;
/**
* Invocation context for an AMQP method.
+ * Some of the context information is related to the channel, some
+ * to the specific invocation - e.g. requestId.
+ *
* All generated proxy and handler functions take a MethodContext parameter.
*
- * The user calling on a broker proxy can simply pass an integer
- * channel ID, it will implicitly be converted to an appropriate context.
- *
+ * The user does not need to create MethodContext objects explicitly,
+ * the constructor will implicitly create one from a channel ID.
+ *
* Other context members are for internal use.
*/
struct MethodContext
@@ -39,13 +45,21 @@ struct MethodContext
* Passing a integer channel-id in place of a MethodContext
* will automatically construct the MethodContext.
*/
- MethodContext(ChannelId channel, RequestId request=0)
- : channelId(channel), requestId(request) {}
+ MethodContext(
+ ChannelId channel, OutputHandler* output=0, RequestId request=0)
+ : channelId(channel), out(output), requestId(request){}
+
+ /** \internal Channel on which the method is sent. */
+ const ChannelId channelId;
+
+ /** Output handler for responses in this context */
+ OutputHandler* out;
+
+ /** \internal If we are in the context of processing an incoming request,
+ * this is the ID. Otherwise it is 0.
+ */
+ const RequestId requestId;
- /** Channel on which the method is sent. */
- ChannelId channelId;
- /** \internal For proxy response: the original request or 0. */
- RequestId requestId;
};
}} // namespace qpid::framing