From 18fd44d23d475bb9e928cd1371cd5c9b10ef8120 Mon Sep 17 00:00:00 2001 From: Andrew Stitcher Date: Wed, 24 Oct 2012 05:51:31 +0000 Subject: QPID-4272: Large amounts of code are duplicated between the SSL and TCP transports Lift Socket into an interface with concrete implementations - BSDSocket, WinSocket and SslSocket - As a side effect completely change the approach we use for platform specific handles: IOHandle now directly carries the platform handle but its real type is only exposed to platform specific code. - Modified RDMA code for the new IOHandle approach git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1401559 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/include/qpid/sys/IOHandle.h | 15 +-------------- qpid/cpp/include/qpid/sys/posix/PrivatePosix.h | 22 +++++----------------- 2 files changed, 6 insertions(+), 31 deletions(-) (limited to 'qpid/cpp/include') diff --git a/qpid/cpp/include/qpid/sys/IOHandle.h b/qpid/cpp/include/qpid/sys/IOHandle.h index 45fc8c240a..06ae65f879 100644 --- a/qpid/cpp/include/qpid/sys/IOHandle.h +++ b/qpid/cpp/include/qpid/sys/IOHandle.h @@ -22,8 +22,6 @@ * */ -#include "qpid/CommonImportExport.h" - namespace qpid { namespace sys { @@ -31,18 +29,7 @@ namespace sys { * This is a class intended to abstract the Unix concept of file descriptor * or the Windows concept of HANDLE */ -class PollerHandle; -class IOHandlePrivate; -class IOHandle { - friend class PollerHandle; - friend class IOHandlePrivate; - -protected: - IOHandlePrivate* const impl; - - IOHandle(IOHandlePrivate*); - QPID_COMMON_EXTERN virtual ~IOHandle(); -}; +class IOHandle; }} diff --git a/qpid/cpp/include/qpid/sys/posix/PrivatePosix.h b/qpid/cpp/include/qpid/sys/posix/PrivatePosix.h index 79cb950275..0f59fe3176 100644 --- a/qpid/cpp/include/qpid/sys/posix/PrivatePosix.h +++ b/qpid/cpp/include/qpid/sys/posix/PrivatePosix.h @@ -23,7 +23,6 @@ */ #include "qpid/sys/Time.h" -#include "qpid/sys/IOHandle.h" struct timespec; struct timeval; @@ -41,32 +40,21 @@ Duration toTime(const struct timespec& ts); class SocketAddress; const struct addrinfo& getAddrInfo(const SocketAddress&); -// Private fd related implementation details -class IOHandlePrivate { +// Posix fd as an IOHandle +class IOHandle { public: - IOHandlePrivate(int f = -1) : - fd(f) + IOHandle(int fd0 = -1) : + fd(fd0) {} int fd; }; -int toFd(const IOHandlePrivate* h); - -// Posix fd as an IOHandle -class PosixIOHandle : public IOHandle { -public: - PosixIOHandle(int fd) : - IOHandle(new IOHandlePrivate(fd)) - {} -}; - // Dummy IOHandle for places it's required in the API // but we promise not to actually try to do any operations on the IOHandle class NullIOHandle : public IOHandle { public: - NullIOHandle() : - IOHandle(new IOHandlePrivate) + NullIOHandle() {} }; -- cgit v1.2.1