]>
Commit | Line | Data |
---|---|---|
1 | /////////////////////////////////////////////////////////////////////////////// | |
2 | // Name: wx/private/fdiohandler.h | |
3 | // Purpose: declares wxFDIOHandler class | |
4 | // Author: Vadim Zeitlin | |
5 | // Created: 2009-08-17 | |
6 | // Copyright: (c) 2009 Vadim Zeitlin <vadim@wxwidgets.org> | |
7 | // Licence: wxWindows licence | |
8 | /////////////////////////////////////////////////////////////////////////////// | |
9 | ||
10 | #ifndef _WX_PRIVATE_FDIOHANDLER_H_ | |
11 | #define _WX_PRIVATE_FDIOHANDLER_H_ | |
12 | ||
13 | // ---------------------------------------------------------------------------- | |
14 | // wxFDIOHandler: interface used to process events on file descriptors | |
15 | // ---------------------------------------------------------------------------- | |
16 | ||
17 | class wxFDIOHandler | |
18 | { | |
19 | public: | |
20 | wxFDIOHandler() { m_regmask = 0; } | |
21 | ||
22 | // called when descriptor is available for non-blocking read | |
23 | virtual void OnReadWaiting() = 0; | |
24 | ||
25 | // called when descriptor is available for non-blocking write | |
26 | virtual void OnWriteWaiting() = 0; | |
27 | ||
28 | // called when there is exception on descriptor | |
29 | virtual void OnExceptionWaiting() = 0; | |
30 | ||
31 | // called to check if the handler is still valid, only used by | |
32 | // wxSocketImplUnix currently | |
33 | virtual bool IsOk() const { return true; } | |
34 | ||
35 | ||
36 | // get/set the mask of events for which we're currently registered for: | |
37 | // it's a combination of wxFDIO_{INPUT,OUTPUT,EXCEPTION} | |
38 | int GetRegisteredEvents() const { return m_regmask; } | |
39 | void SetRegisteredEvent(int flag) { m_regmask |= flag; } | |
40 | void ClearRegisteredEvent(int flag) { m_regmask &= ~flag; } | |
41 | ||
42 | ||
43 | // virtual dtor for the base class | |
44 | virtual ~wxFDIOHandler() { } | |
45 | ||
46 | private: | |
47 | int m_regmask; | |
48 | ||
49 | wxDECLARE_NO_COPY_CLASS(wxFDIOHandler); | |
50 | }; | |
51 | ||
52 | #endif // _WX_PRIVATE_FDIOHANDLER_H_ | |
53 |