diff options
author | Andrew Stitcher <astitcher@apache.org> | 2007-04-02 11:40:48 +0000 |
---|---|---|
committer | Andrew Stitcher <astitcher@apache.org> | 2007-04-02 11:40:48 +0000 |
commit | 9ecd69ebc88fb5d82a693e51eef0475c1a6b282e (patch) | |
tree | 841ab9ff2ebf92ad57bc9189eefc7448260577d1 /qpid/cpp/lib/common/framing/ChannelAdapter.h | |
parent | 4ee7e8cbd677bd2ddf3f49d535a547e99c0aa150 (diff) | |
download | qpid-python-9ecd69ebc88fb5d82a693e51eef0475c1a6b282e.tar.gz |
Fix for the most disruptive items in QPID-243.
* All #include lines now use '""' rather than '<>' where appropriate.
* #include lines within the qpid project use relative includes so that
the same path will work in /usr/include when installed as part of the
client libraries.
* All the source code has now been rearranged to be under src in a directory
analogous to the namespace of the classes in it.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@524769 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/lib/common/framing/ChannelAdapter.h')
-rw-r--r-- | qpid/cpp/lib/common/framing/ChannelAdapter.h | 105 |
1 files changed, 0 insertions, 105 deletions
diff --git a/qpid/cpp/lib/common/framing/ChannelAdapter.h b/qpid/cpp/lib/common/framing/ChannelAdapter.h deleted file mode 100644 index f6e3986eed..0000000000 --- a/qpid/cpp/lib/common/framing/ChannelAdapter.h +++ /dev/null @@ -1,105 +0,0 @@ -#ifndef _ChannelAdapter_ -#define _ChannelAdapter_ - -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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 "BodyHandler.h" -#include "Requester.h" -#include "Responder.h" -#include "framing/amqp_types.h" - -namespace qpid { -namespace framing { - -class MethodContext; - -// FIXME aconway 2007-02-20: Rename as ChannelBase or just Channel. - -/** - * Base class for client and broker channels. - * - * - receives frame bodies from the network. - * - Updates request/response data. - * - Dispatches requests with a MethodContext for responses. - * - * send() - * - Updates request/resposne ID data. - * - Forwards frame to the peer. - * - * Thread safety: OBJECT UNSAFE. Instances must not be called - * concurrently. AMQP defines channels to be serialized. - */ -class ChannelAdapter : public BodyHandler { - public: - /** - *@param output Processed frames are forwarded to this handler. - */ - ChannelAdapter(ChannelId id_=0, OutputHandler* out_=0, - ProtocolVersion ver=ProtocolVersion()) - : id(id_), out(out_), version(ver) {} - - /** Initialize the channel adapter. */ - void init(ChannelId, OutputHandler&, ProtocolVersion); - - ChannelId getId() const { return id; } - ProtocolVersion getVersion() const { return version; } - - /** - * Wrap body in a frame and send the frame. - * Takes ownership of body. - */ - RequestId send(AMQBody::shared_ptr body); - RequestId send(AMQBody* body) { return send(AMQBody::shared_ptr(body)); } - - void handleMethod(boost::shared_ptr<qpid::framing::AMQMethodBody>); - void handleRequest(boost::shared_ptr<qpid::framing::AMQRequestBody>); - void handleResponse(boost::shared_ptr<qpid::framing::AMQResponseBody>); - - virtual bool isOpen() const = 0; - - protected: - void assertMethodOk(AMQMethodBody& method) const; - void assertChannelOpen() const; - void assertChannelNotOpen() const; - - virtual void handleMethodInContext( - boost::shared_ptr<qpid::framing::AMQMethodBody> method, - const MethodContext& context) = 0; - - RequestId getFirstAckRequest() { return requester.getFirstAckRequest(); } - RequestId getLastAckRequest() { return requester.getLastAckRequest(); } - RequestId getNextSendRequestId() { return requester.getNextId(); } - - private: - ChannelId id; - OutputHandler* out; - ProtocolVersion version; - Requester requester; - Responder responder; -}; - -}} - - -#endif |