00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00026 #ifndef OW32_IOCPIoTimeoutManager_h
00027 #define OW32_IOCPIoTimeoutManager_h
00028
00029 #include <OW32/IoTimeoutManager.h>
00030
00031 #if _WIN32_WINNT < 0x0400
00032 #error This class requires waitable timer objects
00033 #endif
00034
00035 namespace OW32
00036 {
00037
00038 #ifdef _MSC_VER
00039 #pragma warning(disable: 4251)
00040 #endif
00041
00045 class CAsyncIoCompletionSocket;
00046
00050 class OW32_LIB_EXPORT CIOCPIoTimeoutManager : public CIoTimeoutManager
00051 {
00052 public:
00056 CIOCPIoTimeoutManager();
00057
00061 ~CIOCPIoTimeoutManager();
00062
00078 virtual bool addTimeout(CIoTimeoutCallback *pCallback, LPVOID key, __int64 after, bool *fUpdated = NULL);
00079
00090 virtual bool updateTimeout(CIoTimeoutCallback *pCallback, LPVOID key, __int64 after, bool *fUpdated = NULL);
00091
00099 virtual bool removeTimeout(LPVOID key);
00100
00111 virtual void drainTimeouts(CIoTimeoutDrainCallback *pCallback);
00112
00118 bool addTimeout(CAsyncIoCompletionSocket *pSocket);
00119
00125 bool updateTimeout(CAsyncIoCompletionSocket *pSocket);
00126
00132 void removeTimeout(CAsyncIoCompletionSocket *pSocket);
00133
00139 virtual bool shutdown();
00140
00147 bool initialise(HANDLE hCompletionPort);
00148
00149 private:
00151 CIOCPIoTimeoutManager(const CIOCPIoTimeoutManager &other);
00152 CIOCPIoTimeoutManager &operator=(const CIOCPIoTimeoutManager &other);
00153
00155 class Impl;
00156 Impl *m_impl;
00157 };
00158
00159 #ifdef _MSC_VER
00160 #pragma warning(default: 4251)
00161 #endif
00162
00163 }
00164
00165 #endif // OW32_IOCPIoTimeoutManager_h