From e861284318186f8d9cd64a7ddcc28b8d20b98721 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Fri, 19 Jan 2007 21:33:27 +0000 Subject: 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 --- cpp/lib/common/sys/ConnectionInputHandlerFactory.h | 4 +-- cpp/lib/common/sys/ConnectionOutputHandler.h | 41 ++++++++++++++++++++++ cpp/lib/common/sys/SessionContext.h | 41 ---------------------- cpp/lib/common/sys/apr/LFSessionContext.h | 4 +-- cpp/lib/common/sys/posix/EventChannelAcceptor.cpp | 2 +- cpp/lib/common/sys/posix/EventChannelConnection.h | 8 ++--- cpp/lib/common/sys/posix/check.h | 2 +- 7 files changed, 51 insertions(+), 51 deletions(-) create mode 100644 cpp/lib/common/sys/ConnectionOutputHandler.h delete mode 100644 cpp/lib/common/sys/SessionContext.h (limited to 'cpp/lib/common/sys') diff --git a/cpp/lib/common/sys/ConnectionInputHandlerFactory.h b/cpp/lib/common/sys/ConnectionInputHandlerFactory.h index 5bb5e17704..af7d411928 100644 --- a/cpp/lib/common/sys/ConnectionInputHandlerFactory.h +++ b/cpp/lib/common/sys/ConnectionInputHandlerFactory.h @@ -26,7 +26,7 @@ namespace qpid { namespace sys { -class SessionContext; +class ConnectionOutputHandler; class ConnectionInputHandler; /** @@ -36,7 +36,7 @@ class ConnectionInputHandler; class ConnectionInputHandlerFactory : private boost::noncopyable { public: - virtual ConnectionInputHandler* create(SessionContext* ctxt) = 0; + virtual ConnectionInputHandler* create(ConnectionOutputHandler* ctxt) = 0; virtual ~ConnectionInputHandlerFactory(){} }; diff --git a/cpp/lib/common/sys/ConnectionOutputHandler.h b/cpp/lib/common/sys/ConnectionOutputHandler.h new file mode 100644 index 0000000000..91849e1dfb --- /dev/null +++ b/cpp/lib/common/sys/ConnectionOutputHandler.h @@ -0,0 +1,41 @@ +/* + * + * 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. + * + */ +#ifndef _ConnectionOutputHandler_ +#define _ConnectionOutputHandler_ + +#include + +namespace qpid { +namespace sys { + +/** + * Provides the output handler associated with a connection. + */ +class ConnectionOutputHandler : public virtual qpid::framing::OutputHandler +{ + public: + virtual void close() = 0; +}; + +}} + + +#endif diff --git a/cpp/lib/common/sys/SessionContext.h b/cpp/lib/common/sys/SessionContext.h deleted file mode 100644 index 671e00774f..0000000000 --- a/cpp/lib/common/sys/SessionContext.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * - * 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. - * - */ -#ifndef _SessionContext_ -#define _SessionContext_ - -#include - -namespace qpid { -namespace sys { - -/** - * Provides the output handler associated with a connection. - */ -class SessionContext : public virtual qpid::framing::OutputHandler -{ - public: - virtual void close() = 0; -}; - -}} - - -#endif diff --git a/cpp/lib/common/sys/apr/LFSessionContext.h b/cpp/lib/common/sys/apr/LFSessionContext.h index 8cf50b87ba..81cfc0efda 100644 --- a/cpp/lib/common/sys/apr/LFSessionContext.h +++ b/cpp/lib/common/sys/apr/LFSessionContext.h @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include #include "APRSocket.h" @@ -40,7 +40,7 @@ namespace qpid { namespace sys { -class LFSessionContext : public virtual qpid::sys::SessionContext +class LFSessionContext : public virtual qpid::sys::ConnectionOutputHandler { const bool debug; APRSocket socket; diff --git a/cpp/lib/common/sys/posix/EventChannelAcceptor.cpp b/cpp/lib/common/sys/posix/EventChannelAcceptor.cpp index 787d12d6d1..548fbd1881 100644 --- a/cpp/lib/common/sys/posix/EventChannelAcceptor.cpp +++ b/cpp/lib/common/sys/posix/EventChannelAcceptor.cpp @@ -26,7 +26,7 @@ #include #include -#include +#include #include #include #include diff --git a/cpp/lib/common/sys/posix/EventChannelConnection.h b/cpp/lib/common/sys/posix/EventChannelConnection.h index 1504e92651..da7b6dca27 100644 --- a/cpp/lib/common/sys/posix/EventChannelConnection.h +++ b/cpp/lib/common/sys/posix/EventChannelConnection.h @@ -23,7 +23,7 @@ #include "EventChannelThreads.h" #include "sys/Monitor.h" -#include "sys/SessionContext.h" +#include "sys/ConnectionOutputHandler.h" #include "sys/ConnectionInputHandler.h" #include "sys/AtomicCount.h" #include "framing/AMQFrame.h" @@ -34,13 +34,13 @@ namespace sys { class ConnectionInputHandlerFactory; /** - * Implements SessionContext and delegates to a ConnectionInputHandler + * Implements ConnectionOutputHandler and delegates to a ConnectionInputHandler * for a connection via the EventChannel. *@param readDescriptor file descriptor for reading. *@param writeDescriptor file descriptor for writing, * by default same as readDescriptor */ -class EventChannelConnection : public SessionContext { +class EventChannelConnection : public ConnectionOutputHandler { public: EventChannelConnection( EventChannelThreads::shared_ptr threads, @@ -50,7 +50,7 @@ class EventChannelConnection : public SessionContext { bool isTrace = false ); - // TODO aconway 2006-11-30: SessionContext::send should take auto_ptr + // TODO aconway 2006-11-30: ConnectionOutputHandler::send should take auto_ptr virtual void send(qpid::framing::AMQFrame* frame) { send(std::auto_ptr(frame)); } diff --git a/cpp/lib/common/sys/posix/check.h b/cpp/lib/common/sys/posix/check.h index 5afbe8f5a8..57b5a5757c 100644 --- a/cpp/lib/common/sys/posix/check.h +++ b/cpp/lib/common/sys/posix/check.h @@ -45,7 +45,7 @@ class PosixError : public qpid::QpidError Exception* clone() const throw() { return new PosixError(*this); } - void throwSelf() { throw *this; } + void throwSelf() const { throw *this; } private: int errNo; -- cgit v1.2.1