diff options
| author | Andrew Stitcher <astitcher@apache.org> | 2012-10-24 05:51:31 +0000 |
|---|---|---|
| committer | Andrew Stitcher <astitcher@apache.org> | 2012-10-24 05:51:31 +0000 |
| commit | 18fd44d23d475bb9e928cd1371cd5c9b10ef8120 (patch) | |
| tree | 31f7f6fe333feb443f66dce70744f21d3cc3819f /qpid/cpp/include | |
| parent | d57d4cc03845a2227f1e696e17c5cbcf07535464 (diff) | |
| download | qpid-python-18fd44d23d475bb9e928cd1371cd5c9b10ef8120.tar.gz | |
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
Diffstat (limited to 'qpid/cpp/include')
| -rw-r--r-- | qpid/cpp/include/qpid/sys/IOHandle.h | 15 | ||||
| -rw-r--r-- | qpid/cpp/include/qpid/sys/posix/PrivatePosix.h | 22 |
2 files changed, 6 insertions, 31 deletions
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() {} }; |
