diff options
| author | Alan Conway <aconway@apache.org> | 2007-08-14 16:15:26 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2007-08-14 16:15:26 +0000 |
| commit | cb65298edd497295d215220397f8fedff7b14aca (patch) | |
| tree | 9f3a167ef11b0f3bd918507767fbf455d362d79d /cpp/src/qpid/framing | |
| parent | b3ddadd9b15088afecf1f9774d2004258b164258 (diff) | |
| download | qpid-python-cb65298edd497295d215220397f8fedff7b14aca.tar.gz | |
Removed unused types: RequestId, ResponseId, MethodContext.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@565821 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/framing')
| -rw-r--r-- | cpp/src/qpid/framing/AMQMethodBody.cpp | 2 | ||||
| -rw-r--r-- | cpp/src/qpid/framing/AMQMethodBody.h | 3 | ||||
| -rw-r--r-- | cpp/src/qpid/framing/ChannelAdapter.cpp | 10 | ||||
| -rw-r--r-- | cpp/src/qpid/framing/ChannelAdapter.h | 14 | ||||
| -rw-r--r-- | cpp/src/qpid/framing/MethodContext.h | 69 |
5 files changed, 6 insertions, 92 deletions
diff --git a/cpp/src/qpid/framing/AMQMethodBody.cpp b/cpp/src/qpid/framing/AMQMethodBody.cpp index eb34d48c5f..0a2720e69a 100644 --- a/cpp/src/qpid/framing/AMQMethodBody.cpp +++ b/cpp/src/qpid/framing/AMQMethodBody.cpp @@ -31,7 +31,7 @@ void AMQMethodBody::encodeId(Buffer& buffer) const{ buffer.putShort(amqpMethodId()); } -void AMQMethodBody::invoke(AMQP_ServerOperations&, const MethodContext&){ +void AMQMethodBody::invoke(AMQP_ServerOperations&){ assert(0); THROW_QPID_ERROR(PROTOCOL_ERROR, "Method not supported by AMQP Server."); } diff --git a/cpp/src/qpid/framing/AMQMethodBody.h b/cpp/src/qpid/framing/AMQMethodBody.h index cbfd438b48..73c5eb78a6 100644 --- a/cpp/src/qpid/framing/AMQMethodBody.h +++ b/cpp/src/qpid/framing/AMQMethodBody.h @@ -26,7 +26,6 @@ #include "AMQBody.h" #include "Buffer.h" #include "qpid/framing/AMQP_ServerOperations.h" -#include "MethodContext.h" namespace qpid { namespace framing { @@ -52,7 +51,7 @@ class AMQMethodBody : public AMQBody virtual MethodId amqpMethodId() const = 0; virtual ClassId amqpClassId() const = 0; - virtual void invoke(AMQP_ServerOperations&, const MethodContext&); + virtual void invoke(AMQP_ServerOperations&); virtual bool invoke(Invocable* target); template <class T> bool isA() { diff --git a/cpp/src/qpid/framing/ChannelAdapter.cpp b/cpp/src/qpid/framing/ChannelAdapter.cpp index b3b442004a..d61126bc7f 100644 --- a/cpp/src/qpid/framing/ChannelAdapter.cpp +++ b/cpp/src/qpid/framing/ChannelAdapter.cpp @@ -18,6 +18,7 @@ #include <boost/format.hpp> #include "ChannelAdapter.h" +#include "OutputHandler.h" #include "AMQFrame.h" #include "FrameHandler.h" #include "qpid/Exception.h" @@ -44,18 +45,11 @@ void ChannelAdapter::init(ChannelId i, OutputHandler& out, ProtocolVersion v) handlers.out= make_shared_ptr(new OutputHandlerFrameHandler(out)); } -RequestId ChannelAdapter::send(shared_ptr<AMQBody> body) +void ChannelAdapter::send(shared_ptr<AMQBody> body) { - RequestId requestId = 0; assertChannelOpen(); AMQFrame frame(getVersion(), getId(), body); handlers.out->handle(frame); - return requestId; -} - -void ChannelAdapter::handleMethod(AMQMethodBody::shared_ptr method) { - assertMethodOk(*method); - handleMethodInContext(method, MethodContext(this, method)); } void ChannelAdapter::assertMethodOk(AMQMethodBody& method) const { diff --git a/cpp/src/qpid/framing/ChannelAdapter.h b/cpp/src/qpid/framing/ChannelAdapter.h index 84a626c864..9e418013eb 100644 --- a/cpp/src/qpid/framing/ChannelAdapter.h +++ b/cpp/src/qpid/framing/ChannelAdapter.h @@ -34,7 +34,6 @@ namespace qpid { namespace framing { -class MethodContext; class OutputHandler; /** @@ -67,12 +66,7 @@ class ChannelAdapter : protected BodyHandler { ChannelId getId() const { return id; } ProtocolVersion getVersion() const { return version; } - /** - * Send a frame. - *@param body Body of the frame. - *@return If body is a request, the ID assigned else 0. - */ - virtual RequestId send(shared_ptr<AMQBody> body); + virtual void send(shared_ptr<AMQBody> body); virtual bool isOpen() const = 0; @@ -81,16 +75,12 @@ class ChannelAdapter : protected BodyHandler { void assertChannelOpen() const; void assertChannelNotOpen() const; - virtual void handleMethodInContext( - shared_ptr<AMQMethodBody> method, - const MethodContext& context) = 0; + virtual void handleMethod(shared_ptr<AMQMethodBody>) = 0; private: class ChannelAdapterHandler; friend class ChannelAdapterHandler; - void handleMethod(shared_ptr<AMQMethodBody>); - ChannelId id; ProtocolVersion version; FrameHandler::Chains handlers; diff --git a/cpp/src/qpid/framing/MethodContext.h b/cpp/src/qpid/framing/MethodContext.h deleted file mode 100644 index 102dc279d4..0000000000 --- a/cpp/src/qpid/framing/MethodContext.h +++ /dev/null @@ -1,69 +0,0 @@ -#ifndef _framing_MethodContext_h -#define _framing_MethodContext_h - -/* - * - * Copyright (c) 2006 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#include <boost/shared_ptr.hpp> - -#include "OutputHandler.h" -#include "ProtocolVersion.h" - -namespace qpid { -namespace framing { - -class BodyHandler; -class AMQMethodBody; -class ChannelAdapter; - -/** - * Invocation context for an AMQP method. - * - * It provides the method being processed and the channel on which - * it arrived. - * - * All Handler functions take a MethodContext as the last parameter. - */ -struct MethodContext -{ - typedef boost::shared_ptr<AMQMethodBody> BodyPtr; - - MethodContext(ChannelAdapter* ch=0, BodyPtr method=BodyPtr()) - : channel(ch), methodBody(method) {} - - /** - * Channel on which the method being processed arrived. - * 0 if the method was constructed by the caller - * rather than received from a channel. - */ - ChannelAdapter* channel; - - /** - * Body of the method being processed. - * It's useful for passing around instead of unpacking all its parameters. - * It's also provides the request ID when constructing a response. - */ - BodyPtr methodBody; -}; - - -}} // namespace qpid::framing - - - -#endif /*!_framing_MethodContext_h*/ |
