]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/private/fdiohandler.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/private/fdiohandler.h
3 // Purpose: declares wxFDIOHandler class
4 // Author: Vadim Zeitlin
6 // Copyright: (c) 2009 Vadim Zeitlin <vadim@wxwidgets.org>
7 // Licence: wxWindows licence
8 ///////////////////////////////////////////////////////////////////////////////
10 #ifndef _WX_PRIVATE_FDIOHANDLER_H_
11 #define _WX_PRIVATE_FDIOHANDLER_H_
13 // ----------------------------------------------------------------------------
14 // wxFDIOHandler: interface used to process events on file descriptors
15 // ----------------------------------------------------------------------------
20 wxFDIOHandler() { m_regmask
= 0; }
22 // called when descriptor is available for non-blocking read
23 virtual void OnReadWaiting() = 0;
25 // called when descriptor is available for non-blocking write
26 virtual void OnWriteWaiting() = 0;
28 // called when there is exception on descriptor
29 virtual void OnExceptionWaiting() = 0;
31 // called to check if the handler is still valid, only used by
32 // wxSocketImplUnix currently
33 virtual bool IsOk() const { return true; }
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
; }
43 // virtual dtor for the base class
44 virtual ~wxFDIOHandler() { }
49 wxDECLARE_NO_COPY_CLASS(wxFDIOHandler
);
52 #endif // _WX_PRIVATE_FDIOHANDLER_H_