]>
Commit | Line | Data |
---|---|---|
30c45bdd VZ |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: wx/private/gsocketiohandler.h | |
51fe4b60 | 3 | // Purpose: class for registering sockets with wxSelectDispatcher |
30c45bdd | 4 | // Authors: Lukasz Michalski |
30c45bdd VZ |
5 | // Created: December 2006 |
6 | // Copyright: (c) Lukasz Michalski | |
7 | // RCS-ID: $Id$ | |
8 | // Licence: wxWindows licence | |
9 | ///////////////////////////////////////////////////////////////////////////// | |
10 | ||
11 | #ifndef _WX_PRIVATE_GSOCKETIOHANDLER_H_ | |
12 | #define _WX_PRIVATE_GSOCKETIOHANDLER_H_ | |
13 | ||
14 | #include "wx/defs.h" | |
30c45bdd | 15 | |
2804f77d | 16 | #if wxUSE_SOCKETS && wxUSE_SELECT_DISPATCHER |
30c45bdd | 17 | |
2804f77d | 18 | #include "wx/private/selectdispatcher.h" |
60913641 | 19 | #include "wx/private/socket.h" |
30c45bdd | 20 | |
51fe4b60 | 21 | class WXDLLIMPEXP_BASE wxSocketIOHandler : public wxFDIOHandler |
30c45bdd VZ |
22 | { |
23 | public: | |
51fe4b60 | 24 | wxSocketIOHandler(wxSocketImpl *socket) |
2804f77d VZ |
25 | { |
26 | m_socket = socket; | |
27 | m_flags = 0; | |
28 | } | |
29 | ||
30 | int GetFlags() const { return m_flags; } | |
31 | void RemoveFlag(wxFDIODispatcherEntryFlags flag) { m_flags &= ~flag; } | |
32 | void AddFlag(wxFDIODispatcherEntryFlags flag) { m_flags |= flag; } | |
30c45bdd | 33 | |
2804f77d VZ |
34 | virtual void OnReadWaiting() { m_socket->Detected_Read(); } |
35 | virtual void OnWriteWaiting() { m_socket->Detected_Write(); } | |
36 | virtual void OnExceptionWaiting() { m_socket->Detected_Read(); } | |
30c45bdd | 37 | |
b46b1d59 | 38 | private: |
51fe4b60 | 39 | wxSocketImpl *m_socket; |
30c45bdd VZ |
40 | int m_flags; |
41 | }; | |
42 | ||
2804f77d | 43 | #endif // wxUSE_SOCKETS && wxUSE_SELECT_DISPATCHER |
30c45bdd VZ |
44 | |
45 | #endif // _WX_PRIVATE_SOCKETEVTDISPATCH_H_ |