diff options
| author | Andrew Stitcher <astitcher@apache.org> | 2008-07-09 20:36:17 +0000 |
|---|---|---|
| committer | Andrew Stitcher <astitcher@apache.org> | 2008-07-09 20:36:17 +0000 |
| commit | 2212c5a5b56466491986220ddd6a3aa4e81ff4e4 (patch) | |
| tree | b1104abc063d7cf0d869ce7be74e5e84474d2c88 /cpp/src/qpid/sys/AsynchIO.h | |
| parent | 9575428feb2a81323f0426361830bc543eba29db (diff) | |
| download | qpid-python-2212c5a5b56466491986220ddd6a3aa4e81ff4e4.tar.gz | |
Some small changes which clean up header file inclusions
and generally start to tidy up the network layer so that it's
a bit easier to implement new network transports
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@675338 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/sys/AsynchIO.h')
| -rw-r--r-- | cpp/src/qpid/sys/AsynchIO.h | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/cpp/src/qpid/sys/AsynchIO.h b/cpp/src/qpid/sys/AsynchIO.h index 847bdc50e4..ff7823e00d 100644 --- a/cpp/src/qpid/sys/AsynchIO.h +++ b/cpp/src/qpid/sys/AsynchIO.h @@ -22,13 +22,14 @@ */ #include "Dispatcher.h" -#include "Socket.h" #include <boost/function.hpp> #include <deque> namespace qpid { namespace sys { + +class Socket; /* * Asynchronous acceptor: accepts connections then does a callback with the @@ -78,6 +79,23 @@ private: void failure(int, std::string); }; +struct AsynchIOBufferBase { + char* const bytes; + const int32_t byteCount; + int32_t dataStart; + int32_t dataCount; + + AsynchIOBufferBase(char* const b, const int32_t s) : + bytes(b), + byteCount(s), + dataStart(0), + dataCount(0) + {} + + virtual ~AsynchIOBufferBase() + {} +}; + /* * Asychronous reader/writer: * Reader accepts buffers to read into; reads into the provided buffers @@ -92,22 +110,7 @@ private: */ class AsynchIO : private DispatchHandle { public: - struct BufferBase { - char* const bytes; - const int32_t byteCount; - int32_t dataStart; - int32_t dataCount; - - BufferBase(char* const b, const int32_t s) : - bytes(b), - byteCount(s), - dataStart(0), - dataCount(0) - {} - - virtual ~BufferBase() - {} - }; + typedef AsynchIOBufferBase BufferBase; typedef boost::function2<void, AsynchIO&, BufferBase*> ReadCallback; typedef boost::function1<void, AsynchIO&> EofCallback; |
